diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index 1d96dae7b13e..6cba564ffbff 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -79,8 +79,8 @@ elif [ "$NODE_INDEX" = "4" ]; then #mvn --no-snapshot-updates --quiet verify -Psamples.circleci.node4 -Dorg.slf4j.simpleLogger.defaultLogLevel=error (cd samples/openapi3/client/petstore/python && make test) - (cd samples/openapi3/client/petstore/python-experimental && make test) - (cd samples/openapi3/client/3_0_3_unit_test/python-experimental && make test) + (cd samples/openapi3/client/petstore/python-prior && make test) + (cd samples/openapi3/client/3_0_3_unit_test/python && make test) else echo "Running node $NODE_INDEX to test 'samples.circleci.others' defined in pom.xml ..." diff --git a/bin/configs/python-extensions-x-auth-id-alias.yaml b/bin/configs/python-prior-extensions-x-auth-id-alias.yaml similarity index 87% rename from bin/configs/python-extensions-x-auth-id-alias.yaml rename to bin/configs/python-prior-extensions-x-auth-id-alias.yaml index 6f6fd89e3770..a017b13b22a1 100644 --- a/bin/configs/python-extensions-x-auth-id-alias.yaml +++ b/bin/configs/python-prior-extensions-x-auth-id-alias.yaml @@ -1,5 +1,5 @@ -generatorName: python -outputDir: samples/openapi3/client/extensions/x-auth-id-alias/python/ +generatorName: python-prior +outputDir: samples/openapi3/client/extensions/x-auth-id-alias/python-prior/ inputSpec: modules/openapi-generator/src/test/resources/3_0/extensions/x-auth-id-alias.yaml templateDir: modules/openapi-generator/src/main/resources/python additionalProperties: diff --git a/bin/configs/python-oas2.yaml b/bin/configs/python-prior-oas2.yaml similarity index 77% rename from bin/configs/python-oas2.yaml rename to bin/configs/python-prior-oas2.yaml index 7c548fb39269..160afab7d942 100644 --- a/bin/configs/python-oas2.yaml +++ b/bin/configs/python-prior-oas2.yaml @@ -2,9 +2,9 @@ # which makes it default to false # that false setting is needed for composed schemas to work # Composed schemas are schemas that contain the allOf/oneOf/anyOf keywords. v2 specs only support the allOf keyword. -generatorName: python -outputDir: samples/client/petstore/python -inputSpec: modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/python +generatorName: python-prior +outputDir: samples/client/petstore/python-prior +inputSpec: modules/openapi-generator/src/test/resources/2_0/python-prior/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/python-prior additionalProperties: packageName: petstore_api diff --git a/bin/configs/python-oas2_disallowAdditionalPropertiesIfNotPresent.yaml b/bin/configs/python-prior-oas2_disallowAdditionalPropertiesIfNotPresent.yaml similarity index 55% rename from bin/configs/python-oas2_disallowAdditionalPropertiesIfNotPresent.yaml rename to bin/configs/python-prior-oas2_disallowAdditionalPropertiesIfNotPresent.yaml index 841cf77854eb..e524b83b4eae 100644 --- a/bin/configs/python-oas2_disallowAdditionalPropertiesIfNotPresent.yaml +++ b/bin/configs/python-prior-oas2_disallowAdditionalPropertiesIfNotPresent.yaml @@ -1,7 +1,7 @@ -generatorName: python -outputDir: samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent -inputSpec: modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/python +generatorName: python-prior +outputDir: samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent +inputSpec: modules/openapi-generator/src/test/resources/2_0/python-prior/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/python-prior additionalProperties: disallowAdditionalPropertiesIfNotPresent: "true" packageName: petstore_api diff --git a/bin/configs/python-experimental.yaml b/bin/configs/python-prior.yaml similarity index 50% rename from bin/configs/python-experimental.yaml rename to bin/configs/python-prior.yaml index dd204f44938d..11a918d1ad1a 100644 --- a/bin/configs/python-experimental.yaml +++ b/bin/configs/python-prior.yaml @@ -1,7 +1,8 @@ -generatorName: python-experimental -outputDir: samples/openapi3/client/petstore/python-experimental -inputSpec: modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml -templateDir: modules/openapi-generator/src/main/resources/python-experimental +generatorName: python-prior +outputDir: samples/openapi3/client/petstore/python-prior +inputSpec: modules/openapi-generator/src/test/resources/3_0/python-prior/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-generator/src/main/resources/python-prior additionalProperties: packageName: petstore_api recursionLimit: "1234" + initRequiredVars: false diff --git a/bin/configs/python.yaml b/bin/configs/python.yaml index f66aab269938..37d0948cc682 100644 --- a/bin/configs/python.yaml +++ b/bin/configs/python.yaml @@ -5,4 +5,3 @@ templateDir: modules/openapi-generator/src/main/resources/python additionalProperties: packageName: petstore_api recursionLimit: "1234" - initRequiredVars: false diff --git a/bin/configs/python-experimental_3_0_3_unit_test.yaml b/bin/configs/python_3_0_3_unit_test.yaml similarity index 64% rename from bin/configs/python-experimental_3_0_3_unit_test.yaml rename to bin/configs/python_3_0_3_unit_test.yaml index a6428fb1ad74..a388d8734747 100644 --- a/bin/configs/python-experimental_3_0_3_unit_test.yaml +++ b/bin/configs/python_3_0_3_unit_test.yaml @@ -1,6 +1,6 @@ -generatorName: python-experimental -outputDir: samples/openapi3/client/3_0_3_unit_test/python-experimental +generatorName: python +outputDir: samples/openapi3/client/3_0_3_unit_test/python inputSpec: modules/openapi-generator/src/test/resources/3_0/unit_test_spec/3_0_3_unit_test_spec.yaml -templateDir: modules/openapi-generator/src/main/resources/python-experimental +templateDir: modules/openapi-generator/src/main/resources/python additionalProperties: packageName: unit_test_api diff --git a/docs/generators.md b/docs/generators.md index 8b51285c9179..336639c7b2a6 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -50,8 +50,8 @@ The following generators are available: * [php-dt (beta)](generators/php-dt.md) * [powershell (beta)](generators/powershell.md) * [python](generators/python.md) -* [python-experimental (experimental)](generators/python-experimental.md) * [python-legacy](generators/python-legacy.md) +* [python-prior](generators/python-prior.md) * [r](generators/r.md) * [ruby](generators/ruby.md) * [rust](generators/rust.md) diff --git a/docs/generators/python-experimental.md b/docs/generators/python-prior.md similarity index 68% rename from docs/generators/python-experimental.md rename to docs/generators/python-prior.md index 7f74f1a810ad..00a89120d77c 100644 --- a/docs/generators/python-experimental.md +++ b/docs/generators/python-prior.md @@ -1,33 +1,35 @@ --- -title: Documentation for the python-experimental Generator +title: Documentation for the python-prior Generator --- ## METADATA | Property | Value | Notes | | -------- | ----- | ----- | -| generator name | python-experimental | pass this to the generate command after -g | -| generator stability | EXPERIMENTAL | | +| generator name | python-prior | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Python | | -| generator language version | >=3.7 | | -| generator default templating engine | handlebars | | -| helpTxt | Generates a Python client library

Features in this generator:
- type hints on endpoints and model creation
- model parameter names use the spec defined keys and cases
- robust composition (oneOf/anyOf/allOf/not) where payload data is stored in one instance only
- endpoint parameter names use the spec defined keys and cases
- inline schemas are supported at any location including composition
- multiple content types supported in request body and response bodies
- run time type checking
- Sending/receiving decimals as strings supported with type:string format: number -> DecimalSchema
- Sending/receiving uuids as strings supported with type:string format: uuid -> UUIDSchema
- quicker load time for python modules (a single endpoint can be imported and used without loading others)
- all instances of schemas dynamically inherit from all matching schemas so one can use isinstance to check if validation passed
- composed schemas with type constraints supported (type:object + oneOf/anyOf/allOf)
- schemas are not coerced/cast. For example string + date are both stored as string, and there is a date accessor
- Exceptions: int/float is stored as Decimal, When receiving data from headers it will start as str and may need to be cast for example to int | | +| generator language version | >=3.6 | | +| 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. NOTE: this option breaks composition and will be removed in 6.0.0
|false| |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: urllib3| |urllib3| +|initRequiredVars|If set to true then the required variables are included as positional arguments in __init__ and _from_openapi_data methods. Note: this can break some composition use cases. To learn more read PR #8802.| |false| +|library|library template (sub-template) to use: asyncio, tornado, 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| +|pythonAttrNoneIfUnset|when accessing unset attribute, return `None` instead of raising `ApiAttributeError`| |false| |recursionLimit|Set the recursion limit. If not set, use the system default value.| |null| -|useInlineModelResolver|use the inline model resolver, if true inline complex models will be extracted into components and $refs to them will be used| |false| |useNose|use the nose test framework| |false| ## IMPORT MAPPING @@ -40,7 +42,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Type/Alias | Instantiated By | | ---------- | --------------- | -|map|dict| ## LANGUAGE PRIMITIVES @@ -72,37 +73,29 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • auth_settings
  • await
  • body_params
  • -
  • bool
  • break
  • class
  • continue
  • def
  • del
  • -
  • dict
  • elif
  • else
  • except
  • exec
  • false
  • -
  • file_type
  • finally
  • -
  • float
  • for
  • form_params
  • from
  • -
  • frozendict
  • global
  • header_params
  • if
  • import
  • in
  • -
  • int
  • is
  • lambda
  • -
  • list
  • local_var_files
  • none
  • -
  • none_type
  • nonlocal
  • not
  • or
  • @@ -115,10 +108,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • resource_path
  • return
  • self
  • -
  • str
  • true
  • try
  • -
  • tuple
  • while
  • with
  • yield
  • @@ -152,10 +143,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl |DateTime|✓|OAS2,OAS3 |Password|✓|OAS2,OAS3 |File|✓|OAS2 -|Uuid|✓| +|Uuid|✗| |Array|✓|OAS2,OAS3 -|Null|✓|OAS3 -|AnyType|✓|OAS2,OAS3 +|Null|✗|OAS3 +|AnyType|✗|OAS2,OAS3 |Object|✓|OAS2,OAS3 |Maps|✓|ToolingExtension |CollectionFormat|✓|OAS2 @@ -194,7 +185,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |XMLStructureDefinitions|✗|OAS2,OAS3 |MultiServer|✗|OAS3 |ParameterizedServer|✓|OAS3 -|ParameterStyling|✓|OAS3 +|ParameterStyling|✗|OAS3 |Callbacks|✗|OAS3 |LinkObjects|✗|OAS3 @@ -214,12 +205,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl | ---- | --------- | ---------- | |Simple|✓|OAS2,OAS3 |Composite|✓|OAS2,OAS3 -|Polymorphism|✓|OAS2,OAS3 -|Union|✓|OAS3 -|allOf|✓|OAS2,OAS3 -|anyOf|✓|OAS3 -|oneOf|✓|OAS3 -|not|✓|OAS3 +|Polymorphism|✗|OAS2,OAS3 +|Union|✗|OAS3 +|allOf|✗|OAS2,OAS3 +|anyOf|✗|OAS3 +|oneOf|✗|OAS3 +|not|✗|OAS3 ### Security Feature | Name | Supported | Defined By | @@ -237,6 +228,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Name | Supported | Defined By | | ---- | --------- | ---------- | |JSON|✓|OAS2,OAS3 -|XML|✗|OAS2,OAS3 +|XML|✓|OAS2,OAS3 |PROTOBUF|✗|ToolingExtension |Custom|✓|OAS2,OAS3 diff --git a/docs/generators/python.md b/docs/generators/python.md index 34875d8c863a..b20cce0a65be 100644 --- a/docs/generators/python.md +++ b/docs/generators/python.md @@ -10,26 +10,24 @@ title: Documentation for the python Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Python | | -| generator language version | >=3.6 | | -| generator default templating engine | mustache | | -| helpTxt | Generates a Python client library. | | +| generator language version | >=3.7 | | +| generator default templating engine | handlebars | | +| helpTxt | Generates a Python client library

    Features in this generator:
    - type hints on endpoints and model creation
    - model parameter names use the spec defined keys and cases
    - robust composition (oneOf/anyOf/allOf/not) where payload data is stored in one instance only
    - endpoint parameter names use the spec defined keys and cases
    - inline schemas are supported at any location including composition
    - multiple content types supported in request body and response bodies
    - run time type checking
    - Sending/receiving decimals as strings supported with type:string format: number -> DecimalSchema
    - Sending/receiving uuids as strings supported with type:string format: uuid -> UUIDSchema
    - quicker load time for python modules (a single endpoint can be imported and used without loading others)
    - all instances of schemas dynamically inherit from all matching schemas so one can use isinstance to check if validation passed
    - composed schemas with type constraints supported (type:object + oneOf/anyOf/allOf)
    - schemas are not coerced/cast. For example string + date are both stored as string, and there is a date accessor
    - Exceptions: int/float is stored as Decimal, When receiving data from headers it will start as str and may need to be cast for example to int | | ## 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. NOTE: this option breaks composition and will be removed in 6.0.0
    |false| |generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|initRequiredVars|If set to true then the required variables are included as positional arguments in __init__ and _from_openapi_data methods. Note: this can break some composition use cases. To learn more read PR #8802.| |false| -|library|library template (sub-template) to use: asyncio, tornado, urllib3| |urllib3| +|library|library template (sub-template) to use: 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| -|pythonAttrNoneIfUnset|when accessing unset attribute, return `None` instead of raising `ApiAttributeError`| |false| |recursionLimit|Set the recursion limit. If not set, use the system default value.| |null| +|useInlineModelResolver|use the inline model resolver, if true inline complex models will be extracted into components and $refs to them will be used| |false| |useNose|use the nose test framework| |false| ## IMPORT MAPPING @@ -42,6 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Type/Alias | Instantiated By | | ---------- | --------------- | +|map|dict| ## LANGUAGE PRIMITIVES @@ -73,29 +72,37 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • auth_settings
  • await
  • body_params
  • +
  • bool
  • break
  • class
  • continue
  • def
  • del
  • +
  • dict
  • elif
  • else
  • except
  • exec
  • false
  • +
  • file_type
  • finally
  • +
  • float
  • for
  • form_params
  • from
  • +
  • frozendict
  • global
  • header_params
  • if
  • import
  • in
  • +
  • int
  • is
  • lambda
  • +
  • list
  • local_var_files
  • none
  • +
  • none_type
  • nonlocal
  • not
  • or
  • @@ -108,8 +115,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • resource_path
  • return
  • self
  • +
  • str
  • true
  • try
  • +
  • tuple
  • while
  • with
  • yield
  • @@ -143,10 +152,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl |DateTime|✓|OAS2,OAS3 |Password|✓|OAS2,OAS3 |File|✓|OAS2 -|Uuid|✗| +|Uuid|✓| |Array|✓|OAS2,OAS3 -|Null|✗|OAS3 -|AnyType|✗|OAS2,OAS3 +|Null|✓|OAS3 +|AnyType|✓|OAS2,OAS3 |Object|✓|OAS2,OAS3 |Maps|✓|ToolingExtension |CollectionFormat|✓|OAS2 @@ -185,7 +194,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |XMLStructureDefinitions|✗|OAS2,OAS3 |MultiServer|✗|OAS3 |ParameterizedServer|✓|OAS3 -|ParameterStyling|✗|OAS3 +|ParameterStyling|✓|OAS3 |Callbacks|✗|OAS3 |LinkObjects|✗|OAS3 @@ -205,12 +214,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl | ---- | --------- | ---------- | |Simple|✓|OAS2,OAS3 |Composite|✓|OAS2,OAS3 -|Polymorphism|✗|OAS2,OAS3 -|Union|✗|OAS3 -|allOf|✗|OAS2,OAS3 -|anyOf|✗|OAS3 -|oneOf|✗|OAS3 -|not|✗|OAS3 +|Polymorphism|✓|OAS2,OAS3 +|Union|✓|OAS3 +|allOf|✓|OAS2,OAS3 +|anyOf|✓|OAS3 +|oneOf|✓|OAS3 +|not|✓|OAS3 ### Security Feature | Name | Supported | Defined By | @@ -228,6 +237,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Name | Supported | Defined By | | ---- | --------- | ---------- | |JSON|✓|OAS2,OAS3 -|XML|✓|OAS2,OAS3 +|XML|✗|OAS2,OAS3 |PROTOBUF|✗|ToolingExtension |Custom|✓|OAS2,OAS3 diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 853db7ffd00a..2da1e53f84e2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -40,8 +40,8 @@ import org.openapitools.codegen.api.TemplatingEngineAdapter; import org.openapitools.codegen.api.TemplateFileType; import org.openapitools.codegen.ignore.CodegenIgnoreProcessor; +import org.openapitools.codegen.languages.PythonPriorClientCodegen; import org.openapitools.codegen.languages.PythonClientCodegen; -import org.openapitools.codegen.languages.PythonExperimentalClientCodegen; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; import org.openapitools.codegen.model.ApiInfoMap; @@ -541,7 +541,7 @@ void generateModels(List files, List allModels, List unu ModelMap modelTemplate = modelList.get(0); if (modelTemplate != null && modelTemplate.getModel() != null) { CodegenModel m = modelTemplate.getModel(); - if (m.isAlias && !((config instanceof PythonClientCodegen) || (config instanceof PythonExperimentalClientCodegen))) { + if (m.isAlias && !((config instanceof PythonPriorClientCodegen) || (config instanceof PythonClientCodegen))) { // alias to number, string, enum, etc, which should not be generated as model // for PythonClientCodegen, all aliases are generated as models continue; // Don't create user-defined classes for aliases diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index 961a760c2e8b..9eaa5fbfaa68 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -16,118 +16,227 @@ package org.openapitools.codegen.languages; -import com.google.common.collect.Sets; +import com.github.curiousoddman.rgxgen.RgxGen; +import com.github.curiousoddman.rgxgen.config.RgxGenOption; +import com.github.curiousoddman.rgxgen.config.RgxGenProperties; +import com.google.common.base.CaseFormat; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.Paths; +import io.swagger.v3.oas.models.servers.Server; +import io.swagger.v3.oas.models.tags.Tag; + +import org.apache.commons.io.FileUtils; +import org.openapitools.codegen.api.TemplatePathLocator; +import org.openapitools.codegen.ignore.CodegenIgnoreProcessor; +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.templating.*; import io.swagger.v3.core.util.Json; import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.MediaType; -import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.security.SecurityScheme; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.CodegenDiscriminator.MappedModel; +import org.openapitools.codegen.api.TemplatingEngineAdapter; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; 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.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.meta.Stability; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.github.curiousoddman.rgxgen.RgxGen; -import com.github.curiousoddman.rgxgen.config.RgxGenOption; -import com.github.curiousoddman.rgxgen.config.RgxGenProperties; +import org.openapitools.codegen.api.TemplateProcessor; +import java.io.File; +import java.io.IOException; +import java.math.BigDecimal; +import java.nio.file.Path; import java.time.OffsetDateTime; import java.time.ZoneOffset; import java.time.format.DateTimeFormatter; -import java.io.File; import java.util.*; -import java.util.regex.Pattern; import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; import static org.openapitools.codegen.utils.OnceLogger.once; +import static org.openapitools.codegen.utils.StringUtils.camelize; +import static org.openapitools.codegen.utils.StringUtils.underscore; -public class PythonClientCodegen extends PythonLegacyClientCodegen { +public class PythonClientCodegen extends AbstractPythonCodegen { private final Logger LOGGER = LoggerFactory.getLogger(PythonClientCodegen.class); + public static final String PACKAGE_URL = "packageUrl"; + public static final String DEFAULT_LIBRARY = "urllib3"; + // nose is a python testing framework, we use pytest if USE_NOSE is unset + public static final String USE_NOSE = "useNose"; + public static final String RECURSION_LIMIT = "recursionLimit"; + public static final String USE_INLINE_MODEL_RESOLVER = "useInlineModelResolver"; + + protected String packageUrl; + protected String apiDocPath = "docs/apis/tags/"; + protected String modelDocPath = "docs/models/"; + protected boolean useNose = false; + protected boolean useInlineModelResolver = false; + + protected Map regexModifiers; + + private String testFolder; + // A cache to efficiently lookup a Schema instance based on the return value of `toModelName()`. private Map modelNameToSchemaCache; private DateTimeFormatter iso8601Date = DateTimeFormatter.ISO_DATE; private DateTimeFormatter iso8601DateTime = DateTimeFormatter.ISO_DATE_TIME; - public PythonClientCodegen() { - super(); + private String templateExtension; + protected CodegenIgnoreProcessor ignoreProcessor; + protected TemplateProcessor templateProcessor = null; - embeddedTemplateDir = templateDir = "python"; + // for apis.tags imports + private Map tagModuleNameToApiClassname = new LinkedHashMap<>(); + // for apis.tags enum tag definition + private Map enumToTag = new LinkedHashMap<>(); + // for apis.tags tag api definition + private Map tagEnumToApiClassname = new LinkedHashMap<>(); - // Composed schemas can have the 'additionalProperties' keyword, as specified in JSON schema. - // In principle, this should be enabled by default for all code generators. However due to limitations - // in other code generators, support needs to be enabled on a case-by-case basis. - supportsAdditionalPropertiesWithComposedSchema = true; + public PythonClientCodegen() { + super(); + loadDeepObjectIntoItems = false; + importBaseType = false; + addSchemaImportsFromV3SpecLocations = true; + sortModelPropertiesByRequiredFlag = Boolean.TRUE; + sortParamsByRequiredFlag = Boolean.TRUE; + addSuffixToDuplicateOperationNicknames = false; modifyFeatureSet(features -> features + .includeSchemaSupportFeatures( + SchemaSupportFeature.Simple, + SchemaSupportFeature.Composite, + SchemaSupportFeature.Polymorphism, + SchemaSupportFeature.Union, + SchemaSupportFeature.allOf, + SchemaSupportFeature.anyOf, + SchemaSupportFeature.oneOf, + SchemaSupportFeature.not + ) .includeDocumentationFeatures(DocumentationFeature.Readme) - .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom)) + .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.Custom)) .securityFeatures(EnumSet.of( SecurityFeature.BasicAuth, SecurityFeature.BearerToken, SecurityFeature.ApiKey, SecurityFeature.OAuth2_Implicit )) + .includeDataTypeFeatures( + DataTypeFeature.Null, + DataTypeFeature.AnyType, + DataTypeFeature.Uuid + ) .includeGlobalFeatures( - GlobalFeature.ParameterizedServer + GlobalFeature.ParameterizedServer, + GlobalFeature.ParameterStyling ) .excludeGlobalFeatures( GlobalFeature.XMLStructureDefinitions, GlobalFeature.Callbacks, - GlobalFeature.LinkObjects, - GlobalFeature.ParameterStyling + GlobalFeature.LinkObjects ) .excludeSchemaSupportFeatures( - SchemaSupportFeature.Polymorphism ) .excludeParameterFeatures( ParameterFeature.Cookie ) ); - // needed for type object with additionalProperties: false - typeMapping.put("object", "dict"); - languageSpecificPrimitives.add("file_type"); - languageSpecificPrimitives.add("none_type"); + // clear import mapping (from default generator) as python does not use it + // at the moment + importMapping.clear(); - // this generator does not use SORT_PARAMS_BY_REQUIRED_FLAG - // this generator uses the following order for endpoint parameters and model properties - // required params/props with no enum of length one - // required params/props with enum of length one (which is used to set a default value as a python named arg value) - // optional params/props with **kwargs in python - cliOptions.remove(4); + modelPackage = "model"; + apiPackage = "apis"; + outputFolder = "generated-code" + File.separatorChar + "python"; - cliOptions.add(new CliOption(CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET, CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET_DESC) - .defaultValue(Boolean.FALSE.toString())); + embeddedTemplateDir = templateDir = "python"; - cliOptions.add(new CliOption(CodegenConstants.INIT_REQUIRED_VARS, CodegenConstants.INIT_REQUIRED_VARS_DESC) + 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( + // local variable name used in API methods (endpoints) + "all_params", "resource_path", "path_params", "query_params", + "header_params", "form_params", "local_var_files", "body_params", "auth_settings", + // @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", + // types + "float", "int", "str", "bool", "none_type", "dict", "frozendict", "list", "tuple", "file_type")); + + 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.")); + // this generator does not use SORT_PARAMS_BY_REQUIRED_FLAG + // this generator uses the following order for endpoint paramters and model properties + // required params + // optional params which are set to unset as their default for method signatures only + // optional params as **kwargs + 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(CliOption.newBoolean(USE_NOSE, "use the nose test framework"). + defaultValue(Boolean.FALSE.toString())); + cliOptions.add(new CliOption(RECURSION_LIMIT, "Set the recursion limit. If not set, use the system default value.")); + cliOptions.add(CliOption.newBoolean(USE_INLINE_MODEL_RESOLVER, "use the inline model resolver, if true inline complex models will be extracted into components and $refs to them will be used"). + defaultValue(Boolean.FALSE.toString())); + + supportedLibraries.put("urllib3", "urllib3-based client"); + CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use: 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.FALSE.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. NOTE: "+ - "this option breaks composition and will be removed in 6.0.0" - ); - disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts); - cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt); + // Composed schemas can have the 'additionalProperties' keyword, as specified in JSON schema. + // In principle, this should be enabled by default for all code generators. However due to limitations + // in other code generators, support needs to be enabled on a case-by-case basis. + supportsAdditionalPropertiesWithComposedSchema = true; + + // When the 'additionalProperties' keyword is not present in a OAS schema, allow + // undeclared properties. This is compliant with the JSON schema specification. + this.setDisallowAdditionalPropertiesIfNotPresent(false); + + // this may set datatype right for additional properties + instantiationTypes.put("map", "dict"); + + languageSpecificPrimitives.add("file_type"); + languageSpecificPrimitives.add("none_type"); + typeMapping.put("decimal", "str"); generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) .stability(Stability.STABLE) @@ -139,28 +248,81 @@ public void processOpts() { this.setLegacyDiscriminatorBehavior(false); super.processOpts(); - modelPackage = packageName + "." + "model"; - supportingFiles.add(new SupportingFile("model_utils.mustache", packagePath(), "model_utils.py")); + TemplatingEngineAdapter te = getTemplatingEngine(); + if (te instanceof HandlebarsEngineAdapter) { + HandlebarsEngineAdapter hea = (HandlebarsEngineAdapter) te; + hea.infiniteLoops(true); + hea.setPrettyPrint(true); + } else { + throw new RuntimeException("Only the HandlebarsEngineAdapter is supported for this generator"); + } + TemplatePathLocator commonTemplateLocator = new CommonTemplateContentLocator(); + TemplatePathLocator generatorTemplateLocator = new GeneratorTemplateContentLocator(this); + TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(this.isEnableMinimalUpdate(),this.isSkipOverwrite()); + templateProcessor = new TemplateManager( + templateManagerOptions, + te, + new TemplatePathLocator[]{generatorTemplateLocator, commonTemplateLocator} + ); + templateExtension = te.getIdentifier(); - // add the models and apis folders - supportingFiles.add(new SupportingFile("__init__models.mustache", packagePath() + File.separatorChar + "models", "__init__.py")); - SupportingFile originalInitModel = supportingFiles.stream() - .filter(sf -> sf.getTemplateFile().equals("__init__model.mustache")) - .reduce((a, b) -> { - throw new IllegalStateException("Multiple elements: " + a + ", " + b); - }) - .orElse(null); - supportingFiles.remove(originalInitModel); - supportingFiles.add(new SupportingFile("__init__model.mustache", packagePath() + File.separatorChar + "model", "__init__.py")); - supportingFiles.add(new SupportingFile("__init__apis.mustache", packagePath() + File.separatorChar + "apis", "__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")); + String ignoreFileLocation = this.getIgnoreFilePathOverride(); + if (ignoreFileLocation != null) { + final File ignoreFile = new File(ignoreFileLocation); + if (ignoreFile.exists() && ignoreFile.canRead()) { + this.ignoreProcessor = new CodegenIgnoreProcessor(ignoreFile); + } else { + LOGGER.warn("Ignore file specified at {} is not valid. This will fall back to an existing ignore file if present in the output directory.", ignoreFileLocation); + } + } + + if (this.ignoreProcessor == null) { + this.ignoreProcessor = new CodegenIgnoreProcessor(this.getOutputDir()); + } + + modelTemplateFiles.put("model." + templateExtension, ".py"); + /* + This stub file exists to allow pycharm to read and use typing.overload decorators for it to see that + dict_instance["someProp"] is of type SomeClass.properties.someProp + See https://youtrack.jetbrains.com/issue/PY-42137/PyCharm-type-hinting-doesnt-work-well-with-overload-decorator + */ + modelTemplateFiles.put("model_stub." + templateExtension, ".pyi"); + apiTemplateFiles.put("api." + templateExtension, ".py"); + modelTestTemplateFiles.put("model_test." + templateExtension, ".py"); + modelDocTemplateFiles.put("model_doc." + templateExtension, ".md"); + apiDocTemplateFiles.put("api_doc." + templateExtension, ".md"); + + 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; @@ -168,34 +330,109 @@ public void processOpts() { generateSourceCodeOnly = Boolean.valueOf(additionalProperties.get(CodegenConstants.SOURCECODEONLY_GENERATION).toString()); } - // default this to true so the python ModelSimple models will be generated - ModelUtils.setGenerateAliasAsModel(true); - LOGGER.info( - "{} is hard coded to true in this generator. Alias models will only be generated if they contain validations or enums", - CodegenConstants.GENERATE_ALIAS_AS_MODEL); + if (generateSourceCodeOnly) { + // tests in test + testFolder = packagePath() + File.separatorChar + testFolder; + // api docs in /docs/apis/tags/ + apiDocPath = packagePath() + File.separatorChar + apiDocPath; + // model docs in /docs/models/ + modelDocPath = packagePath() + File.separatorChar + modelDocPath; + } + // make api and model doc path available in templates + additionalProperties.put("apiDocPath", apiDocPath); + additionalProperties.put("modelDocPath", modelDocPath); - Boolean attrNoneIfUnset = false; - if (additionalProperties.containsKey(CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET)) { - attrNoneIfUnset = Boolean.valueOf(additionalProperties.get(CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET).toString()); + if (additionalProperties.containsKey(PACKAGE_URL)) { + setPackageUrl((String) additionalProperties.get(PACKAGE_URL)); } - additionalProperties.put("attrNoneIfUnset", attrNoneIfUnset); - // When the 'additionalProperties' keyword is not present in a OAS schema, allow - // undeclared properties. This is compliant with the JSON schema specification. - // setting this to false is required to have composed schemas work because: - // anyOf SchemaA + SchemaB, requires that props present only in A are accepted in B because in B - // they are additional properties - Boolean disallowAddProps = false; - if (additionalProperties.containsKey(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT)) { - disallowAddProps = Boolean.valueOf(additionalProperties.get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString()); + if (additionalProperties.containsKey(USE_NOSE)) { + setUseNose((String) additionalProperties.get(USE_NOSE)); + } + + if (additionalProperties.containsKey(USE_INLINE_MODEL_RESOLVER)) { + setUseInlineModelResolver((String) additionalProperties.get(USE_INLINE_MODEL_RESOLVER)); + } + + // 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."); + } + } + + String readmePath = "README.md"; + String readmeTemplate = "README." + templateExtension; + if (generateSourceCodeOnly) { + readmePath = packagePath() + "_" + readmePath; + readmeTemplate = "README_onlypackage." + templateExtension; + } + supportingFiles.add(new SupportingFile(readmeTemplate, "", readmePath)); + + if (!generateSourceCodeOnly) { + supportingFiles.add(new SupportingFile("tox." + templateExtension, "", "tox.ini")); + supportingFiles.add(new SupportingFile("test-requirements." + templateExtension, "", "test-requirements.txt")); + supportingFiles.add(new SupportingFile("requirements." + templateExtension, "", "requirements.txt")); + supportingFiles.add(new SupportingFile("setup_cfg." + templateExtension, "", "setup.cfg")); + + supportingFiles.add(new SupportingFile("git_push.sh." + templateExtension, "", "git_push.sh")); + supportingFiles.add(new SupportingFile("gitignore." + templateExtension, "", ".gitignore")); + supportingFiles.add(new SupportingFile("travis." + templateExtension, "", ".travis.yml")); + supportingFiles.add(new SupportingFile("gitlab-ci." + templateExtension, "", ".gitlab-ci.yml")); + supportingFiles.add(new SupportingFile("setup." + templateExtension, "", "setup.py")); + } + supportingFiles.add(new SupportingFile("configuration." + templateExtension, packagePath(), "configuration.py")); + supportingFiles.add(new SupportingFile("__init__package." + templateExtension, packagePath(), "__init__.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__." + templateExtension, currentPackagePath, "__init__.py")); + } + + supportingFiles.add(new SupportingFile("exceptions." + templateExtension, packagePath(), "exceptions.py")); + + if (Boolean.FALSE.equals(excludeTests)) { + supportingFiles.add(new SupportingFile("__init__." + templateExtension, testFolder, "__init__.py")); + supportingFiles.add(new SupportingFile("__init__." + templateExtension, testFolder + File.separator + "test_models", "__init__.py")); + } + + supportingFiles.add(new SupportingFile("api_client." + templateExtension, packagePath(), "api_client.py")); + + if ("asyncio".equals(getLibrary())) { + supportingFiles.add(new SupportingFile("asyncio/rest." + templateExtension, packagePath(), "rest.py")); + additionalProperties.put("asyncio", "true"); + } else if ("tornado".equals(getLibrary())) { + supportingFiles.add(new SupportingFile("tornado/rest." + templateExtension, packagePath(), "rest.py")); + additionalProperties.put("tornado", "true"); + } else { + supportingFiles.add(new SupportingFile("rest." + templateExtension, packagePath(), "rest.py")); } - this.setDisallowAdditionalPropertiesIfNotPresent(disallowAddProps); - Boolean initRequiredVars = false; - if (additionalProperties.containsKey(CodegenConstants.INIT_REQUIRED_VARS)) { - initRequiredVars = Boolean.valueOf(additionalProperties.get(CodegenConstants.INIT_REQUIRED_VARS).toString()); + supportingFiles.add(new SupportingFile("schemas." + templateExtension, packagePath(), "schemas.py")); + + // add the models and apis folders + supportingFiles.add(new SupportingFile("__init__models." + templateExtension, packagePath() + File.separatorChar + "models", "__init__.py")); + supportingFiles.add(new SupportingFile("__init__model." + templateExtension, packagePath() + File.separatorChar + modelPackage, "__init__.py")); + supportingFiles.add(new SupportingFile("__init__apis." + templateExtension, packagePath() + File.separatorChar + apiPackage, "__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." + templateExtension, packagePath(), "signing.py")); } - additionalProperties.put("initRequiredVars", initRequiredVars); + + // default this to true so the python ModelSimple models will be generated + ModelUtils.setGenerateAliasAsModel(true); + LOGGER.info(CodegenConstants.GENERATE_ALIAS_AS_MODEL + " is hard coded to true in this generator. Alias models will only be generated if they contain validations or enums"); // check library option to ensure only urllib3 is supported if (!DEFAULT_LIBRARY.equals(getLibrary())) { @@ -203,6 +440,262 @@ public void processOpts() { } } + public String packageFilename(List pathSegments) { + String prefix = outputFolder + File.separatorChar + packagePath() + File.separatorChar; + String suffix = pathSegments.stream().collect(Collectors.joining(File.separator)); + return prefix + suffix; + } + + public String filenameFromRoot(List pathSegments) { + String prefix = outputFolder + File.separatorChar; + String suffix = pathSegments.stream().collect(Collectors.joining(File.separator)); + return prefix + suffix; + } + + protected File processTemplateToFile(Map templateData, String templateName, String outputFilename, boolean shouldGenerate, String skippedByOption) throws IOException { + String adjustedOutputFilename = outputFilename.replaceAll("//", "/").replace('/', File.separatorChar); + File target = new File(adjustedOutputFilename); + if (ignoreProcessor.allowsFile(target)) { + if (shouldGenerate) { + Path outDir = java.nio.file.Paths.get(this.getOutputDir()).toAbsolutePath(); + Path absoluteTarget = target.toPath().toAbsolutePath(); + if (!absoluteTarget.startsWith(outDir)) { + throw new RuntimeException(String.format(Locale.ROOT, "Target files must be generated within the output directory; absoluteTarget=%s outDir=%s", absoluteTarget, outDir)); + } + return this.templateProcessor.write(templateData,templateName, target); + } else { + this.templateProcessor.skip(target.toPath(), String.format(Locale.ROOT, "Skipped by %s options supplied by user.", skippedByOption)); + return null; + } + } else { + this.templateProcessor.ignore(target.toPath(), "Ignored by rule in ignore file."); + return null; + } + } + + @Override + public String apiFilename(String templateName, String tag) { + String suffix = apiTemplateFiles().get(templateName); + return apiFileFolder() + File.separator + toApiFilename(tag) + suffix; + } + + private void generateFiles(List> processTemplateToFileInfos, String skippedByOption) { + for (List processTemplateToFileInfo: processTemplateToFileInfos) { + Map templateData = (Map) processTemplateToFileInfo.get(0); + String templateName = (String) processTemplateToFileInfo.get(1); + String outputFilename = (String) processTemplateToFileInfo.get(2); + try { + processTemplateToFile(templateData, templateName, outputFilename, true, skippedByOption); + } catch (IOException e) { + LOGGER.error("Error when writing template file {}", e.toString()); + } + } + } + + @Override + public String toApiName(String name) { + if (name.length() == 0) { + return "DefaultApi"; + } + return toModelName(name) + apiNameSuffix; + } + + /* + I made this method because endpoint parameters not contain a lot of needed metadata + It is very verbose to write all of this info into the api template + This ingests all operations under a tag in the objs input and writes out one file for each endpoint + */ + protected void generateEndpoints(OperationsMap objs) { + if (!(Boolean) additionalProperties.get(CodegenConstants.GENERATE_APIS)) { + return; + } + Paths paths = openAPI.getPaths(); + if (paths == null) { + return; + } + List> pathsFiles = new ArrayList<>(); + List> apisFiles = new ArrayList<>(); + List> testFiles = new ArrayList<>(); + String outputFilename; + + // endpoint tags may not exist in the root of the spec file + // this is allowed per openapi + // because spec tags may be empty ro incomplete, tags are also accumulated from endpoints + List tags = openAPI.getTags(); + if (tags != null) { + for (Tag tag: tags) { + String tagName = tag.getName(); + String tagModuleName = toApiFilename(tagName); + String apiClassname = toApiName(tagName); + tagModuleNameToApiClassname.put(tagModuleName, apiClassname); + String tagEnum = toEnumVarName(tagName, "str"); + enumToTag.put(tagEnum, tagName); + tagEnumToApiClassname.put(tagEnum, apiClassname); + } + } + + OperationMap operations = objs.getOperations(); + List codegenOperations = operations.getOperation(); + HashMap pathModuleToPath = new HashMap<>(); + // paths.some_path.post.py (single endpoint definition) + for (CodegenOperation co: codegenOperations) { + if (co.tags != null) { + for (Tag tag: co.tags) { + String tagName = tag.getName(); + String tagModuleName = toApiFilename(tagName); + String apiClassname = toApiName(tagName); + tagModuleNameToApiClassname.put(tagModuleName, apiClassname); + String tagEnum = toEnumVarName(tagName, "str"); + enumToTag.put(tagEnum, tagName); + tagEnumToApiClassname.put(tagEnum, apiClassname); + } + } + String path = co.path; + String pathModuleName = co.nickname; + if (!pathModuleToPath.containsKey(pathModuleName)) { + pathModuleToPath.put(pathModuleName, path); + } + Map endpointMap = new HashMap<>(); + endpointMap.put("operation", co); + endpointMap.put("imports", co.imports); + endpointMap.put("packageName", packageName); + outputFilename = packageFilename(Arrays.asList("paths", pathModuleName, co.httpMethod + ".py")); + pathsFiles.add(Arrays.asList(endpointMap, "endpoint.handlebars", outputFilename)); + /* + This stub file exists to allow pycharm to read and use typing.overload decorators for it to see that + dict_instance["someProp"] is of type SomeClass.properties.someProp + See https://youtrack.jetbrains.com/issue/PY-42137/PyCharm-type-hinting-doesnt-work-well-with-overload-decorator + */ + String stubOutputFilename = packageFilename(Arrays.asList("paths", pathModuleName, co.httpMethod + ".pyi")); + pathsFiles.add(Arrays.asList(endpointMap, "endpoint_stub.handlebars", stubOutputFilename)); + + Map endpointTestMap = new HashMap<>(); + endpointTestMap.put("operation", co); + endpointTestMap.put("packageName", packageName); + outputFilename = filenameFromRoot(Arrays.asList("test", "test_paths", "test_" + pathModuleName, "test_" + co.httpMethod + ".py")); + testFiles.add(Arrays.asList(endpointTestMap, "api_test.handlebars", outputFilename)); + outputFilename = filenameFromRoot(Arrays.asList("test", "test_paths", "test_" + pathModuleName, "__init__.py")); + testFiles.add(Arrays.asList(new HashMap<>(), "__init__.handlebars", outputFilename)); + } + outputFilename = filenameFromRoot(Arrays.asList("test", "test_paths", "__init__.py")); + testFiles.add(Arrays.asList(new HashMap<>(), "__init__test_paths.handlebars", outputFilename)); + + Map pathValToVar = new LinkedHashMap<>(); + Map pathModuleToApiClassname = new LinkedHashMap<>(); + Map pathEnumToApiClassname = new LinkedHashMap<>(); + for (Map.Entry pathsEntry : paths.entrySet()) { + String path = pathsEntry.getKey(); + String pathEnumVar = toEnumVarName(path, "str"); + pathValToVar.put(path, pathEnumVar); + String apiClassName = toModelName(path); + pathEnumToApiClassname.put(pathEnumVar, apiClassName); + pathModuleToApiClassname.put(toVarName(path), apiClassName); + } + // Note: __init__apis.handlebars is generated as a supporting file + // apis.tag_to_api.py + Map tagToApiMap = new HashMap<>(); + tagToApiMap.put("packageName", packageName); + tagToApiMap.put("apiClassname", "Api"); + tagToApiMap.put("tagModuleNameToApiClassname", tagModuleNameToApiClassname); + tagToApiMap.put("tagEnumToApiClassname", tagEnumToApiClassname); + outputFilename = packageFilename(Arrays.asList("apis", "tag_to_api.py")); + apisFiles.add(Arrays.asList(tagToApiMap, "apis_tag_to_api.handlebars", outputFilename)); + // apis.path_to_api.py + Map allByPathsFileMap = new HashMap<>(); + allByPathsFileMap.put("packageName", packageName); + allByPathsFileMap.put("apiClassname", "Api"); + allByPathsFileMap.put("pathModuleToApiClassname", pathModuleToApiClassname); + allByPathsFileMap.put("pathEnumToApiClassname", pathEnumToApiClassname); + outputFilename = packageFilename(Arrays.asList("apis", "path_to_api.py")); + apisFiles.add(Arrays.asList(allByPathsFileMap, "apis_path_to_api.handlebars", outputFilename)); + // apis.paths.__init__.py + Map initApiTagsMap = new HashMap<>(); + initApiTagsMap.put("packageName", packageName); + initApiTagsMap.put("enumToTag", enumToTag); + outputFilename = packageFilename(Arrays.asList("apis", "tags", "__init__.py")); + apisFiles.add(Arrays.asList(initApiTagsMap, "__init__apis_tags.handlebars", outputFilename)); + + // paths.__init__.py (contains path str enum) + Map initOperationMap = new HashMap<>(); + initOperationMap.put("packageName", packageName); + initOperationMap.put("apiClassname", "Api"); + initOperationMap.put("pathValToVar", pathValToVar); + outputFilename = packageFilename(Arrays.asList("paths", "__init__.py")); + pathsFiles.add(Arrays.asList(initOperationMap, "__init__paths_enum.handlebars", outputFilename)); + // apis.paths.__init__.py + outputFilename = packageFilename(Arrays.asList("apis", "paths", "__init__.py")); + apisFiles.add(Arrays.asList(initOperationMap, "__init__paths.handlebars", outputFilename)); + // paths.some_path.__init__.py + // apis.paths.some_path.py + for (Map.Entry entry: pathModuleToPath.entrySet()) { + String pathModule = entry.getKey(); + String path = entry.getValue(); + String pathVar = pathValToVar.get(path); + Map pathApiMap = new HashMap<>(); + pathApiMap.put("packageName", packageName); + pathApiMap.put("pathModule", pathModule); + pathApiMap.put("apiClassName", "Api"); + pathApiMap.put("pathVar", pathVar); + outputFilename = packageFilename(Arrays.asList("paths", pathModule, "__init__.py")); + pathsFiles.add(Arrays.asList(pathApiMap, "__init__paths_x.handlebars", outputFilename)); + + PathItem pi = openAPI.getPaths().get(path); + String apiClassName = pathEnumToApiClassname.get(pathVar); + Map operationMap = new HashMap<>(); + operationMap.put("packageName", packageName); + operationMap.put("pathModule", pathModule); + operationMap.put("apiClassName", apiClassName); + operationMap.put("pathItem", pi); + outputFilename = packageFilename(Arrays.asList("apis", "paths", pathModule + ".py")); + apisFiles.add(Arrays.asList(operationMap, "apis_path_module.handlebars", outputFilename)); + } + generateFiles(pathsFiles, CodegenConstants.APIS); + generateFiles(apisFiles, CodegenConstants.APIS); + generateFiles(testFiles, CodegenConstants.API_TESTS); + } + + /* + We have a custom version of this method so for composed schemas and object schemas we add properties only if they + are defined in that schema (x.properties). We do this because validation should be done independently in each schema + If properties are hosted into composed schemas, they can collide or incorrectly list themself as required when + they are not. + */ + @Override + protected void addVarsRequiredVarsAdditionalProps(Schema schema, IJsonSchemaValidationProperties property){ + setAddProps(schema, property); + if (ModelUtils.isAnyType(schema) && supportsAdditionalPropertiesWithComposedSchema) { + // if anyType schema has properties then add them + if (schema.getProperties() != null && !schema.getProperties().isEmpty()) { + if (schema instanceof ComposedSchema) { + ComposedSchema cs = (ComposedSchema) schema; + if (cs.getOneOf() != null && !cs.getOneOf().isEmpty()) { + LOGGER.warn("'oneOf' is intended to include only the additional optional OAS extension discriminator object. " + + "For more details, see https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.9.2.1.3 and the OAS section on 'Composition and Inheritance'."); + } + } + HashSet requiredVars = new HashSet<>(); + if (schema.getRequired() != null) { + requiredVars.addAll(schema.getRequired()); + } + addVars(property, property.getVars(), schema.getProperties(), requiredVars); + } + addRequiredVarsMap(schema, property); + return; + } else if (ModelUtils.isTypeObjectSchema(schema)) { + HashSet requiredVars = new HashSet<>(); + if (schema.getRequired() != null) { + requiredVars.addAll(schema.getRequired()); + property.setHasRequired(true); + } + addVars(property, property.getVars(), schema.getProperties(), requiredVars); + if (property.getVars() != null && !property.getVars().isEmpty()) { + property.setHasVars(true); + } + } + addRequiredVarsMap(schema, property); + return; + } + /** * Configures a friendly name for the generator. This will be used by the * generator to select the library with the -g flag. @@ -214,6 +707,29 @@ public String getName() { return "python"; } + @Override + public String getHelp() { + String newLine = System.getProperty("line.separator"); + return String.join("
    ", + "Generates a Python client library", + "", + "Features in this generator:", + "- type hints on endpoints and model creation", + "- model parameter names use the spec defined keys and cases", + "- robust composition (oneOf/anyOf/allOf/not) where payload data is stored in one instance only", + "- endpoint parameter names use the spec defined keys and cases", + "- inline schemas are supported at any location including composition", + "- multiple content types supported in request body and response bodies", + "- run time type checking", + "- Sending/receiving decimals as strings supported with type:string format: number -> DecimalSchema", + "- Sending/receiving uuids as strings supported with type:string format: uuid -> UUIDSchema", + "- quicker load time for python modules (a single endpoint can be imported and used without loading others)", + "- all instances of schemas dynamically inherit from all matching schemas so one can use isinstance to check if validation passed", + "- composed schemas with type constraints supported (type:object + oneOf/anyOf/allOf)", + "- schemas are not coerced/cast. For example string + date are both stored as string, and there is a date accessor", + " - Exceptions: int/float is stored as Decimal, When receiving data from headers it will start as str and may need to be cast for example to int"); + } + @Override public Schema unaliasSchema(Schema schema) { Map allSchemas = ModelUtils.getSchemas(openAPI); @@ -262,11 +778,10 @@ public Schema unaliasSchema(Schema schema) { // free form object (type: object) if (ModelUtils.hasValidation(ref)) { return schema; - } else if (!getAllOfDescendants(simpleRef, openAPI).isEmpty()) { + } else if (getAllOfDescendants(simpleRef, openAPI).size() > 0) { return schema; - } else { - return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); } + return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); } } else if (ModelUtils.hasValidation(ref)) { // non object non array non map schemas that have validations @@ -275,6 +790,10 @@ public Schema unaliasSchema(Schema schema) { // - preserve the validations in that model class in python // - use those validations when we use this schema in composed oneOf schemas return schema; + } else if (Boolean.TRUE.equals(ref.getNullable()) && ref.getEnum() == null) { + // non enum primitive with nullable True + // we make these models so instances of this will be subclasses of this model + return schema; } else { return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); } @@ -289,14 +808,14 @@ public String pythonDate(Object dateValue) { try { date = (OffsetDateTime) dateValue; } catch (ClassCastException e) { - LOGGER.warn("Invalid `date` format for value {}", dateValue); + LOGGER.warn("Invalid `date` format for value {}", dateValue.toString()); date = ((Date) dateValue).toInstant().atOffset(ZoneOffset.UTC); } strValue = date.format(iso8601Date); } else { strValue = dateValue.toString(); } - return "dateutil_parser('" + strValue + "').date()"; + return strValue; } public String pythonDateTime(Object dateTimeValue) { @@ -306,14 +825,14 @@ public String pythonDateTime(Object dateTimeValue) { try { dateTime = (OffsetDateTime) dateTimeValue; } catch (ClassCastException e) { - LOGGER.warn("Invalid `date-time` format for value {}", dateTimeValue); + LOGGER.warn("Invalid `date-time` format for value {}", dateTimeValue.toString()); dateTime = ((Date) dateTimeValue).toInstant().atOffset(ZoneOffset.UTC); } strValue = dateTime.format(iso8601DateTime); } else { strValue = dateTimeValue.toString(); } - return "dateutil_parser('" + strValue + "')"; + return strValue; } /** @@ -324,15 +843,9 @@ public String pythonDateTime(Object dateTimeValue) { */ @Override public String toDefaultValue(Schema p) { - // if a variable has no default set and only has one allowed value - // using enum of length == 1 we use that value. Server/client usage: - // python servers: should only use default values for optional params - // python clients: should only use default values for required params Object defaultObject = null; if (p.getDefault() != null) { defaultObject = p.getDefault(); - } else if (p.getEnum() != null && p.getEnum().size() == 1) { - defaultObject = p.getEnum().get(0); } if (defaultObject == null) { @@ -347,7 +860,7 @@ public String toDefaultValue(Schema p) { } else if (ModelUtils.isStringSchema(p) && !ModelUtils.isByteArraySchema(p) && !ModelUtils.isBinarySchema(p) && !ModelUtils.isFileSchema(p) && !ModelUtils.isUUIDSchema(p) && !ModelUtils.isEmailSchema(p)) { defaultValue = ensureQuotes(defaultValue); } else if (ModelUtils.isBooleanSchema(p)) { - if (!Boolean.valueOf(defaultValue)) { + if (Boolean.valueOf(defaultValue) == false) { defaultValue = "False"; } else { defaultValue = "True"; @@ -359,7 +872,7 @@ public String toDefaultValue(Schema p) { @Override public String toModelImport(String name) { // name looks like Cat - return "from " + modelPackage() + "." + toModelFilename(name) + " import " + toModelName(name); + return "from " + packagePath() + "." + modelPackage() + "." + toModelFilename(name) + " import " + toModelName(name); } @Override @@ -372,7 +885,7 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List operations = val.getOperation(); for (CodegenOperation operation : operations) { - if (operation.imports.isEmpty()) { + if (operation.imports.size() == 0) { continue; } String[] modelNames = operation.imports.toArray(new String[0]); @@ -381,6 +894,7 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List postProcessAllModels(Map objs) { super.postProcessAllModels(objs); - List modelsToRemove = new ArrayList<>(); + boolean anyModelContainsTestCases = false; Map allDefinitions = ModelUtils.getSchemas(this.openAPI); for (String schemaName : allDefinitions.keySet()) { - Schema refSchema = new Schema().$ref("#/components/schemas/" + schemaName); - Schema unaliasedSchema = unaliasSchema(refSchema); String modelName = toModelName(schemaName); - if (unaliasedSchema.get$ref() == null) { - modelsToRemove.add(modelName); - } else { - ModelsMap objModel = objs.get(modelName); - if (objModel != null) { // to avoid form parameter's models that are not generated (skipFormModel=true) - for (ModelMap model : objModel.getModels()) { - CodegenModel cm = model.getModel(); - String[] importModelNames = cm.imports.toArray(new String[0]); - cm.imports.clear(); - for (String importModelName : importModelNames) { - cm.imports.add(toModelImport(importModelName)); - String globalImportFixer = "globals()['" + importModelName + "'] = " + importModelName; - cm.imports.add(globalImportFixer); - } - } + ModelsMap objModel = objs.get(modelName); + if (objModel == null) { + // to avoid form parameter's models that are not generated (skipFormModel=true) + continue; + } + for (ModelMap model : objModel.getModels()) { + CodegenModel cm = model.getModel(); + if (cm.testCases != null && !cm.testCases.isEmpty()) { + anyModelContainsTestCases = true; + } + String[] importModelNames = cm.imports.toArray(new String[0]); + cm.imports.clear(); + for (String importModelName : importModelNames) { + cm.imports.add(toModelImport(importModelName)); } } } + boolean testFolderSet = testFolder != null; + if (testFolderSet && anyModelContainsTestCases) { + // delete the test folder because tests there will be autogenerated + String testPath = outputFolder + File.separatorChar + testFolder; + File testDirectory = new File(testPath); + try { + FileUtils.cleanDirectory(testDirectory); + } catch (IOException e) { + LOGGER.info("Unable to delete the test folder because of exception=" + e.toString()); + } - for (String modelName : modelsToRemove) { - objs.remove(modelName); } return objs; } + public CodegenParameter fromParameter(Parameter parameter, Set imports) { + CodegenParameter cp = super.fromParameter(parameter, imports); + if (parameter.getStyle() != null) { + switch(parameter.getStyle()) { + case MATRIX: + cp.style = "MATRIX"; + break; + case LABEL: + cp.style = "LABEL"; + break; + case FORM: + cp.style = "FORM"; + break; + case SIMPLE: + cp.style = "SIMPLE"; + break; + case SPACEDELIMITED: + cp.style = "SPACE_DELIMITED"; + break; + case PIPEDELIMITED: + cp.style = "PIPE_DELIMITED"; + break; + case DEEPOBJECT: + cp.style = "DEEP_OBJECT"; + break; + } + } + // clone this so we can change some properties on it + CodegenProperty schemaProp = cp.getSchema().clone(); + // parameters may have valid python names like some_val or invalid ones like Content-Type + // we always set nameInSnakeCase to null so special handling will not be done for these names + // invalid python names will be handled in python by using a TypedDict which will allow us to have a type hint + // for keys that cannot be variable names to the schema baseName + if (schemaProp != null) { + schemaProp.nameInSnakeCase = null; + schemaProp.baseName = toModelName(cp.baseName) + "Schema"; + cp.setSchema(schemaProp); + } + return cp; + } + + private boolean isValidPythonVarOrClassName(String name) { + return name.matches("^[_a-zA-Z][_a-zA-Z0-9]*$"); + } + + /** * Convert OAS Property object to Codegen Property object * We have a custom version of this method to always set allowableValues.enumVars on all enum variables @@ -439,24 +1005,70 @@ public Map postProcessAllModels(Map objs) * This method is used by fromResponse * * @param name name of the property - * @param p OAS property object + * @param p OAS property schema + * @param required true if the property is required in the next higher object schema, false otherwise + * @param schemaIsFromAdditionalProperties true if the property is defined by additional properties schema * @return Codegen Property object */ @Override - public CodegenProperty fromProperty(String name, Schema p, boolean required) { - CodegenProperty cp = super.fromProperty(name, p, required); + public CodegenProperty fromProperty(String name, Schema p, boolean required, boolean schemaIsFromAdditionalProperties) { + // fix needed for values with /n /t etc in them + String fixedName = handleSpecialCharacters(name); + CodegenProperty cp = super.fromProperty(fixedName, p, required, schemaIsFromAdditionalProperties); + + if (cp.isAnyType && cp.isNullable) { + cp.isNullable = false; + } + if (cp.isNullable && cp.complexType == null) { + cp.setIsNull(true); + cp.isNullable = false; + cp.setHasMultipleTypes(true); + } + postProcessPattern(cp.pattern, cp.vendorExtensions); + // if we have a property that has a difficult name, either: + // 1. name is reserved, like class int float + // 2. name is invalid in python like '3rd' or 'Content-Type' + // set cp.nameInSnakeCase to a value so we can tell that we are in this use case + // we handle this in the schema templates + // templates use its presence to handle these badly named variables / keys + if ((isReservedWord(cp.baseName) || !isValidPythonVarOrClassName(cp.baseName)) && !cp.baseName.equals(cp.name)) { + cp.nameInSnakeCase = cp.name; + } else { + cp.nameInSnakeCase = null; + } if (cp.isEnum) { updateCodegenPropertyEnum(cp); } - if (cp.isPrimitiveType && p.get$ref() != null) { + Schema unaliasedSchema = unaliasSchema(p); + if (cp.isPrimitiveType && unaliasedSchema.get$ref() != null) { cp.complexType = cp.dataType; } - if (cp.isArray && cp.complexType == null && cp.mostInnerItems.complexType != null) { - cp.complexType = cp.mostInnerItems.complexType; - } + setAdditionalPropsAndItemsVarNames(cp); return cp; } + private void setAdditionalPropsAndItemsVarNames(IJsonSchemaValidationProperties item) { + if (item.getAdditionalProperties() != null) { + item.getAdditionalProperties().setBaseName("additional_properties"); + } + if (item.getItems() != null) { + item.getItems().setBaseName("items"); + } + } + + /** + * 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); + } + /** * Update codegen property's enum by adding "enumVars" (with name and value) * @@ -502,7 +1114,7 @@ public void updateCodegenPropertyEnum(CodegenProperty var) { * We have a custom version of this method to produce links to models when they are * primitive type (not map, not array, not object) and include validations or are enums * - * @param body request body + * @param body requesst body * @param imports import collection * @param bodyParameterName body parameter name * @return the resultant CodegenParameter @@ -510,6 +1122,7 @@ public void updateCodegenPropertyEnum(CodegenProperty var) { @Override public CodegenParameter fromRequestBody(RequestBody body, Set imports, String bodyParameterName) { CodegenParameter cp = super.fromRequestBody(body, imports, bodyParameterName); + cp.baseName = "body"; Schema schema = ModelUtils.getSchemaFromRequestBody(body); if (schema.get$ref() == null) { return cp; @@ -532,6 +1145,7 @@ public CodegenParameter fromRequestBody(RequestBody body, Set imports, S * With this customization, we ensure that when schemas are passed to getSchemaType * - if they have ref in them they are a model * - if they do not have ref in them they are not a model + * and code is also customized to allow anyType request body schemas * * @param codegenParameter the body parameter * @param name model schema ref key in components @@ -549,7 +1163,55 @@ protected void addBodyModelSchema(CodegenParameter codegenParameter, String name forceSimpleRef = true; } } - super.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, forceSimpleRef); + + CodegenModel codegenModel = null; + if (StringUtils.isNotBlank(name)) { + schema.setName(name); + codegenModel = fromModel(name, schema); + } + + if (codegenModel != null && (codegenModel.hasVars || forceSimpleRef)) { + if (StringUtils.isEmpty(bodyParameterName)) { + codegenParameter.baseName = codegenModel.classname; + } else { + codegenParameter.baseName = bodyParameterName; + } + codegenParameter.paramName = toParamName(codegenParameter.baseName); + codegenParameter.baseType = codegenModel.classname; + codegenParameter.dataType = getTypeDeclaration(codegenModel.classname); + codegenParameter.description = codegenModel.description; + codegenParameter.isNullable = codegenModel.isNullable; + } else { + CodegenProperty codegenProperty = fromProperty("property", schema, false); + + if (ModelUtils.isMapSchema(schema)) {// http body is map + // LOGGER.error("Map should be supported. Please report to openapi-generator github repo about the issue."); + } else if (codegenProperty != null) { + String codegenModelName, codegenModelDescription; + + if (codegenModel != null) { + codegenModelName = codegenModel.classname; + codegenModelDescription = codegenModel.description; + } else { + codegenModelName = "anyType"; + codegenModelDescription = ""; + } + + if (StringUtils.isEmpty(bodyParameterName)) { + codegenParameter.baseName = codegenModelName; + } else { + codegenParameter.baseName = bodyParameterName; + } + + codegenParameter.paramName = toParamName(codegenParameter.baseName); + codegenParameter.baseType = codegenModelName; + codegenParameter.dataType = getTypeDeclaration(codegenModelName); + codegenParameter.description = codegenModelDescription; + } + + // set nullable + setParameterNullable(codegenParameter, codegenProperty); + } } @@ -565,106 +1227,153 @@ public String toEnumVarName(String value, String datatype) { // our enum var names are keys in a python dict, so change spaces to underscores if (value.length() == 0) { return "EMPTY"; + } else if (value.equals("null")) { + return "NONE"; + } + + String intPattern = "^[-\\+]?\\d+$"; + String floatPattern = "^[-\\+]?\\d+\\.\\d+$"; + Boolean intMatch = Pattern.matches(intPattern, value); + Boolean floatMatch = Pattern.matches(floatPattern, value); + if (intMatch || floatMatch) { + String plusSign = "^\\+.+"; + String negSign = "^-.+"; + if (Pattern.matches(plusSign, value)) { + value = value.replace("+", "POSITIVE_"); + } else if (Pattern.matches(negSign, value)) { + value = value.replace("-", "NEGATIVE_"); + } else { + value = "POSITIVE_" + value; + } + if (floatMatch) { + value = value.replace(".", "_PT_"); + } + return value; } - - String var = value.replaceAll("\\s+", "_").toUpperCase(Locale.ROOT); - return var; + // Replace " " with _ + String usedValue = value.replaceAll("\\s+", "_"); + // strip first character if it is invalid + usedValue = usedValue.replaceAll("^[^_a-zA-Z]", ""); + // Replace / with _ for path enums + usedValue = usedValue.replaceAll("/", "_"); + // Replace . with _ for tag enums + usedValue = usedValue.replaceAll("\\.", "_"); + // add underscore at camelCase locations + String regex = "([a-z])([A-Z]+)"; + String replacement = "$1_$2"; + usedValue = usedValue.replaceAll(regex, replacement); + // Replace invalid characters with empty space + usedValue = usedValue.replaceAll("[^_a-zA-Z0-9]*", ""); + // uppercase + usedValue = usedValue.toUpperCase(Locale.ROOT); + + if (usedValue.length() == 0) { + for (int i = 0; i < value.length(); i++){ + Character c = value.charAt(i); + String charName = Character.getName(c.hashCode()); + usedValue += charNameToVarName(charName); + } + // remove trailing _ + usedValue = usedValue.replaceAll("[_]$", ""); + } + return usedValue; } /** - * Return the enum value in the language specified format - * e.g. status becomes "status" + * Replace - and " " with _ + * Remove SIGN * - * @param value enum variable name - * @param datatype data type - * @return the sanitized value for enum + * @param charName + * @return */ - public String toEnumValue(String value, String datatype) { - if ("int".equals(datatype) || "float".equals(datatype)) { - return value; - } else if ("bool".equals(datatype)) { - return value.substring(0, 1).toUpperCase(Locale.ROOT) + value.substring(1); - } else { - return ensureQuotes(value); - } + private String charNameToVarName(String charName) { + String varName = charName.replaceAll("[\\-\\s]", "_"); + varName = varName.replaceAll("SIGN", ""); + return varName; } - @Override - public void postProcessModelProperty(CodegenModel model, CodegenProperty p) { - postProcessPattern(p.pattern, p.vendorExtensions); - // set property.complexType so the model docs will link to the ClassName.md - if (p.complexType == null && p.isArray && p.mostInnerItems.complexType != null && !languageSpecificPrimitives.contains(p.mostInnerItems.complexType)) { - // fix ListContainers - p.complexType = p.mostInnerItems.complexType; - } - } + protected List> buildEnumVars(List values, String dataType) { + List> enumVars = new ArrayList<>(); + int truncateIdx = 0; - @Override - public void postProcessParameter(CodegenParameter p) { - postProcessPattern(p.pattern, p.vendorExtensions); - if (p.baseType != null && languageSpecificPrimitives.contains(p.baseType)) { - // set baseType to null so the api docs will not point to a model for languageSpecificPrimitives - p.baseType = null; + if (isRemoveEnumValuePrefix()) { + String commonPrefix = findCommonPrefixOfVars(values); + truncateIdx = commonPrefix.length(); } - } - - private void fixComposedSchemaRequiredVars(Schema schema, CodegenModel result) { - // for composed schema models, if the required properties are only from oneOf or anyOf models - // remove them from the composed schema's required vars - // for composed schemas our code adds oneOf and anyOf required properties to - // the composed schema's required properties - // but they should not be required because if we have ComposedSchema: oneOf -schemaA -schemaB - // and the required props are only in schemaB, we do not need to use them when making an instance of - // ComposedSchema + schemaA - ComposedSchema cs = (ComposedSchema) schema; - - // these are the properties that are from properties in self cs or cs allOf - Map selfProperties = new LinkedHashMap<>(); - List selfRequired = new ArrayList<>(); - // these are the properties that are from properties in cs oneOf or cs anyOf - Map otherProperties = new LinkedHashMap<>(); - List otherRequired = new ArrayList<>(); + for (Object value : values) { + Map enumVar = new HashMap<>(); + String enumName; + if (truncateIdx == 0) { + enumName = String.valueOf(value); + } else { + enumName = value.toString().substring(truncateIdx); + if (enumName.isEmpty()) { + enumName = value.toString(); + } + } - List oneOfanyOfSchemas = new ArrayList<>(); - List oneOf = cs.getOneOf(); - if (oneOf != null) { - oneOfanyOfSchemas.addAll(oneOf); - } - List anyOf = cs.getAnyOf(); - if (anyOf != null) { - oneOfanyOfSchemas.addAll(anyOf); - } - for (Schema sc : oneOfanyOfSchemas) { - Schema refSchema = ModelUtils.getReferencedSchema(this.openAPI, sc); - addProperties(otherProperties, otherRequired, refSchema, new HashSet<>()); + enumVar.put("name", toEnumVarName(enumName, dataType)); + if (value instanceof Integer) { + enumVar.put("value", value); + } else if (value instanceof Double) { + enumVar.put("value", value); + } else if (value instanceof Long) { + enumVar.put("value", value); + } else if (value instanceof Float) { + enumVar.put("value", value); + } else if (value instanceof BigDecimal) { + enumVar.put("value", value); + } else if (value == null) { + enumVar.put("value", "schemas.NoneClass.NONE"); + } else if (value instanceof Boolean) { + if (value.equals(Boolean.TRUE)) { + enumVar.put("value", "schemas.BoolClass.TRUE"); + } else { + enumVar.put("value", "schemas.BoolClass.FALSE"); + } + } else { + String fixedValue = (String) processTestExampleData(value); + enumVar.put("value", ensureQuotes(fixedValue)); + } + enumVar.put("isString", isDataTypeString(dataType)); + enumVars.add(enumVar); } - Set otherRequiredSet = new HashSet<>(otherRequired); - List allOf = cs.getAllOf(); - if ((schema.getProperties() != null && !schema.getProperties().isEmpty()) || allOf != null) { - // NOTE: this function also adds the allOf properties inside schema - addProperties(selfProperties, selfRequired, schema, new HashSet<>()); - } - if (result.discriminator != null) { - selfRequired.add(result.discriminator.getPropertyBaseName()); - } - Set selfRequiredSet = new HashSet<>(selfRequired); + if (enumUnknownDefaultCase) { + // If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response. + // With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case. + Map enumVar = new HashMap<>(); + String enumName = enumUnknownDefaultCaseName; - List reqVars = result.getRequiredVars(); - List reqVarsThatMustBeOptional = new ArrayList<>(); - if (reqVars != null) { - for (CodegenProperty cp : reqVars) { - String propName = cp.baseName; - if (otherRequiredSet.contains(propName) && !selfRequiredSet.contains(propName)) { - cp.required = false; - reqVarsThatMustBeOptional.add(cp); - } + String enumValue; + if (isDataTypeString(dataType)) { + enumValue = enumUnknownDefaultCaseName; + } else { + // This is a dummy value that attempts to avoid collisions with previously specified cases. + // Int.max / 192 + // The number 192 that is used to calculate this random value, is the Swift Evolution proposal for frozen/non-frozen enums. + // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) + // Since this functionality was born in the Swift 5 generator and latter on broth to all generators + // https://github.com/OpenAPITools/openapi-generator/pull/11013 + enumValue = String.valueOf(11184809); } + + enumVar.put("name", toEnumVarName(enumName, dataType)); + enumVar.put("value", toEnumValue(enumValue, dataType)); + enumVar.put("isString", isDataTypeString(dataType)); + enumVars.add(enumVar); } - for (CodegenProperty cp : reqVarsThatMustBeOptional) { - result.getRequiredVars().remove(cp); - result.getOptionalVars().add(cp); + + return enumVars; + } + + @Override + public void postProcessParameter(CodegenParameter p) { + postProcessPattern(p.pattern, p.vendorExtensions); + if (p.baseType != null && languageSpecificPrimitives.contains(p.baseType)) { + // set baseType to null so the api docs will not point to a model for languageSpecificPrimitives + p.baseType = null; } } @@ -676,10 +1385,76 @@ private void fixComposedSchemaRequiredVars(Schema schema, CodegenModel result) { protected void addParentContainer(CodegenModel model, String name, Schema schema) { super.addParentContainer(model, name, schema); - List referencedModelNames = new ArrayList<>(); + List referencedModelNames = new ArrayList(); model.dataType = getTypeString(schema, "", "", referencedModelNames); } + protected String toTestCaseName(String specTestCaseName) { + return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, specTestCaseName); + } + + protected String handleSpecialCharacters(String value) { + // handles escape characters and the like + String stringValue = value; + String backslash = "\\"; + if (stringValue.contains(backslash)) { + stringValue = stringValue.replace(backslash, "\\\\"); + } + String nullChar = "\0"; + if (stringValue.contains(nullChar)) { + stringValue = stringValue.replace(nullChar, "\\x00"); + } + String doubleQuoteChar = "\""; + if (stringValue.contains(doubleQuoteChar)) { + stringValue = stringValue.replace(doubleQuoteChar, "\\\""); + } + String lineSep = System.lineSeparator(); + if (stringValue.contains(lineSep)) { + stringValue = stringValue.replace(lineSep, "\\n"); + } + String carriageReturn = "\r"; + if (stringValue.contains(carriageReturn)) { + stringValue = stringValue.replace(carriageReturn, "\\r"); + } + String tab = "\t"; + if (stringValue.contains(tab)) { + stringValue = stringValue.replace(tab, "\\t"); + } + String formFeed = "\f"; + if (stringValue.contains(formFeed)) { + stringValue = stringValue.replace(formFeed, "\\f"); + } + return stringValue; + } + + protected Object processTestExampleData(Object value) { + if (value instanceof Integer){ + return value; + } else if (value instanceof Double || value instanceof Float || value instanceof Boolean){ + return value; + } else if (value instanceof String) { + return handleSpecialCharacters((String) value); + } else if (value instanceof LinkedHashMap) { + LinkedHashMap fixedValues = new LinkedHashMap(); + for (Map.Entry entry: ((LinkedHashMap) value).entrySet()) { + String entryKey = (String) processTestExampleData(entry.getKey()); + Object entryValue = processTestExampleData(entry.getValue()); + fixedValues.put(entryKey, entryValue); + } + return fixedValues; + } else if (value instanceof ArrayList) { + ArrayList fixedValues = (ArrayList) value; + for (int i = 0; i < fixedValues.size(); i++) { + Object item = processTestExampleData(fixedValues.get(i)); + fixedValues.set(i, item); + } + return fixedValues; + } else if (value == null) { + return value; + } + return value; + } + /** * Convert OAS Model object to Codegen Model object * We have a custom version of this method so we can: @@ -693,45 +1468,20 @@ protected void addParentContainer(CodegenModel model, String name, Schema schema @Override public CodegenModel fromModel(String name, Schema sc) { CodegenModel cm = super.fromModel(name, sc); - if (cm.requiredVars.size() > 0 && (cm.oneOf.size() > 0 || cm.anyOf.size() > 0)) { - fixComposedSchemaRequiredVars(sc, cm); - } - ArrayList> listOfLists = new ArrayList<>(); - listOfLists.add(cm.requiredVars); - listOfLists.add(cm.optionalVars); - for (List cpList : listOfLists) { - for (CodegenProperty cp : cpList) { - // sets regex values - postProcessModelProperty(cm, cp); - } + + if (cm.isNullable) { + cm.setIsNull(true); + cm.isNullable = false; + cm.setHasMultipleTypes(true); } Boolean isNotPythonModelSimpleModel = (ModelUtils.isComposedSchema(sc) || ModelUtils.isObjectSchema(sc) || ModelUtils.isMapSchema(sc)); + setAdditionalPropsAndItemsVarNames(cm); if (isNotPythonModelSimpleModel) { return cm; } - // Use cases for default values / enums of length one - // 1. no default exists - // schema does not contain default - // cm.defaultValue unset, cm.hasRequired = true - // 2. spec has a default - // schema contains default - // cm.defaultValue set, cm.hasRequired = false - // different value here to differentiate between use case 3 below - // This defaultValue is used when a consumer (client or server) lacks the input argument, defaultValue will be used - // 3. only one value is allowed in an enum - // schema does not contain default - // cm.defaultValue set, cm.hasRequired = false - // because we know what value needs to be set so the user doesn't need to input it - // This defaultValue is used in the client and is sent to the server String defaultValue = toDefaultValue(sc); - if (sc.getDefault() == null && defaultValue == null) { - cm.hasRequired = true; - } else if (sc.getDefault() != null) { - cm.defaultValue = defaultValue; - cm.hasRequired = false; - } else if (defaultValue != null && cm.defaultValue == null) { + if (sc.getDefault() != null) { cm.defaultValue = defaultValue; - cm.hasRequired = false; } return cm; } @@ -763,62 +1513,6 @@ public String getModelName(Schema sc) { return null; } - @Override - protected Schema getAdditionalProperties(Schema schema) { - /* - Use cases: - 1. addProps set to schema in spec: return that schema - 2. addProps unset w/ getDisallowAdditionalPropertiesIfNotPresent -> null - 3. addProps unset w/ getDisallowAdditionalPropertiesIfNotPresent=False -> new Schema() - 4. addProps true -> new Schema() NOTE: v3 only - 5. addprops false -> null NOTE: v3 only - */ - Object addProps = schema.getAdditionalProperties(); - if (addProps instanceof Schema) { - return (Schema) addProps; - } - if (addProps == null) { - // When reaching this code path, this should indicate the 'additionalProperties' keyword is - // not present in the OAS schema. This is true for OAS 3.0 documents. - // However, the parsing logic is broken for OAS 2.0 documents because of the - // https://github.com/swagger-api/swagger-parser/issues/1369 issue. - // When OAS 2.0 documents are parsed, the swagger-v2-converter ignores the 'additionalProperties' - // keyword if the value is boolean. That means codegen is unable to determine whether - // additional properties are allowed or not. - // - // The original behavior was to assume additionalProperties had been set to false. - if (getDisallowAdditionalPropertiesIfNotPresent()) { - // If the 'additionalProperties' keyword is not present in a OAS schema, - // interpret as if the 'additionalProperties' keyword had been set to false. - // This is NOT compliant with the JSON schema specification. It is the original - // 'openapi-generator' behavior. - return null; - } - /* - // The disallowAdditionalPropertiesIfNotPresent CLI option has been set to true, - // but for now that only works with OAS 3.0 documents. - // The new behavior does not work with OAS 2.0 documents. - if (extensions == null || !extensions.containsKey(EXTENSION_OPENAPI_DOC_VERSION)) { - // Fallback to the legacy behavior. - return null; - } - // Get original swagger version from OAS extension. - // Note openAPI.getOpenapi() is always set to 3.x even when the document - // is converted from a OAS/Swagger 2.0 document. - // https://github.com/swagger-api/swagger-parser/pull/1374 - SemVer version = new SemVer((String)extensions.get(EXTENSION_OPENAPI_DOC_VERSION)); - if (version.major != 3) { - return null; - } - */ - } - if (addProps == null || (addProps instanceof Boolean && (Boolean) addProps)) { - // Return empty schema to allow any type - return new Schema(); - } - return null; - } - /** * Return a string representation of the Python types for the specified OAS schema. * Primitive types in the OAS specification are implemented in Python using the corresponding @@ -858,41 +1552,30 @@ private String getTypeString(Schema p, String prefix, String suffix, List both become use case 1 - // switch to v3 if you need use cases 1 + 2 to work correctly - return prefix + "bool, date, datetime, dict, float, int, list, str, none_type" + fullSuffix; - } // Resolve $ref because ModelUtils.isXYZ methods do not automatically resolve references. if (ModelUtils.isNullable(ModelUtils.getReferencedSchema(this.openAPI, p))) { fullSuffix = ", none_type" + suffix; } - Boolean v3WithCompositionAddPropsAnyTypeSchemaCase = (getAdditionalProperties(p) != null && emptySchema.equals(getAdditionalProperties(p)) && originalSpecVersion.equals("3")); - if (isFreeFormObject(p) && v3WithCompositionAddPropsAnyTypeSchemaCase) { - // v3 code path, use case: type object schema with no other schema info - return prefix + "{str: (bool, date, datetime, dict, float, int, list, str, none_type)}" + fullSuffix; - } else if ((ModelUtils.isMapSchema(p) || "object".equals(p.getType())) && getAdditionalProperties(p) != null) { - Schema inner = getAdditionalProperties(p); - return prefix + "{str: " + getTypeString(inner, "(", ")", referencedModelNames) + "}" + fullSuffix; + if (ModelUtils.isNumberSchema(p)) { + return prefix + "int, float" + fullSuffix; + } else if (ModelUtils.isTypeObjectSchema(p)) { + if (p.getAdditionalProperties() != null && p.getAdditionalProperties().equals(false)) { + if (p.getProperties() == null) { + // type object with no properties and additionalProperties = false, empty dict only + return prefix + "{str: typing.Any}" + fullSuffix; + } else { + // properties only + // TODO add type hints for those properties only as values + return prefix + "{str: typing.Any}" + fullSuffix; + } + } else { + // additionalProperties exists + Schema inner = getAdditionalProperties(p); + return prefix + "{str: " + getTypeString(inner, "(", ")", referencedModelNames) + "}" + fullSuffix; + // TODO add code here to add property values too if they exist + } } else if (ModelUtils.isArraySchema(p)) { ArraySchema ap = (ArraySchema) p; Schema inner = ap.getItems(); @@ -909,8 +1592,7 @@ private String getTypeString(Schema p, String prefix, String suffix, List referencedModelNames = new ArrayList<>(); - getTypeString(addProps, "", "", referencedModelNames); - if (referencedModelNames.size() != 0) { - // Models that are referenced in the 'additionalPropertiesType' keyword - // must be added to the imports. - codegenModel.imports.addAll(referencedModelNames); - } - } - // If addProps is null, the value of the 'additionalProperties' keyword is set - // to false, i.e. no additional properties are allowed. } /** @@ -995,12 +1661,6 @@ protected Object getObjectExample(Schema sc) { * @return quoted string */ private String ensureQuotes(String in) { - Pattern pattern = Pattern.compile("\r\n|\r|\n"); - Matcher matcher = pattern.matcher(in); - if (matcher.find()) { - // if a string has a new line in it add triple quotes to make it a python multiline string - return "'''" + in + "'''"; - } String strPattern = "^['\"].*?['\"]$"; if (in.matches(strPattern)) { return in; @@ -1010,14 +1670,14 @@ private String ensureQuotes(String in) { @Override public String toExampleValue(Schema schema) { - Object objExample = getObjectExample(schema); String modelName = getModelName(schema); - return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0, Sets.newHashSet()); + Object objExample = getObjectExample(schema); + return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0, new ArrayList<>()); } public String toExampleValue(Schema schema, Object objExample) { String modelName = getModelName(schema); - return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0, Sets.newHashSet()); + return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0, new ArrayList<>()); } private Boolean simpleStringSchema(Schema schema) { @@ -1050,12 +1710,12 @@ private MappedModel getDiscriminatorMappedModel(CodegenDiscriminator disc) { * @param schema the schema that we need an example for * @param objExample the example that applies to this schema, for now only string example are used * @param indentationLevel integer indentation level that we are currently at - * we assume the indentation amount is 4 spaces times this integer + * we assume the indentaion amount is 4 spaces times this integer * @param prefix the string prefix that we will use when assigning an example for this line * this is used when setting key: value, pairs "key: " is the prefix * and this is used when setting properties like some_property='some_property_example' - * @param exampleLine this is the current line that we are generating an example for, starts at 0 - * we don't indent the 0th line because using the example value looks like: + * @param exampleLine this is the current line that we are generatign an example for, starts at 0 + * we don't indentin the 0th line because using the example value looks like: * prop = ModelName( line 0 * some_property='some_property_example' line 1 * ) line 2 @@ -1063,12 +1723,17 @@ private MappedModel getDiscriminatorMappedModel(CodegenDiscriminator disc) { * ModelName( line 0 * some_property='some_property_example' line 1 * ) line 2 - * @param seenSchemas This set contains all the schemas passed into the recursive function. It is used to check - * if a schema was already passed into the function and breaks the infinite recursive loop. The - * only schemas that are not added are ones that contain $ref != null + * @param includedSchemas are a list of schemas that we have moved through to get here. If the new schemas that we + * are looking at is in includedSchemas then we have hit a cycle. * @return the string example */ - private String toExampleValueRecursive(String modelName, Schema schema, Object objExample, int indentationLevel, String prefix, Integer exampleLine, Set seenSchemas) { + private String toExampleValueRecursive(String modelName, Schema schema, Object objExample, int indentationLevel, String prefix, Integer exampleLine, List includedSchemas) { + boolean couldHaveCycle = includedSchemas.size() > 0 && potentiallySelfReferencingSchema(schema); + // If we have seen the ContextAwareSchemaNode more than once before, we must be in a cycle. + boolean cycleFound = false; + if (couldHaveCycle) { + cycleFound = includedSchemas.subList(0, includedSchemas.size()-1).stream().anyMatch(s -> schema.equals(s)); + } final String indentionConst = " "; String currentIndentation = ""; String closingIndentation = ""; @@ -1092,43 +1757,83 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o if (objExample != null) { example = objExample.toString(); } - // checks if the current schema has already been passed in. If so, breaks the current recursive pass - if (seenSchemas.contains(schema)) { - if (modelName != null) { - return fullPrefix + closeChars; - } else { - // this is a recursive schema - // need to add a reasonable example to avoid - // infinite recursion - if (ModelUtils.isNullable(schema)) { - // if the schema is nullable, then 'None' is a valid value - return fullPrefix + "None" + closeChars; - } else if (ModelUtils.isArraySchema(schema)) { - // the schema is an array, add an empty array - return fullPrefix + "[]" + closeChars; - } else { - // the schema is an object, make an empty object - return fullPrefix + "{}" + closeChars; - } - } - } - if (null != schema.get$ref()) { Map allDefinitions = ModelUtils.getSchemas(this.openAPI); String ref = ModelUtils.getSimpleRef(schema.get$ref()); Schema refSchema = allDefinitions.get(ref); if (null == refSchema) { - LOGGER.warn("Unable to find referenced schema {}\n", schema.get$ref()); + LOGGER.warn("Unable to find referenced schema " + schema.get$ref() + "\n"); return fullPrefix + "None" + closeChars; } String refModelName = getModelName(schema); - return toExampleValueRecursive(refModelName, refSchema, objExample, indentationLevel, prefix, exampleLine, seenSchemas); - } else if (ModelUtils.isNullType(schema) || ModelUtils.isAnyType(schema)) { + return toExampleValueRecursive(refModelName, refSchema, objExample, indentationLevel, prefix, exampleLine, includedSchemas); + } else if (ModelUtils.isNullType(schema)) { // The 'null' type is allowed in OAS 3.1 and above. It is not supported by OAS 3.0.x, // though this tooling supports it. return fullPrefix + "None" + closeChars; + } else if (ModelUtils.isAnyType(schema)) { + /* + This schema may be a composed schema + TODO generate examples for some of these use cases in the future like + only oneOf without a discriminator + */ + if (cycleFound) { + return ""; + } + Boolean hasProperties = (schema.getProperties() != null && !schema.getProperties().isEmpty()); + CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI); + if (ModelUtils.isComposedSchema(schema)) { + if(includedSchemas.contains(schema)) { + return ""; + } + includedSchemas.add(schema); + // complex composed object type schemas not yet handled and the code returns early + if (hasProperties) { + // what if this composed schema defined properties + allOf? + // or items + properties, both a ist and a dict could be accepted as payloads + return fullPrefix + "{}" + closeChars; + } + ComposedSchema cs = (ComposedSchema) schema; + Integer allOfExists = 0; + if (cs.getAllOf() != null && !cs.getAllOf().isEmpty()) { + allOfExists = 1; + } + Integer anyOfExists = 0; + if (cs.getAnyOf() != null && !cs.getAnyOf().isEmpty()) { + anyOfExists = 1; + } + Integer oneOfExists = 0; + if (cs.getOneOf() != null && !cs.getOneOf().isEmpty()) { + oneOfExists = 1; + } + if (allOfExists + anyOfExists + oneOfExists > 1) { + // what if it needs one oneOf schema, one anyOf schema, and two allOf schemas? + return fullPrefix + "None" + closeChars; + } + // for now only oneOf with discriminator is supported + if (oneOfExists == 1 && disc != null) { + ; + } else { + return fullPrefix + "None" + closeChars; + } + } + if (disc != null) { + // a discriminator means that the type must be object + MappedModel mm = getDiscriminatorMappedModel(disc); + if (mm == null) { + return fullPrefix + "None" + closeChars; + } + String discPropNameValue = mm.getMappingName(); + String chosenModelName = mm.getModelName(); + Schema modelSchema = getModelNameToSchemaCache().get(chosenModelName); + CodegenProperty cp = new CodegenProperty(); + cp.setName(disc.getPropertyName()); + cp.setExample(discPropNameValue); + return exampleForObjectModel(modelSchema, fullPrefix, closeChars, cp, indentationLevel, exampleLine, closingIndentation, includedSchemas); + } + return fullPrefix + "None" + closeChars; } else if (ModelUtils.isBooleanSchema(schema)) { - if (objExample == null) { + if (example == null) { example = "True"; } else { if ("false".equalsIgnoreCase(objExample.toString())) { @@ -1138,85 +1843,82 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o } } return fullPrefix + example + closeChars; - } else if (ModelUtils.isDateSchema(schema)) { - if (objExample == null) { - example = pythonDate("1970-01-01"); - } else { - example = pythonDate(objExample); - } - return fullPrefix + example + closeChars; - } else if (ModelUtils.isDateTimeSchema(schema)) { - if (objExample == null) { - example = pythonDateTime("1970-01-01T00:00:00.00Z"); - } else { - example = pythonDateTime(objExample); - } - return fullPrefix + example + closeChars; - } else if (ModelUtils.isBinarySchema(schema)) { - if (objExample == null) { - example = "/path/to/file"; - } - example = "open('" + example + "', 'rb')"; - return fullPrefix + example + closeChars; - } else if (ModelUtils.isByteArraySchema(schema)) { - if (objExample == null) { - example = "'YQ=='"; - } - return fullPrefix + example + closeChars; } else if (ModelUtils.isStringSchema(schema)) { - if (objExample == null) { + if (example != null) { + return fullPrefix + ensureQuotes(handleSpecialCharacters(example)) + closeChars; + } + if (ModelUtils.isDateSchema(schema)) { + if (objExample == null) { + example = pythonDate("1970-01-01"); + } else { + example = pythonDate(objExample); + } + } else if (ModelUtils.isDateTimeSchema(schema)) { + if (objExample == null) { + example = pythonDateTime("1970-01-01T00:00:00.00Z"); + } else { + example = pythonDateTime(objExample); + } + } else if (ModelUtils.isBinarySchema(schema)) { + if (example == null) { + example = "/path/to/file"; + } + example = "open('" + example + "', 'rb')"; + return fullPrefix + example + closeChars; + } else if (ModelUtils.isByteArraySchema(schema)) { + if (objExample == null) { + example = "'YQ=='"; + } + } else if ("Number".equalsIgnoreCase(schema.getFormat())) { // a BigDecimal: - if ("Number".equalsIgnoreCase(schema.getFormat())) { - example = "2"; - return fullPrefix + example + closeChars; - } else if (StringUtils.isNotBlank(schema.getPattern())) { - String pattern = schema.getPattern(); - /* - RxGen does not support our ECMA dialect https://github.com/curious-odd-man/RgxGen/issues/56 - So strip off the leading /, trailing / and trailing /i, and turn on ignore case if we have it - */ - Pattern valueExtractor = Pattern.compile("^/?(.+?)/?(i?)$"); - Matcher m = valueExtractor.matcher(pattern); - RgxGen rgxGen = null; - if (m.find()) { - int groupCount = m.groupCount(); - if (groupCount == 1) { - // only pattern found - String isolatedPattern = m.group(1); + example = "2"; + } else if (StringUtils.isNotBlank(schema.getPattern())) { + String pattern = schema.getPattern(); + /* + RxGen does not support our ECMA dialect https://github.com/curious-odd-man/RgxGen/issues/56 + So strip off the leading / and trailing / and turn on ignore case if we have it + */ + Pattern valueExtractor = Pattern.compile("^/?(.+?)/?(.?)$"); + Matcher m = valueExtractor.matcher(pattern); + RgxGen rgxGen = null; + if (m.find()) { + int groupCount = m.groupCount(); + if (groupCount == 1) { + // only pattern found + String isolatedPattern = m.group(1); + rgxGen = new RgxGen(isolatedPattern); + } else if (groupCount == 2) { + // patterns and flag found + String isolatedPattern = m.group(1); + String flags = m.group(2); + if (flags.contains("i")) { + rgxGen = new RgxGen(isolatedPattern); + RgxGenProperties properties = new RgxGenProperties(); + RgxGenOption.CASE_INSENSITIVE.setInProperties(properties, true); + rgxGen.setProperties(properties); + } else { rgxGen = new RgxGen(isolatedPattern); - } else if (groupCount == 2) { - // patterns and flag found - String isolatedPattern = m.group(1); - String flags = m.group(2); - if (flags.contains("i")) { - rgxGen = new RgxGen(isolatedPattern); - RgxGenProperties properties = new RgxGenProperties(); - RgxGenOption.CASE_INSENSITIVE.setInProperties(properties, true); - rgxGen.setProperties(properties); - } else { - rgxGen = new RgxGen(isolatedPattern); - } } - } else { - rgxGen = new RgxGen(pattern); } + } else { + rgxGen = new RgxGen(pattern); + } - // this seed makes it so if we have [a-z] we pick a - Random random = new Random(18); - if (rgxGen != null) { - example = rgxGen.generate(random); - } else { - throw new RuntimeException("rgxGen cannot be null. Please open an issue in the openapi-generator github repo."); - } - } else if (schema.getMinLength() != null) { - example = ""; - int len = schema.getMinLength().intValue(); - for (int i = 0; i < len; i++) example += "a"; - } else if (ModelUtils.isUUIDSchema(schema)) { - example = "046b6c7f-0b8a-43b9-b35d-6489e6daee91"; + // this seed makes it so if we have [a-z] we pick a + Random random = new Random(18); + if (rgxGen != null) { + example = rgxGen.generate(random); } else { - example = "string_example"; + throw new RuntimeException("rgxGen cannot be null. Please open an issue in the openapi-generator github repo."); } + } else if (schema.getMinLength() != null) { + example = ""; + int len = schema.getMinLength().intValue(); + for (int i = 0; i < len; i++) example += "a"; + } else if (ModelUtils.isUUIDSchema(schema)) { + example = "046b6c7f-0b8a-43b9-b35d-6489e6daee91"; + } else { + example = "string_example"; } return fullPrefix + ensureQuotes(example) + closeChars; } else if (ModelUtils.isIntegerSchema(schema)) { @@ -1238,25 +1940,85 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o } return fullPrefix + example + closeChars; } else if (ModelUtils.isArraySchema(schema)) { + if (objExample instanceof Iterable) { + // If the example is already a list, return it directly instead of wrongly wrap it in another list + return fullPrefix + objExample.toString() + closeChars; + } + if (ModelUtils.isComposedSchema(schema)) { + // complex composed array type schemas not yet handled and the code returns early + return fullPrefix + "[]" + closeChars; + } ArraySchema arrayschema = (ArraySchema) schema; Schema itemSchema = arrayschema.getItems(); String itemModelName = getModelName(itemSchema); - if (objExample instanceof Iterable && itemModelName == null) { - // If the example is already a list, return it directly instead of wrongly wrap it in another list - return fullPrefix + objExample + closeChars; + if(includedSchemas.contains(schema)) { + return ""; } - Set newSeenSchemas = new HashSet<>(seenSchemas); - newSeenSchemas.add(schema); - example = fullPrefix + "[" + "\n" + toExampleValueRecursive(itemModelName, itemSchema, objExample, indentationLevel + 1, "", exampleLine + 1, newSeenSchemas) + ",\n" + closingIndentation + "]" + closeChars; - return example; - } else if (ModelUtils.isMapSchema(schema)) { + includedSchemas.add(schema); + String itemExample = toExampleValueRecursive(itemModelName, itemSchema, objExample, indentationLevel + 1, "", exampleLine + 1, includedSchemas); + if (StringUtils.isEmpty(itemExample) || cycleFound) { + return fullPrefix + "[]" + closeChars; + } else { + return fullPrefix + "[" + "\n" + itemExample + "\n" + closingIndentation + "]" + closeChars; + } + } else if (ModelUtils.isTypeObjectSchema(schema)) { if (modelName == null) { - fullPrefix += "{"; - closeChars = "}"; + fullPrefix += "dict("; + closeChars = ")"; + } + if (cycleFound) { + return fullPrefix + closeChars; + } + Boolean hasProperties = (schema.getProperties() != null && !schema.getProperties().isEmpty()); + CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI); + if (ModelUtils.isComposedSchema(schema)) { + // complex composed object type schemas not yet handled and the code returns early + if (hasProperties) { + // what if this composed schema defined properties + allOf? + return fullPrefix + closeChars; + } + ComposedSchema cs = (ComposedSchema) schema; + Integer allOfExists = 0; + if (cs.getAllOf() != null && !cs.getAllOf().isEmpty()) { + allOfExists = 1; + } + Integer anyOfExists = 0; + if (cs.getAnyOf() != null && !cs.getAnyOf().isEmpty()) { + anyOfExists = 1; + } + Integer oneOfExists = 0; + if (cs.getOneOf() != null && !cs.getOneOf().isEmpty()) { + oneOfExists = 1; + } + if (allOfExists + anyOfExists + oneOfExists > 1) { + // what if it needs one oneOf schema, one anyOf schema, and two allOf schemas? + return fullPrefix + closeChars; + } + // for now only oneOf with discriminator is supported + if (oneOfExists == 1 && disc != null) { + ; + } else { + return fullPrefix + closeChars; + } + } + if (disc != null) { + MappedModel mm = getDiscriminatorMappedModel(disc); + if (mm == null) { + return fullPrefix + closeChars; + } + String discPropNameValue = mm.getMappingName(); + String chosenModelName = mm.getModelName(); + Schema modelSchema = getModelNameToSchemaCache().get(chosenModelName); + CodegenProperty cp = new CodegenProperty(); + cp.setName(disc.getPropertyName()); + cp.setExample(discPropNameValue); + return exampleForObjectModel(modelSchema, fullPrefix, closeChars, cp, indentationLevel, exampleLine, closingIndentation, includedSchemas); } Object addPropsObj = schema.getAdditionalProperties(); - // TODO handle true case for additionalProperties - if (addPropsObj instanceof Schema) { + if (hasProperties) { + return exampleForObjectModel(schema, fullPrefix, closeChars, null, indentationLevel, exampleLine, closingIndentation, includedSchemas); + } else if (addPropsObj instanceof Schema) { + // TODO handle true case for additionalProperties Schema addPropsSchema = (Schema) addPropsObj; String key = "key"; Object addPropsExample = getObjectExample(addPropsSchema); @@ -1269,93 +2031,43 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o addPropPrefix = ensureQuotes(key) + ": "; } String addPropsModelName = getModelName(addPropsSchema); - Set newSeenSchemas = new HashSet<>(seenSchemas); - newSeenSchemas.add(schema); - example = fullPrefix + "\n" + toExampleValueRecursive(addPropsModelName, addPropsSchema, addPropsExample, indentationLevel + 1, addPropPrefix, exampleLine + 1, newSeenSchemas) + ",\n" + closingIndentation + closeChars; - } else { - example = fullPrefix + closeChars; - } - return example; - } else if (ModelUtils.isObjectSchema(schema)) { - if (modelName == null) { - fullPrefix += "{"; - closeChars = "}"; - } - CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI); - if (disc != null) { - MappedModel mm = getDiscriminatorMappedModel(disc); - if (mm != null) { - String discPropNameValue = mm.getMappingName(); - String chosenModelName = mm.getModelName(); - // TODO handle this case in the future, this is when the discriminated - // schema allOf includes this schema, like Cat allOf includes Pet - // so this is the composed schema use case - } else { - return fullPrefix + closeChars; + if(includedSchemas.contains(schema)) { + return ""; } - } - Set newSeenSchemas = new HashSet<>(seenSchemas); - newSeenSchemas.add(schema); - String exampleForObjectModel = exampleForObjectModel(schema, fullPrefix, closeChars, null, indentationLevel, exampleLine, closingIndentation, newSeenSchemas); - return exampleForObjectModel; - } else if (ModelUtils.isComposedSchema(schema)) { - // TODO add examples for composed schema models without discriminators + includedSchemas.add(schema); - CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI); - if (disc != null) { - MappedModel mm = getDiscriminatorMappedModel(disc); - if (mm != null) { - String discPropNameValue = mm.getMappingName(); - String chosenModelName = mm.getModelName(); - Schema modelSchema = getModelNameToSchemaCache().get(chosenModelName); - CodegenProperty cp = new CodegenProperty(); - cp.setName(disc.getPropertyName()); - cp.setExample(discPropNameValue); - // Adds schema to seenSchemas before running example model function. removes schema after running - // the function. It also doesn't keep track of any schemas within the ObjectModel. - Set newSeenSchemas = new HashSet<>(seenSchemas); - newSeenSchemas.add(schema); - String exampleForObjectModel = exampleForObjectModel(modelSchema, fullPrefix, closeChars, cp, indentationLevel, exampleLine, closingIndentation, newSeenSchemas); - return exampleForObjectModel; - } else { - return fullPrefix + closeChars; - } + example = fullPrefix + "\n" + toExampleValueRecursive(addPropsModelName, addPropsSchema, addPropsExample, indentationLevel + 1, addPropPrefix, exampleLine + 1, includedSchemas) + ",\n" + closingIndentation + closeChars; + } else { + example = fullPrefix + closeChars; } - return fullPrefix + closeChars; } else { - LOGGER.warn("Type {} not handled properly in toExampleValue", schema.getType()); + LOGGER.warn("Type " + schema.getType() + " not handled properly in toExampleValue"); } return example; } - private String exampleForObjectModel(Schema schema, String fullPrefix, String closeChars, CodegenProperty discProp, int indentationLevel, int exampleLine, String closingIndentation, Set seenSchemas) { + private boolean potentiallySelfReferencingSchema(Schema schema) { + return null != schema.get$ref() || ModelUtils.isArraySchema(schema) || ModelUtils.isMapSchema(schema) || ModelUtils.isObjectSchema(schema) || ModelUtils.isComposedSchema(schema); + } + + private String exampleForObjectModel(Schema schema, String fullPrefix, String closeChars, CodegenProperty discProp, int indentationLevel, int exampleLine, String closingIndentation, List includedSchemas) { + Map requiredAndOptionalProps = schema.getProperties(); if (requiredAndOptionalProps == null || requiredAndOptionalProps.isEmpty()) { return fullPrefix + closeChars; } + if(includedSchemas.contains(schema)) { + return ""; + } + includedSchemas.add(schema); + String example = fullPrefix + "\n"; + for (Map.Entry entry : requiredAndOptionalProps.entrySet()) { String propName = entry.getKey(); Schema propSchema = entry.getValue(); - boolean readOnly = false; - if (propSchema.getReadOnly() != null) { - readOnly = propSchema.getReadOnly(); - } - if (readOnly) { - continue; - } - String ref = propSchema.get$ref(); - if (ref != null) { - Schema refSchema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); - if (refSchema.getReadOnly() != null) { - readOnly = refSchema.getReadOnly(); - } - if (readOnly) { - continue; - } - } propName = toVarName(propName); String propModelName = null; Object propExample = null; @@ -1364,13 +2076,25 @@ private String exampleForObjectModel(Schema schema, String fullPrefix, String cl propExample = discProp.example; } else { propModelName = getModelName(propSchema); - propExample = exampleFromStringOrArraySchema(propSchema, null, propName); + propExample = exampleFromStringOrArraySchema( + propSchema, + null, + propName); } - example += toExampleValueRecursive(propModelName, propSchema, propExample, indentationLevel + 1, propName + "=", exampleLine + 1, seenSchemas) + ",\n"; + + example += toExampleValueRecursive(propModelName, + propSchema, + propExample, + indentationLevel + 1, + propName + "=", + exampleLine + 1, + includedSchemas) + ",\n"; } + // TODO handle additionalProperties also example += closingIndentation + closeChars; return example; + } private Object exampleFromStringOrArraySchema(Schema sc, Object currentExample, String propName) { @@ -1501,7 +2225,7 @@ public CodegenParameter fromFormProperty(String name, Schema propertySchema, Set protected Map getModelNameToSchemaCache() { if (modelNameToSchemaCache == null) { // Create a cache to efficiently lookup schema based on model name. - Map m = new HashMap<>(); + Map m = new HashMap(); ModelUtils.getSchemas(openAPI).forEach((key, schema) -> { m.put(toModelName(key), schema); }); @@ -1510,12 +2234,504 @@ protected Map getModelNameToSchemaCache() { return modelNameToSchemaCache; } + /** + * Use cases: + * additional properties is unset: do nothing + * additional properties is true: add definiton to property + * additional properties is false: add definiton to property + * additional properties is schema: add definiton to property + * + * @param schema the schema that may contain an additional property schema + * @param property the property for the above schema + */ + @Override + protected void setAddProps(Schema schema, IJsonSchemaValidationProperties property){ + Schema addPropsSchema = getSchemaFromBooleanOrSchema(schema.getAdditionalProperties()); + if (addPropsSchema == null) { + return; + } + CodegenProperty addPropProp = fromProperty("", addPropsSchema, false, false); + property.setAdditionalProperties(addPropProp); + } + + /** + * Update property for array(list) container + * + * @param property Codegen property + * @param innerProperty Codegen inner property of map or list + */ + @Override + protected void updatePropertyForArray(CodegenProperty property, CodegenProperty innerProperty) { + if (innerProperty == null) { + if(LOGGER.isWarnEnabled()) { + LOGGER.warn("skipping invalid array property {}", Json.pretty(property)); + } + return; + } + property.dataFormat = innerProperty.dataFormat; + if (languageSpecificPrimitives.contains(innerProperty.baseType)) { + property.isPrimitiveType = true; + } + property.items = innerProperty; + property.mostInnerItems = getMostInnerItems(innerProperty); + // inner item is Enum + if (isPropertyInnerMostEnum(property)) { + // isEnum is set to true when the type is an enum + // or the inner type of an array/map is an enum + property.isEnum = true; + // update datatypeWithEnum and default value for array + // e.g. List => List + updateDataTypeWithEnumForArray(property); + // set allowable values to enum values (including array/map of enum) + property.allowableValues = getInnerEnumAllowableValues(property); + } + + } + + /** + * Sets the booleans that define the model's type + * + * @param model the model to update + * @param schema the model's schema + */ + protected void updateModelForString(CodegenModel model, Schema schema) { + if (ModelUtils.isDateTimeSchema(schema)) { + // isString stays true, format stores that this is a date-time + } else if (ModelUtils.isDateSchema(schema)) { + // isString stays true, format stores that this is a date + } else if (ModelUtils.isUUIDSchema(schema)) { + // isString stays true, format stores that this is a uuid + } else if (ModelUtils.isDecimalSchema(schema)) { + // isString stays true, format stores that this is a uuid + } else if (ModelUtils.isBinarySchema(schema)) { + // format stores that this is binary + model.isString = true; + } + } + + protected void updateModelForNumber(CodegenModel model, Schema schema) { + model.setIsNumber(true); + // float vs double info is stored in format + } + + protected void updateModelForInteger(CodegenModel model, Schema schema) { + model.isInteger = true; + // int32 int64 info is stored in format + } + + protected void updatePropertyForString(CodegenProperty property, Schema p) { + if (ModelUtils.isByteArraySchema(p)) { + // isString stays true, format stores that this is a byte + } else if (ModelUtils.isBinarySchema(p)) { + // format stores that this is binary + property.isString = true; + } else if (ModelUtils.isUUIDSchema(p)) { + // isString stays true, format stores that this is a uuid + } else if (ModelUtils.isURISchema(p)) { + property.isUri = true; + } else if (ModelUtils.isEmailSchema(p)) { + property.isEmail = true; + } else if (ModelUtils.isDateSchema(p)) { // date format + // isString stays true, format stores that this is a date + } else if (ModelUtils.isDateTimeSchema(p)) { // date-time format + // isString stays true, format stores that this is a date-time + } else if (ModelUtils.isDecimalSchema(p)) { // type: string, format: number + // isString stays true, format stores that this is a number + } + property.pattern = toRegularExpression(p.getPattern()); + } + + protected void updatePropertyForNumber(CodegenProperty property, Schema p) { + property.setIsNumber(true); + // float and double differentiation is determined with format info + } + + protected void updatePropertyForInteger(CodegenProperty property, Schema p) { + property.isInteger = true; + // int32 and int64 differentiation is determined with format info + } + + + @Override + protected void updatePropertyForObject(CodegenProperty property, Schema p) { + addVarsRequiredVarsAdditionalProps(p, property); + } + + @Override + protected void updatePropertyForAnyType(CodegenProperty property, Schema p) { + // The 'null' value is allowed when the OAS schema is 'any type'. + // See https://github.com/OAI/OpenAPI-Specification/issues/1389 + if (Boolean.FALSE.equals(p.getNullable())) { + LOGGER.warn("Schema '{}' is any type, which includes the 'null' value. 'nullable' cannot be set to 'false'", p.getName()); + } + addVarsRequiredVarsAdditionalProps(p, property); + } + + @Override + protected void updateModelForObject(CodegenModel m, Schema schema) { + // custom version of this method so properties are always added with addVars + if (schema.getProperties() != null || schema.getRequired() != null) { + // passing null to allProperties and allRequired as there's no parent + addVars(m, unaliasPropertySchema(schema.getProperties()), schema.getRequired(), null, null); + } + // an object or anyType composed schema that has additionalProperties set + addAdditionPropertiesToCodeGenModel(m, schema); + // process 'additionalProperties' + setAddProps(schema, m); + addRequiredVarsMap(schema, m); + } + + @Override + protected void updateModelForAnyType(CodegenModel m, Schema schema) { + // The 'null' value is allowed when the OAS schema is 'any type'. + // See https://github.com/OAI/OpenAPI-Specification/issues/1389 + if (Boolean.FALSE.equals(schema.getNullable())) { + LOGGER.error("Schema '{}' is any type, which includes the 'null' value. 'nullable' cannot be set to 'false'", m.name); + } + // todo add items support here in the future + if (schema.getProperties() != null || schema.getRequired() != null) { + // passing null to allProperties and allRequired as there's no parent + addVars(m, unaliasPropertySchema(schema.getProperties()), schema.getRequired(), null, null); + } + addAdditionPropertiesToCodeGenModel(m, schema); + // process 'additionalProperties' + setAddProps(schema, m); + addRequiredVarsMap(schema, m); + } + + @Override + protected void updateModelForComposedSchema(CodegenModel m, Schema schema, Map allDefinitions) { + final ComposedSchema composed = (ComposedSchema) schema; + + // TODO revise the logic below to set discriminator, xml attributes + if (composed.getAllOf() != null) { + int modelImplCnt = 0; // only one inline object allowed in a ComposedModel + int modelDiscriminators = 0; // only one discriminator allowed in a ComposedModel + for (Schema innerSchema : composed.getAllOf()) { // TODO need to work with anyOf, oneOf as well + if (m.discriminator == null && innerSchema.getDiscriminator() != null) { + LOGGER.debug("discriminator is set to null (not correctly set earlier): {}", m.name); + m.setDiscriminator(createDiscriminator(m.name, innerSchema, this.openAPI)); + if (!this.getLegacyDiscriminatorBehavior()) { + m.addDiscriminatorMappedModelsImports(); + } + modelDiscriminators++; + } + + if (innerSchema.getXml() != null) { + m.xmlPrefix = innerSchema.getXml().getPrefix(); + m.xmlNamespace = innerSchema.getXml().getNamespace(); + m.xmlName = innerSchema.getXml().getName(); + } + if (modelDiscriminators > 1) { + LOGGER.error("Allof composed schema is inheriting >1 discriminator. Only use one discriminator: {}", composed); + } + + if (modelImplCnt++ > 1) { + LOGGER.warn("More than one inline schema specified in allOf:. Only the first one is recognized. All others are ignored."); + break; // only one schema with discriminator allowed in allOf + } + } + } + + CodegenComposedSchemas cs = m.getComposedSchemas(); + if (cs != null) { + if (cs.getAllOf() != null && !cs.getAllOf().isEmpty()) { + for (CodegenProperty cp: cs.getAllOf()) { + if (cp.complexType != null) { + addImport(m, cp.complexType); + } + } + } + if (cs.getOneOf() != null && !cs.getOneOf().isEmpty()) { + for (CodegenProperty cp: cs.getOneOf()) { + if (cp.complexType != null) { + addImport(m, cp.complexType); + } + } + } + if (cs.getAnyOf() != null && !cs.getAnyOf().isEmpty()) { + for (CodegenProperty cp: cs.getAnyOf()) { + if (cp.complexType != null) { + addImport(m, cp.complexType); + } + } + } + } + } + + @Override + public ModelsMap postProcessModels(ModelsMap objs) { + // process enum in models + return postProcessModelsEnum(objs); + } + + /* + * 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. + */ + public void postProcessPattern(String pattern, Map vendorExtensions) { + if (pattern != null) { + int regexLength = pattern.length(); + String regex = pattern; + int i = pattern.lastIndexOf('/'); + if (regexLength >= 2 && pattern.charAt(0) == '/' && i != -1) { + // json schema tests do not include the leading and trailing slashes + // so I do not think that they are required + regex = pattern.substring(1, i); + } + regex = regex.replace("'", "\\'"); + List modifiers = new ArrayList(); + + if (i != -1) { + 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 apiDocFileFolder() { + return (outputFolder + "/" + apiDocPath); + } + + @Override + public String modelDocFileFolder() { + return (outputFolder + "/" + 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("(?=3.6"; }; + public String apiFileFolder() { + return outputFolder + File.separatorChar + packagePath() + File.separatorChar + apiPackage() + File.separatorChar + "tags"; + } + + @Override + public String modelFileFolder() { + return outputFolder + File.separatorChar + packagePath() + File.separatorChar + modelPackage(); + } + + @Override + public String apiTestFileFolder() { + return outputFolder + File.separatorChar + testFolder; + } + + @Override + public String modelTestFileFolder() { + return outputFolder + File.separatorChar + testFolder + File.separatorChar + "test_models"; + } + + public void setUseNose(String val) { + this.useNose = Boolean.parseBoolean(val); + } + + @Override + public boolean getUseInlineModelResolver() { return useInlineModelResolver; } + + public void setUseInlineModelResolver(String val) { + this.useInlineModelResolver = Boolean.parseBoolean(val); + } + + public void setPackageUrl(String packageUrl) { + this.packageUrl = packageUrl; + } + + public String packagePath() { + return packageName.replace('.', File.separatorChar); + } + + /** + * Generate Python package name from String `packageName` + *

    + * (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]+", "")); + } + + /** + * A custom version of this method is needed to ensure that the form object parameter is kept as-is + * as an object and is not exploded into separate parameters + * @param body the body that is being handled + * @param imports the imports for this body + * @return the list of length one containing a single type object CodegenParameter + */ + @Override + public List fromRequestBodyToFormParameters(RequestBody body, Set imports) { + List parameters = new ArrayList<>(); + LOGGER.debug("debugging fromRequestBodyToFormParameters= {}", body); + Schema schema = ModelUtils.getSchemaFromRequestBody(body); + schema = ModelUtils.getReferencedSchema(this.openAPI, schema); + CodegenParameter cp = fromFormProperty("body", schema, imports); + cp.setContent(getContent(body.getContent(), imports, "RequestBody")); + cp.isFormParam = false; + cp.isBodyParam = true; + parameters.add(cp); + return parameters; + } + + /** + * Custom version of this method so we can move the body parameter into bodyParam + * + * @param path the path of the operation + * @param httpMethod HTTP method + * @param operation OAS operation object + * @param servers list of servers + * @return the resultant CodegenOperation instance + */ + @Override + public CodegenOperation fromOperation(String path, + String httpMethod, + Operation operation, + List servers) { + CodegenOperation co = super.fromOperation(path, httpMethod, operation, servers); + co.httpMethod = httpMethod.toLowerCase(Locale.ROOT); + // smuggle the path enum variable name in operationIdLowerCase + co.operationIdLowerCase = toEnumVarName(co.path, "str"); + // smuggle pathModuleName in nickname + String pathModuleName = toVarName(path); + co.nickname = pathModuleName; + // smuggle path Api class name ins operationIdSnakeCase + co.operationIdSnakeCase = toModelName(path); + + if (co.bodyParam == null) { + for (CodegenParameter cp: co.allParams) { + if (cp.isBodyParam) { + co.bodyParam = cp; + co.bodyParams.add(cp); + } + } + } + return co; + } + + /** + * Custom version of this method to prevent mutation of + * codegenOperation.operationIdLowerCase/operationIdSnakeCase + * Property Usages: + * - operationId: endpoint method name when using tagged apis + * - httpMethod: endpoint method name when using path apis + * - operationIdCamelCase: Api class name containing single endpoint for tagged apis + * - operationIdLowerCase: (smuggled) path enum variable name + * - nickname: (smuggled) path module name for path apis + * - operationIdSnakeCase: (smuggled) path Api class name when using path apis + * + * @param tag name of the tag + * @param resourcePath path of the resource + * @param operation OAS Operation object + * @param co Codegen Operation object + * @param operations map of Codegen operations + */ + @Override + @SuppressWarnings("static-method") + public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation + co, Map> operations) { + List opList = operations.get(tag); + if (opList == null) { + opList = new ArrayList<>(); + operations.put(tag, opList); + } + // check for operationId uniqueness + String uniqueName = co.operationId; + int counter = 0; + for (CodegenOperation op : opList) { + if (uniqueName.equals(op.operationId)) { + uniqueName = co.operationId + "_" + counter; + counter++; + } + } + if (!co.operationId.equals(uniqueName)) { + LOGGER.warn("generated unique operationId `{}`", uniqueName); + } + co.operationId = uniqueName; + co.operationIdCamelCase = camelize(uniqueName); + opList.add(co); + co.baseName = tag; + } + + @Override + public String defaultTemplatingEngine() { + return "handlebars"; + } + + @Override + public String generatorLanguageVersion() { return ">=3.7"; }; + + @Override + public void preprocessOpenAPI(OpenAPI openAPI) { + String originalSpecVersion; + String xOriginalSwaggerVersion = "x-original-swagger-version"; + if (openAPI.getExtensions() != null && !openAPI.getExtensions().isEmpty() && openAPI.getExtensions().containsValue(xOriginalSwaggerVersion)) { + originalSpecVersion = (String) openAPI.getExtensions().get(xOriginalSwaggerVersion); + } else { + originalSpecVersion = openAPI.getOpenapi(); + } + Integer specMajorVersion = Integer.parseInt(originalSpecVersion.substring(0, 1)); + if (specMajorVersion < 3) { + throw new RuntimeException("Your spec version of "+originalSpecVersion+" is too low. python-experimental only works with specs with version >= 3.X.X. Please use a tool like Swagger Editor or Swagger Converter to convert your spec to v3"); + } + } + + /** + * Note: a custom version of this function is used so the original tag value can be used + * + * @param tag Tag + * @return the tag to use + */ + @Override + public String sanitizeTag(String tag) { + return tag; + } @Override - protected void addImport(ComposedSchema composed, Schema childSchema, CodegenModel model, String modelName ) { - // import everything (including child schema of a composed schema) - addImport(model, modelName); + public void postProcess() { + System.out.println("################################################################################"); + System.out.println("# Thanks for using OpenAPI Generator. #"); + System.out.println("# Please consider donation to help us maintain this project \uD83D\uDE4F #"); + System.out.println("# https://opencollective.com/openapi_generator/donate #"); + System.out.println("# #"); + System.out.println("# This generator was written by Justin Black (https://github.com/spacether) #"); + System.out.println("# Please support his work directly via https://github.com/sponsors/spacether \uD83D\uDE4F#"); + System.out.println("################################################################################"); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java deleted file mode 100644 index 391d1d823dab..000000000000 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java +++ /dev/null @@ -1,2737 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * - * 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 com.github.curiousoddman.rgxgen.RgxGen; -import com.github.curiousoddman.rgxgen.config.RgxGenOption; -import com.github.curiousoddman.rgxgen.config.RgxGenProperties; -import com.google.common.base.CaseFormat; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.PathItem; -import io.swagger.v3.oas.models.Paths; -import io.swagger.v3.oas.models.servers.Server; -import io.swagger.v3.oas.models.tags.Tag; - -import org.apache.commons.io.FileUtils; -import org.openapitools.codegen.api.TemplatePathLocator; -import org.openapitools.codegen.ignore.CodegenIgnoreProcessor; -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.templating.*; -import io.swagger.v3.core.util.Json; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.parameters.Parameter; -import io.swagger.v3.oas.models.parameters.RequestBody; -import io.swagger.v3.oas.models.security.SecurityScheme; -import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.*; -import org.openapitools.codegen.CodegenDiscriminator.MappedModel; -import org.openapitools.codegen.api.TemplatingEngineAdapter; -import org.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.meta.Stability; -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.utils.ModelUtils; -import org.openapitools.codegen.utils.ProcessUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.openapitools.codegen.api.TemplateProcessor; - -import java.io.File; -import java.io.IOException; -import java.math.BigDecimal; -import java.nio.file.Path; -import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.format.DateTimeFormatter; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -import static org.openapitools.codegen.utils.OnceLogger.once; -import static org.openapitools.codegen.utils.StringUtils.camelize; -import static org.openapitools.codegen.utils.StringUtils.underscore; - -public class PythonExperimentalClientCodegen extends AbstractPythonCodegen { - private final Logger LOGGER = LoggerFactory.getLogger(PythonExperimentalClientCodegen.class); - - public static final String PACKAGE_URL = "packageUrl"; - public static final String DEFAULT_LIBRARY = "urllib3"; - // nose is a python testing framework, we use pytest if USE_NOSE is unset - public static final String USE_NOSE = "useNose"; - public static final String RECURSION_LIMIT = "recursionLimit"; - public static final String USE_INLINE_MODEL_RESOLVER = "useInlineModelResolver"; - - protected String packageUrl; - protected String apiDocPath = "docs/apis/tags/"; - protected String modelDocPath = "docs/models/"; - protected boolean useNose = false; - protected boolean useInlineModelResolver = false; - - protected Map regexModifiers; - - private String testFolder; - - // A cache to efficiently lookup a Schema instance based on the return value of `toModelName()`. - private Map modelNameToSchemaCache; - private DateTimeFormatter iso8601Date = DateTimeFormatter.ISO_DATE; - private DateTimeFormatter iso8601DateTime = DateTimeFormatter.ISO_DATE_TIME; - - private String templateExtension; - protected CodegenIgnoreProcessor ignoreProcessor; - protected TemplateProcessor templateProcessor = null; - - // for apis.tags imports - private Map tagModuleNameToApiClassname = new LinkedHashMap<>(); - // for apis.tags enum tag definition - private Map enumToTag = new LinkedHashMap<>(); - // for apis.tags tag api definition - private Map tagEnumToApiClassname = new LinkedHashMap<>(); - - public PythonExperimentalClientCodegen() { - super(); - loadDeepObjectIntoItems = false; - importBaseType = false; - addSchemaImportsFromV3SpecLocations = true; - sortModelPropertiesByRequiredFlag = Boolean.TRUE; - sortParamsByRequiredFlag = Boolean.TRUE; - addSuffixToDuplicateOperationNicknames = false; - - modifyFeatureSet(features -> features - .includeSchemaSupportFeatures( - SchemaSupportFeature.Simple, - SchemaSupportFeature.Composite, - SchemaSupportFeature.Polymorphism, - SchemaSupportFeature.Union, - SchemaSupportFeature.allOf, - SchemaSupportFeature.anyOf, - SchemaSupportFeature.oneOf, - SchemaSupportFeature.not - ) - .includeDocumentationFeatures(DocumentationFeature.Readme) - .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.Custom)) - .securityFeatures(EnumSet.of( - SecurityFeature.BasicAuth, - SecurityFeature.BearerToken, - SecurityFeature.ApiKey, - SecurityFeature.OAuth2_Implicit - )) - .includeDataTypeFeatures( - DataTypeFeature.Null, - DataTypeFeature.AnyType, - DataTypeFeature.Uuid - ) - .includeGlobalFeatures( - GlobalFeature.ParameterizedServer, - GlobalFeature.ParameterStyling - ) - .excludeGlobalFeatures( - GlobalFeature.XMLStructureDefinitions, - GlobalFeature.Callbacks, - GlobalFeature.LinkObjects - ) - .excludeSchemaSupportFeatures( - ) - .excludeParameterFeatures( - ParameterFeature.Cookie - ) - ); - - // clear import mapping (from default generator) as python does not use it - // at the moment - importMapping.clear(); - - modelPackage = "model"; - apiPackage = "apis"; - outputFolder = "generated-code" + File.separatorChar + "python"; - - embeddedTemplateDir = templateDir = "python-experimental"; - - 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( - // local variable name used in API methods (endpoints) - "all_params", "resource_path", "path_params", "query_params", - "header_params", "form_params", "local_var_files", "body_params", "auth_settings", - // @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", - // types - "float", "int", "str", "bool", "none_type", "dict", "frozendict", "list", "tuple", "file_type")); - - 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.")); - // this generator does not use SORT_PARAMS_BY_REQUIRED_FLAG - // this generator uses the following order for endpoint paramters and model properties - // required params - // optional params which are set to unset as their default for method signatures only - // optional params as **kwargs - 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(CliOption.newBoolean(USE_NOSE, "use the nose test framework"). - defaultValue(Boolean.FALSE.toString())); - cliOptions.add(new CliOption(RECURSION_LIMIT, "Set the recursion limit. If not set, use the system default value.")); - cliOptions.add(CliOption.newBoolean(USE_INLINE_MODEL_RESOLVER, "use the inline model resolver, if true inline complex models will be extracted into components and $refs to them will be used"). - defaultValue(Boolean.FALSE.toString())); - - supportedLibraries.put("urllib3", "urllib3-based client"); - CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use: urllib3"); - libraryOption.setDefault(DEFAULT_LIBRARY); - cliOptions.add(libraryOption); - setLibrary(DEFAULT_LIBRARY); - - // Composed schemas can have the 'additionalProperties' keyword, as specified in JSON schema. - // In principle, this should be enabled by default for all code generators. However due to limitations - // in other code generators, support needs to be enabled on a case-by-case basis. - supportsAdditionalPropertiesWithComposedSchema = true; - - // When the 'additionalProperties' keyword is not present in a OAS schema, allow - // undeclared properties. This is compliant with the JSON schema specification. - this.setDisallowAdditionalPropertiesIfNotPresent(false); - - // this may set datatype right for additional properties - instantiationTypes.put("map", "dict"); - - languageSpecificPrimitives.add("file_type"); - languageSpecificPrimitives.add("none_type"); - typeMapping.put("decimal", "str"); - - generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) - .stability(Stability.EXPERIMENTAL) - .build(); - } - - @Override - public void processOpts() { - this.setLegacyDiscriminatorBehavior(false); - - super.processOpts(); - - TemplatingEngineAdapter te = getTemplatingEngine(); - if (te instanceof HandlebarsEngineAdapter) { - HandlebarsEngineAdapter hea = (HandlebarsEngineAdapter) te; - hea.infiniteLoops(true); - hea.setPrettyPrint(true); - } else { - throw new RuntimeException("Only the HandlebarsEngineAdapter is supported for this generator"); - } - - TemplatePathLocator commonTemplateLocator = new CommonTemplateContentLocator(); - TemplatePathLocator generatorTemplateLocator = new GeneratorTemplateContentLocator(this); - TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(this.isEnableMinimalUpdate(),this.isSkipOverwrite()); - templateProcessor = new TemplateManager( - templateManagerOptions, - te, - new TemplatePathLocator[]{generatorTemplateLocator, commonTemplateLocator} - ); - templateExtension = te.getIdentifier(); - - String ignoreFileLocation = this.getIgnoreFilePathOverride(); - if (ignoreFileLocation != null) { - final File ignoreFile = new File(ignoreFileLocation); - if (ignoreFile.exists() && ignoreFile.canRead()) { - this.ignoreProcessor = new CodegenIgnoreProcessor(ignoreFile); - } else { - LOGGER.warn("Ignore file specified at {} is not valid. This will fall back to an existing ignore file if present in the output directory.", ignoreFileLocation); - } - } - - if (this.ignoreProcessor == null) { - this.ignoreProcessor = new CodegenIgnoreProcessor(this.getOutputDir()); - } - - modelTemplateFiles.put("model." + templateExtension, ".py"); - /* - This stub file exists to allow pycharm to read and use typing.overload decorators for it to see that - dict_instance["someProp"] is of type SomeClass.properties.someProp - See https://youtrack.jetbrains.com/issue/PY-42137/PyCharm-type-hinting-doesnt-work-well-with-overload-decorator - */ - modelTemplateFiles.put("model_stub." + templateExtension, ".pyi"); - apiTemplateFiles.put("api." + templateExtension, ".py"); - modelTestTemplateFiles.put("model_test." + templateExtension, ".py"); - modelDocTemplateFiles.put("model_doc." + templateExtension, ".md"); - apiDocTemplateFiles.put("api_doc." + templateExtension, ".md"); - - 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 docs in /docs/apis/tags/ - apiDocPath = packagePath() + File.separatorChar + apiDocPath; - // model docs in /docs/models/ - modelDocPath = packagePath() + File.separatorChar + modelDocPath; - } - // make api and model doc path available in templates - additionalProperties.put("apiDocPath", apiDocPath); - additionalProperties.put("modelDocPath", modelDocPath); - - if (additionalProperties.containsKey(PACKAGE_URL)) { - setPackageUrl((String) additionalProperties.get(PACKAGE_URL)); - } - - if (additionalProperties.containsKey(USE_NOSE)) { - setUseNose((String) additionalProperties.get(USE_NOSE)); - } - - if (additionalProperties.containsKey(USE_INLINE_MODEL_RESOLVER)) { - setUseInlineModelResolver((String) additionalProperties.get(USE_INLINE_MODEL_RESOLVER)); - } - - // 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."); - } - } - - String readmePath = "README.md"; - String readmeTemplate = "README." + templateExtension; - if (generateSourceCodeOnly) { - readmePath = packagePath() + "_" + readmePath; - readmeTemplate = "README_onlypackage." + templateExtension; - } - supportingFiles.add(new SupportingFile(readmeTemplate, "", readmePath)); - - if (!generateSourceCodeOnly) { - supportingFiles.add(new SupportingFile("tox." + templateExtension, "", "tox.ini")); - supportingFiles.add(new SupportingFile("test-requirements." + templateExtension, "", "test-requirements.txt")); - supportingFiles.add(new SupportingFile("requirements." + templateExtension, "", "requirements.txt")); - supportingFiles.add(new SupportingFile("setup_cfg." + templateExtension, "", "setup.cfg")); - - supportingFiles.add(new SupportingFile("git_push.sh." + templateExtension, "", "git_push.sh")); - supportingFiles.add(new SupportingFile("gitignore." + templateExtension, "", ".gitignore")); - supportingFiles.add(new SupportingFile("travis." + templateExtension, "", ".travis.yml")); - supportingFiles.add(new SupportingFile("gitlab-ci." + templateExtension, "", ".gitlab-ci.yml")); - supportingFiles.add(new SupportingFile("setup." + templateExtension, "", "setup.py")); - } - supportingFiles.add(new SupportingFile("configuration." + templateExtension, packagePath(), "configuration.py")); - supportingFiles.add(new SupportingFile("__init__package." + templateExtension, packagePath(), "__init__.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__." + templateExtension, currentPackagePath, "__init__.py")); - } - - supportingFiles.add(new SupportingFile("exceptions." + templateExtension, packagePath(), "exceptions.py")); - - if (Boolean.FALSE.equals(excludeTests)) { - supportingFiles.add(new SupportingFile("__init__." + templateExtension, testFolder, "__init__.py")); - supportingFiles.add(new SupportingFile("__init__." + templateExtension, testFolder + File.separator + "test_models", "__init__.py")); - } - - supportingFiles.add(new SupportingFile("api_client." + templateExtension, packagePath(), "api_client.py")); - - if ("asyncio".equals(getLibrary())) { - supportingFiles.add(new SupportingFile("asyncio/rest." + templateExtension, packagePath(), "rest.py")); - additionalProperties.put("asyncio", "true"); - } else if ("tornado".equals(getLibrary())) { - supportingFiles.add(new SupportingFile("tornado/rest." + templateExtension, packagePath(), "rest.py")); - additionalProperties.put("tornado", "true"); - } else { - supportingFiles.add(new SupportingFile("rest." + templateExtension, packagePath(), "rest.py")); - } - - supportingFiles.add(new SupportingFile("schemas." + templateExtension, packagePath(), "schemas.py")); - - // add the models and apis folders - supportingFiles.add(new SupportingFile("__init__models." + templateExtension, packagePath() + File.separatorChar + "models", "__init__.py")); - supportingFiles.add(new SupportingFile("__init__model." + templateExtension, packagePath() + File.separatorChar + modelPackage, "__init__.py")); - supportingFiles.add(new SupportingFile("__init__apis." + templateExtension, packagePath() + File.separatorChar + apiPackage, "__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." + templateExtension, packagePath(), "signing.py")); - } - - // default this to true so the python ModelSimple models will be generated - ModelUtils.setGenerateAliasAsModel(true); - LOGGER.info(CodegenConstants.GENERATE_ALIAS_AS_MODEL + " is hard coded to true in this generator. Alias models will only be generated if they contain validations or enums"); - - // check library option to ensure only urllib3 is supported - if (!DEFAULT_LIBRARY.equals(getLibrary())) { - throw new RuntimeException("Only the `urllib3` library is supported in the refactored `python` client generator at the moment. Please fall back to `python-legacy` client generator for the time being. We welcome contributions to add back `asyncio`, `tornado` support to the `python` client generator."); - } - } - - public String packageFilename(List pathSegments) { - String prefix = outputFolder + File.separatorChar + packagePath() + File.separatorChar; - String suffix = pathSegments.stream().collect(Collectors.joining(File.separator)); - return prefix + suffix; - } - - public String filenameFromRoot(List pathSegments) { - String prefix = outputFolder + File.separatorChar; - String suffix = pathSegments.stream().collect(Collectors.joining(File.separator)); - return prefix + suffix; - } - - protected File processTemplateToFile(Map templateData, String templateName, String outputFilename, boolean shouldGenerate, String skippedByOption) throws IOException { - String adjustedOutputFilename = outputFilename.replaceAll("//", "/").replace('/', File.separatorChar); - File target = new File(adjustedOutputFilename); - if (ignoreProcessor.allowsFile(target)) { - if (shouldGenerate) { - Path outDir = java.nio.file.Paths.get(this.getOutputDir()).toAbsolutePath(); - Path absoluteTarget = target.toPath().toAbsolutePath(); - if (!absoluteTarget.startsWith(outDir)) { - throw new RuntimeException(String.format(Locale.ROOT, "Target files must be generated within the output directory; absoluteTarget=%s outDir=%s", absoluteTarget, outDir)); - } - return this.templateProcessor.write(templateData,templateName, target); - } else { - this.templateProcessor.skip(target.toPath(), String.format(Locale.ROOT, "Skipped by %s options supplied by user.", skippedByOption)); - return null; - } - } else { - this.templateProcessor.ignore(target.toPath(), "Ignored by rule in ignore file."); - return null; - } - } - - @Override - public String apiFilename(String templateName, String tag) { - String suffix = apiTemplateFiles().get(templateName); - return apiFileFolder() + File.separator + toApiFilename(tag) + suffix; - } - - private void generateFiles(List> processTemplateToFileInfos, String skippedByOption) { - for (List processTemplateToFileInfo: processTemplateToFileInfos) { - Map templateData = (Map) processTemplateToFileInfo.get(0); - String templateName = (String) processTemplateToFileInfo.get(1); - String outputFilename = (String) processTemplateToFileInfo.get(2); - try { - processTemplateToFile(templateData, templateName, outputFilename, true, skippedByOption); - } catch (IOException e) { - LOGGER.error("Error when writing template file {}", e.toString()); - } - } - } - - @Override - public String toApiName(String name) { - if (name.length() == 0) { - return "DefaultApi"; - } - return toModelName(name) + apiNameSuffix; - } - - /* - I made this method because endpoint parameters not contain a lot of needed metadata - It is very verbose to write all of this info into the api template - This ingests all operations under a tag in the objs input and writes out one file for each endpoint - */ - protected void generateEndpoints(OperationsMap objs) { - if (!(Boolean) additionalProperties.get(CodegenConstants.GENERATE_APIS)) { - return; - } - Paths paths = openAPI.getPaths(); - if (paths == null) { - return; - } - List> pathsFiles = new ArrayList<>(); - List> apisFiles = new ArrayList<>(); - List> testFiles = new ArrayList<>(); - String outputFilename; - - // endpoint tags may not exist in the root of the spec file - // this is allowed per openapi - // because spec tags may be empty ro incomplete, tags are also accumulated from endpoints - List tags = openAPI.getTags(); - if (tags != null) { - for (Tag tag: tags) { - String tagName = tag.getName(); - String tagModuleName = toApiFilename(tagName); - String apiClassname = toApiName(tagName); - tagModuleNameToApiClassname.put(tagModuleName, apiClassname); - String tagEnum = toEnumVarName(tagName, "str"); - enumToTag.put(tagEnum, tagName); - tagEnumToApiClassname.put(tagEnum, apiClassname); - } - } - - OperationMap operations = objs.getOperations(); - List codegenOperations = operations.getOperation(); - HashMap pathModuleToPath = new HashMap<>(); - // paths.some_path.post.py (single endpoint definition) - for (CodegenOperation co: codegenOperations) { - if (co.tags != null) { - for (Tag tag: co.tags) { - String tagName = tag.getName(); - String tagModuleName = toApiFilename(tagName); - String apiClassname = toApiName(tagName); - tagModuleNameToApiClassname.put(tagModuleName, apiClassname); - String tagEnum = toEnumVarName(tagName, "str"); - enumToTag.put(tagEnum, tagName); - tagEnumToApiClassname.put(tagEnum, apiClassname); - } - } - String path = co.path; - String pathModuleName = co.nickname; - if (!pathModuleToPath.containsKey(pathModuleName)) { - pathModuleToPath.put(pathModuleName, path); - } - Map endpointMap = new HashMap<>(); - endpointMap.put("operation", co); - endpointMap.put("imports", co.imports); - endpointMap.put("packageName", packageName); - outputFilename = packageFilename(Arrays.asList("paths", pathModuleName, co.httpMethod + ".py")); - pathsFiles.add(Arrays.asList(endpointMap, "endpoint.handlebars", outputFilename)); - /* - This stub file exists to allow pycharm to read and use typing.overload decorators for it to see that - dict_instance["someProp"] is of type SomeClass.properties.someProp - See https://youtrack.jetbrains.com/issue/PY-42137/PyCharm-type-hinting-doesnt-work-well-with-overload-decorator - */ - String stubOutputFilename = packageFilename(Arrays.asList("paths", pathModuleName, co.httpMethod + ".pyi")); - pathsFiles.add(Arrays.asList(endpointMap, "endpoint_stub.handlebars", stubOutputFilename)); - - Map endpointTestMap = new HashMap<>(); - endpointTestMap.put("operation", co); - endpointTestMap.put("packageName", packageName); - outputFilename = filenameFromRoot(Arrays.asList("test", "test_paths", "test_" + pathModuleName, "test_" + co.httpMethod + ".py")); - testFiles.add(Arrays.asList(endpointTestMap, "api_test.handlebars", outputFilename)); - outputFilename = filenameFromRoot(Arrays.asList("test", "test_paths", "test_" + pathModuleName, "__init__.py")); - testFiles.add(Arrays.asList(new HashMap<>(), "__init__.handlebars", outputFilename)); - } - outputFilename = filenameFromRoot(Arrays.asList("test", "test_paths", "__init__.py")); - testFiles.add(Arrays.asList(new HashMap<>(), "__init__test_paths.handlebars", outputFilename)); - - Map pathValToVar = new LinkedHashMap<>(); - Map pathModuleToApiClassname = new LinkedHashMap<>(); - Map pathEnumToApiClassname = new LinkedHashMap<>(); - for (Map.Entry pathsEntry : paths.entrySet()) { - String path = pathsEntry.getKey(); - String pathEnumVar = toEnumVarName(path, "str"); - pathValToVar.put(path, pathEnumVar); - String apiClassName = toModelName(path); - pathEnumToApiClassname.put(pathEnumVar, apiClassName); - pathModuleToApiClassname.put(toVarName(path), apiClassName); - } - // Note: __init__apis.handlebars is generated as a supporting file - // apis.tag_to_api.py - Map tagToApiMap = new HashMap<>(); - tagToApiMap.put("packageName", packageName); - tagToApiMap.put("apiClassname", "Api"); - tagToApiMap.put("tagModuleNameToApiClassname", tagModuleNameToApiClassname); - tagToApiMap.put("tagEnumToApiClassname", tagEnumToApiClassname); - outputFilename = packageFilename(Arrays.asList("apis", "tag_to_api.py")); - apisFiles.add(Arrays.asList(tagToApiMap, "apis_tag_to_api.handlebars", outputFilename)); - // apis.path_to_api.py - Map allByPathsFileMap = new HashMap<>(); - allByPathsFileMap.put("packageName", packageName); - allByPathsFileMap.put("apiClassname", "Api"); - allByPathsFileMap.put("pathModuleToApiClassname", pathModuleToApiClassname); - allByPathsFileMap.put("pathEnumToApiClassname", pathEnumToApiClassname); - outputFilename = packageFilename(Arrays.asList("apis", "path_to_api.py")); - apisFiles.add(Arrays.asList(allByPathsFileMap, "apis_path_to_api.handlebars", outputFilename)); - // apis.paths.__init__.py - Map initApiTagsMap = new HashMap<>(); - initApiTagsMap.put("packageName", packageName); - initApiTagsMap.put("enumToTag", enumToTag); - outputFilename = packageFilename(Arrays.asList("apis", "tags", "__init__.py")); - apisFiles.add(Arrays.asList(initApiTagsMap, "__init__apis_tags.handlebars", outputFilename)); - - // paths.__init__.py (contains path str enum) - Map initOperationMap = new HashMap<>(); - initOperationMap.put("packageName", packageName); - initOperationMap.put("apiClassname", "Api"); - initOperationMap.put("pathValToVar", pathValToVar); - outputFilename = packageFilename(Arrays.asList("paths", "__init__.py")); - pathsFiles.add(Arrays.asList(initOperationMap, "__init__paths_enum.handlebars", outputFilename)); - // apis.paths.__init__.py - outputFilename = packageFilename(Arrays.asList("apis", "paths", "__init__.py")); - apisFiles.add(Arrays.asList(initOperationMap, "__init__paths.handlebars", outputFilename)); - // paths.some_path.__init__.py - // apis.paths.some_path.py - for (Map.Entry entry: pathModuleToPath.entrySet()) { - String pathModule = entry.getKey(); - String path = entry.getValue(); - String pathVar = pathValToVar.get(path); - Map pathApiMap = new HashMap<>(); - pathApiMap.put("packageName", packageName); - pathApiMap.put("pathModule", pathModule); - pathApiMap.put("apiClassName", "Api"); - pathApiMap.put("pathVar", pathVar); - outputFilename = packageFilename(Arrays.asList("paths", pathModule, "__init__.py")); - pathsFiles.add(Arrays.asList(pathApiMap, "__init__paths_x.handlebars", outputFilename)); - - PathItem pi = openAPI.getPaths().get(path); - String apiClassName = pathEnumToApiClassname.get(pathVar); - Map operationMap = new HashMap<>(); - operationMap.put("packageName", packageName); - operationMap.put("pathModule", pathModule); - operationMap.put("apiClassName", apiClassName); - operationMap.put("pathItem", pi); - outputFilename = packageFilename(Arrays.asList("apis", "paths", pathModule + ".py")); - apisFiles.add(Arrays.asList(operationMap, "apis_path_module.handlebars", outputFilename)); - } - generateFiles(pathsFiles, CodegenConstants.APIS); - generateFiles(apisFiles, CodegenConstants.APIS); - generateFiles(testFiles, CodegenConstants.API_TESTS); - } - - /* - We have a custom version of this method so for composed schemas and object schemas we add properties only if they - are defined in that schema (x.properties). We do this because validation should be done independently in each schema - If properties are hosted into composed schemas, they can collide or incorrectly list themself as required when - they are not. - */ - @Override - protected void addVarsRequiredVarsAdditionalProps(Schema schema, IJsonSchemaValidationProperties property){ - setAddProps(schema, property); - if (ModelUtils.isAnyType(schema) && supportsAdditionalPropertiesWithComposedSchema) { - // if anyType schema has properties then add them - if (schema.getProperties() != null && !schema.getProperties().isEmpty()) { - if (schema instanceof ComposedSchema) { - ComposedSchema cs = (ComposedSchema) schema; - if (cs.getOneOf() != null && !cs.getOneOf().isEmpty()) { - LOGGER.warn("'oneOf' is intended to include only the additional optional OAS extension discriminator object. " + - "For more details, see https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.9.2.1.3 and the OAS section on 'Composition and Inheritance'."); - } - } - HashSet requiredVars = new HashSet<>(); - if (schema.getRequired() != null) { - requiredVars.addAll(schema.getRequired()); - } - addVars(property, property.getVars(), schema.getProperties(), requiredVars); - } - addRequiredVarsMap(schema, property); - return; - } else if (ModelUtils.isTypeObjectSchema(schema)) { - HashSet requiredVars = new HashSet<>(); - if (schema.getRequired() != null) { - requiredVars.addAll(schema.getRequired()); - property.setHasRequired(true); - } - addVars(property, property.getVars(), schema.getProperties(), requiredVars); - if (property.getVars() != null && !property.getVars().isEmpty()) { - property.setHasVars(true); - } - } - addRequiredVarsMap(schema, property); - return; - } - - /** - * Configures a friendly name for the generator. This will be used by the - * generator to select the library with the -g flag. - * - * @return the friendly name for the generator - */ - @Override - public String getName() { - return "python-experimental"; - } - - @Override - public String getHelp() { - String newLine = System.getProperty("line.separator"); - return String.join("
    ", - "Generates a Python client library", - "", - "Features in this generator:", - "- type hints on endpoints and model creation", - "- model parameter names use the spec defined keys and cases", - "- robust composition (oneOf/anyOf/allOf/not) where payload data is stored in one instance only", - "- endpoint parameter names use the spec defined keys and cases", - "- inline schemas are supported at any location including composition", - "- multiple content types supported in request body and response bodies", - "- run time type checking", - "- Sending/receiving decimals as strings supported with type:string format: number -> DecimalSchema", - "- Sending/receiving uuids as strings supported with type:string format: uuid -> UUIDSchema", - "- quicker load time for python modules (a single endpoint can be imported and used without loading others)", - "- all instances of schemas dynamically inherit from all matching schemas so one can use isinstance to check if validation passed", - "- composed schemas with type constraints supported (type:object + oneOf/anyOf/allOf)", - "- schemas are not coerced/cast. For example string + date are both stored as string, and there is a date accessor", - " - Exceptions: int/float is stored as Decimal, When receiving data from headers it will start as str and may need to be cast for example to int"); - } - - @Override - public Schema unaliasSchema(Schema schema) { - Map allSchemas = ModelUtils.getSchemas(openAPI); - if (allSchemas == null || allSchemas.isEmpty()) { - // skip the warning as the spec can have no model defined - //LOGGER.warn("allSchemas cannot be null/empty in unaliasSchema. Returned 'schema'"); - return schema; - } - - if (schema != null && StringUtils.isNotEmpty(schema.get$ref())) { - String simpleRef = ModelUtils.getSimpleRef(schema.get$ref()); - if (schemaMapping.containsKey(simpleRef)) { - LOGGER.debug("Schema unaliasing of {} omitted because aliased class is to be mapped to {}", simpleRef, schemaMapping.get(simpleRef)); - return schema; - } - Schema ref = allSchemas.get(simpleRef); - if (ref == null) { - once(LOGGER).warn("{} is not defined", schema.get$ref()); - return schema; - } else if (ref.getEnum() != null && !ref.getEnum().isEmpty()) { - // top-level enum class - return schema; - } else if (ModelUtils.isArraySchema(ref)) { - if (ModelUtils.isGenerateAliasAsModel(ref)) { - return schema; // generate a model extending array - } else { - return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); - } - } else if (ModelUtils.isComposedSchema(ref)) { - return schema; - } else if (ModelUtils.isMapSchema(ref)) { - if (ref.getProperties() != null && !ref.getProperties().isEmpty()) // has at least one property - return schema; // treat it as model - else { - if (ModelUtils.isGenerateAliasAsModel(ref)) { - return schema; // generate a model extending map - } else { - // treat it as a typical map - return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); - } - } - } else if (ModelUtils.isObjectSchema(ref)) { // model - if (ref.getProperties() != null && !ref.getProperties().isEmpty()) { // has at least one property - return schema; - } else { - // free form object (type: object) - if (ModelUtils.hasValidation(ref)) { - return schema; - } else if (getAllOfDescendants(simpleRef, openAPI).size() > 0) { - return schema; - } - return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); - } - } else if (ModelUtils.hasValidation(ref)) { - // non object non array non map schemas that have validations - // are returned so we can generate those schemas as models - // we do this to: - // - preserve the validations in that model class in python - // - use those validations when we use this schema in composed oneOf schemas - return schema; - } else if (Boolean.TRUE.equals(ref.getNullable()) && ref.getEnum() == null) { - // non enum primitive with nullable True - // we make these models so instances of this will be subclasses of this model - return schema; - } else { - return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); - } - } - return schema; - } - - public String pythonDate(Object dateValue) { - String strValue = null; - if (dateValue instanceof OffsetDateTime) { - OffsetDateTime date = null; - try { - date = (OffsetDateTime) dateValue; - } catch (ClassCastException e) { - LOGGER.warn("Invalid `date` format for value {}", dateValue.toString()); - date = ((Date) dateValue).toInstant().atOffset(ZoneOffset.UTC); - } - strValue = date.format(iso8601Date); - } else { - strValue = dateValue.toString(); - } - return strValue; - } - - public String pythonDateTime(Object dateTimeValue) { - String strValue = null; - if (dateTimeValue instanceof OffsetDateTime) { - OffsetDateTime dateTime = null; - try { - dateTime = (OffsetDateTime) dateTimeValue; - } catch (ClassCastException e) { - LOGGER.warn("Invalid `date-time` format for value {}", dateTimeValue.toString()); - dateTime = ((Date) dateTimeValue).toInstant().atOffset(ZoneOffset.UTC); - } - strValue = dateTime.format(iso8601DateTime); - } else { - strValue = dateTimeValue.toString(); - } - return strValue; - } - - /** - * Return the default value of the property - * - * @param p OpenAPI property object - * @return string presentation of the default value of the property - */ - @Override - public String toDefaultValue(Schema p) { - Object defaultObject = null; - if (p.getDefault() != null) { - defaultObject = p.getDefault(); - } - - if (defaultObject == null) { - return null; - } - - String defaultValue = defaultObject.toString(); - if (ModelUtils.isDateSchema(p)) { - defaultValue = pythonDate(defaultObject); - } else if (ModelUtils.isDateTimeSchema(p)) { - defaultValue = pythonDateTime(defaultObject); - } else if (ModelUtils.isStringSchema(p) && !ModelUtils.isByteArraySchema(p) && !ModelUtils.isBinarySchema(p) && !ModelUtils.isFileSchema(p) && !ModelUtils.isUUIDSchema(p) && !ModelUtils.isEmailSchema(p)) { - defaultValue = ensureQuotes(defaultValue); - } else if (ModelUtils.isBooleanSchema(p)) { - if (Boolean.valueOf(defaultValue) == false) { - defaultValue = "False"; - } else { - defaultValue = "True"; - } - } - return defaultValue; - } - - @Override - public String toModelImport(String name) { - // name looks like Cat - return "from " + packagePath() + "." + modelPackage() + "." + toModelFilename(name) + " import " + toModelName(name); - } - - @Override - @SuppressWarnings("static-method") - public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { - // fix the imports that each model has, add the module reference to the model - // loops through imports and converts them all - // from 'Pet' to 'from petstore_api.model.pet import Pet' - - OperationMap val = objs.getOperations(); - List operations = val.getOperation(); - for (CodegenOperation operation : operations) { - if (operation.imports.size() == 0) { - continue; - } - String[] modelNames = operation.imports.toArray(new String[0]); - operation.imports.clear(); - for (String modelName : modelNames) { - operation.imports.add(toModelImport(modelName)); - } - } - generateEndpoints(objs); - return objs; - } - - /*** - * Override with special post-processing for all models. - * we have a custom version of this method to: - * - remove any primitive models that do not contain validations - * these models are unaliased as inline definitions wherever the spec has them as refs - * this means that the generated client does not use these models - * because they are not used we do not write them - * - fix the model imports, go from model name to the full import string with toModelImport + globalImportFixer - * Also cleans the test folder if test cases exist and the testFolder is set because the tests are autogenerated - * - * @param objs a map going from the model name to a object hoding the model info - * @return the updated objs - */ - @Override - public Map postProcessAllModels(Map objs) { - super.postProcessAllModels(objs); - - boolean anyModelContainsTestCases = false; - Map allDefinitions = ModelUtils.getSchemas(this.openAPI); - for (String schemaName : allDefinitions.keySet()) { - String modelName = toModelName(schemaName); - ModelsMap objModel = objs.get(modelName); - if (objModel == null) { - // to avoid form parameter's models that are not generated (skipFormModel=true) - continue; - } - for (ModelMap model : objModel.getModels()) { - CodegenModel cm = model.getModel(); - if (cm.testCases != null && !cm.testCases.isEmpty()) { - anyModelContainsTestCases = true; - } - String[] importModelNames = cm.imports.toArray(new String[0]); - cm.imports.clear(); - for (String importModelName : importModelNames) { - cm.imports.add(toModelImport(importModelName)); - } - } - } - boolean testFolderSet = testFolder != null; - if (testFolderSet && anyModelContainsTestCases) { - // delete the test folder because tests there will be autogenerated - String testPath = outputFolder + File.separatorChar + testFolder; - File testDirectory = new File(testPath); - try { - FileUtils.cleanDirectory(testDirectory); - } catch (IOException e) { - LOGGER.info("Unable to delete the test folder because of exception=" + e.toString()); - } - - } - - return objs; - } - - public CodegenParameter fromParameter(Parameter parameter, Set imports) { - CodegenParameter cp = super.fromParameter(parameter, imports); - if (parameter.getStyle() != null) { - switch(parameter.getStyle()) { - case MATRIX: - cp.style = "MATRIX"; - break; - case LABEL: - cp.style = "LABEL"; - break; - case FORM: - cp.style = "FORM"; - break; - case SIMPLE: - cp.style = "SIMPLE"; - break; - case SPACEDELIMITED: - cp.style = "SPACE_DELIMITED"; - break; - case PIPEDELIMITED: - cp.style = "PIPE_DELIMITED"; - break; - case DEEPOBJECT: - cp.style = "DEEP_OBJECT"; - break; - } - } - // clone this so we can change some properties on it - CodegenProperty schemaProp = cp.getSchema().clone(); - // parameters may have valid python names like some_val or invalid ones like Content-Type - // we always set nameInSnakeCase to null so special handling will not be done for these names - // invalid python names will be handled in python by using a TypedDict which will allow us to have a type hint - // for keys that cannot be variable names to the schema baseName - if (schemaProp != null) { - schemaProp.nameInSnakeCase = null; - schemaProp.baseName = toModelName(cp.baseName) + "Schema"; - cp.setSchema(schemaProp); - } - return cp; - } - - private boolean isValidPythonVarOrClassName(String name) { - return name.matches("^[_a-zA-Z][_a-zA-Z0-9]*$"); - } - - - /** - * Convert OAS Property object to Codegen Property object - * We have a custom version of this method to always set allowableValues.enumVars on all enum variables - * Together with unaliasSchema this sets primitive types with validations as models - * This method is used by fromResponse - * - * @param name name of the property - * @param p OAS property schema - * @param required true if the property is required in the next higher object schema, false otherwise - * @param schemaIsFromAdditionalProperties true if the property is defined by additional properties schema - * @return Codegen Property object - */ - @Override - public CodegenProperty fromProperty(String name, Schema p, boolean required, boolean schemaIsFromAdditionalProperties) { - // fix needed for values with /n /t etc in them - String fixedName = handleSpecialCharacters(name); - CodegenProperty cp = super.fromProperty(fixedName, p, required, schemaIsFromAdditionalProperties); - - if (cp.isAnyType && cp.isNullable) { - cp.isNullable = false; - } - if (cp.isNullable && cp.complexType == null) { - cp.setIsNull(true); - cp.isNullable = false; - cp.setHasMultipleTypes(true); - } - postProcessPattern(cp.pattern, cp.vendorExtensions); - // if we have a property that has a difficult name, either: - // 1. name is reserved, like class int float - // 2. name is invalid in python like '3rd' or 'Content-Type' - // set cp.nameInSnakeCase to a value so we can tell that we are in this use case - // we handle this in the schema templates - // templates use its presence to handle these badly named variables / keys - if ((isReservedWord(cp.baseName) || !isValidPythonVarOrClassName(cp.baseName)) && !cp.baseName.equals(cp.name)) { - cp.nameInSnakeCase = cp.name; - } else { - cp.nameInSnakeCase = null; - } - if (cp.isEnum) { - updateCodegenPropertyEnum(cp); - } - Schema unaliasedSchema = unaliasSchema(p); - if (cp.isPrimitiveType && unaliasedSchema.get$ref() != null) { - cp.complexType = cp.dataType; - } - setAdditionalPropsAndItemsVarNames(cp); - return cp; - } - - private void setAdditionalPropsAndItemsVarNames(IJsonSchemaValidationProperties item) { - if (item.getAdditionalProperties() != null) { - item.getAdditionalProperties().setBaseName("additional_properties"); - } - if (item.getItems() != null) { - item.getItems().setBaseName("items"); - } - } - - /** - * 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); - } - - /** - * Update codegen property's enum by adding "enumVars" (with name and value) - * - * @param var list of CodegenProperty - */ - @Override - public void updateCodegenPropertyEnum(CodegenProperty var) { - // we have a custom version of this method to omit overwriting the defaultValue - Map allowableValues = var.allowableValues; - - // handle array - if (var.mostInnerItems != null) { - allowableValues = var.mostInnerItems.allowableValues; - } - - if (allowableValues == null) { - return; - } - - List values = (List) allowableValues.get("values"); - if (values == null) { - return; - } - - String varDataType = var.mostInnerItems != null ? var.mostInnerItems.dataType : var.dataType; - Schema referencedSchema = getModelNameToSchemaCache().get(varDataType); - String dataType = (referencedSchema != null) ? getTypeDeclaration(referencedSchema) : varDataType; - - // put "enumVars" map into `allowableValues", including `name` and `value` - List> enumVars = buildEnumVars(values, dataType); - - // if "x-enum-varnames" or "x-enum-descriptions" defined, update varnames - Map extensions = var.mostInnerItems != null ? var.mostInnerItems.getVendorExtensions() : var.getVendorExtensions(); - if (referencedSchema != null) { - extensions = referencedSchema.getExtensions(); - } - updateEnumVarsWithExtensions(enumVars, extensions, dataType); - allowableValues.put("enumVars", enumVars); - // overwriting defaultValue omitted from here - } - - /*** - * We have a custom version of this method to produce links to models when they are - * primitive type (not map, not array, not object) and include validations or are enums - * - * @param body requesst body - * @param imports import collection - * @param bodyParameterName body parameter name - * @return the resultant CodegenParameter - */ - @Override - public CodegenParameter fromRequestBody(RequestBody body, Set imports, String bodyParameterName) { - CodegenParameter cp = super.fromRequestBody(body, imports, bodyParameterName); - cp.baseName = "body"; - Schema schema = ModelUtils.getSchemaFromRequestBody(body); - if (schema.get$ref() == null) { - return cp; - } - Schema unaliasedSchema = unaliasSchema(schema); - CodegenProperty unaliasedProp = fromProperty("body", unaliasedSchema, false); - Boolean dataTypeMismatch = !cp.dataType.equals(unaliasedProp.dataType); - Boolean baseTypeMismatch = !cp.baseType.equals(unaliasedProp.complexType) && unaliasedProp.complexType != null; - if (dataTypeMismatch || baseTypeMismatch) { - cp.dataType = unaliasedProp.dataType; - cp.baseType = unaliasedProp.complexType; - } - return cp; - } - - /*** - * Adds the body model schema to the body parameter - * We have a custom version of this method so we can flip forceSimpleRef - * to True based upon the results of unaliasSchema - * With this customization, we ensure that when schemas are passed to getSchemaType - * - if they have ref in them they are a model - * - if they do not have ref in them they are not a model - * and code is also customized to allow anyType request body schemas - * - * @param codegenParameter the body parameter - * @param name model schema ref key in components - * @param schema the model schema (not refed) - * @param imports collection of imports - * @param bodyParameterName body parameter name - * @param forceSimpleRef if true use a model reference - */ - @Override - protected void addBodyModelSchema(CodegenParameter codegenParameter, String name, Schema schema, Set imports, String bodyParameterName, boolean forceSimpleRef) { - if (name != null) { - Schema bodySchema = new Schema().$ref("#/components/schemas/" + name); - Schema unaliased = unaliasSchema(bodySchema); - if (unaliased.get$ref() != null) { - forceSimpleRef = true; - } - } - - CodegenModel codegenModel = null; - if (StringUtils.isNotBlank(name)) { - schema.setName(name); - codegenModel = fromModel(name, schema); - } - - if (codegenModel != null && (codegenModel.hasVars || forceSimpleRef)) { - if (StringUtils.isEmpty(bodyParameterName)) { - codegenParameter.baseName = codegenModel.classname; - } else { - codegenParameter.baseName = bodyParameterName; - } - codegenParameter.paramName = toParamName(codegenParameter.baseName); - codegenParameter.baseType = codegenModel.classname; - codegenParameter.dataType = getTypeDeclaration(codegenModel.classname); - codegenParameter.description = codegenModel.description; - codegenParameter.isNullable = codegenModel.isNullable; - } else { - CodegenProperty codegenProperty = fromProperty("property", schema, false); - - if (ModelUtils.isMapSchema(schema)) {// http body is map - // LOGGER.error("Map should be supported. Please report to openapi-generator github repo about the issue."); - } else if (codegenProperty != null) { - String codegenModelName, codegenModelDescription; - - if (codegenModel != null) { - codegenModelName = codegenModel.classname; - codegenModelDescription = codegenModel.description; - } else { - codegenModelName = "anyType"; - codegenModelDescription = ""; - } - - if (StringUtils.isEmpty(bodyParameterName)) { - codegenParameter.baseName = codegenModelName; - } else { - codegenParameter.baseName = bodyParameterName; - } - - codegenParameter.paramName = toParamName(codegenParameter.baseName); - codegenParameter.baseType = codegenModelName; - codegenParameter.dataType = getTypeDeclaration(codegenModelName); - codegenParameter.description = codegenModelDescription; - } - - // set nullable - setParameterNullable(codegenParameter, codegenProperty); - } - - } - - - /** - * Return the sanitized variable name for enum - * - * @param value enum variable name - * @param datatype data type - * @return the sanitized variable name for enum - */ - public String toEnumVarName(String value, String datatype) { - // our enum var names are keys in a python dict, so change spaces to underscores - if (value.length() == 0) { - return "EMPTY"; - } else if (value.equals("null")) { - return "NONE"; - } - - String intPattern = "^[-\\+]?\\d+$"; - String floatPattern = "^[-\\+]?\\d+\\.\\d+$"; - Boolean intMatch = Pattern.matches(intPattern, value); - Boolean floatMatch = Pattern.matches(floatPattern, value); - if (intMatch || floatMatch) { - String plusSign = "^\\+.+"; - String negSign = "^-.+"; - if (Pattern.matches(plusSign, value)) { - value = value.replace("+", "POSITIVE_"); - } else if (Pattern.matches(negSign, value)) { - value = value.replace("-", "NEGATIVE_"); - } else { - value = "POSITIVE_" + value; - } - if (floatMatch) { - value = value.replace(".", "_PT_"); - } - return value; - } - // Replace " " with _ - String usedValue = value.replaceAll("\\s+", "_"); - // strip first character if it is invalid - usedValue = usedValue.replaceAll("^[^_a-zA-Z]", ""); - // Replace / with _ for path enums - usedValue = usedValue.replaceAll("/", "_"); - // Replace . with _ for tag enums - usedValue = usedValue.replaceAll("\\.", "_"); - // add underscore at camelCase locations - String regex = "([a-z])([A-Z]+)"; - String replacement = "$1_$2"; - usedValue = usedValue.replaceAll(regex, replacement); - // Replace invalid characters with empty space - usedValue = usedValue.replaceAll("[^_a-zA-Z0-9]*", ""); - // uppercase - usedValue = usedValue.toUpperCase(Locale.ROOT); - - if (usedValue.length() == 0) { - for (int i = 0; i < value.length(); i++){ - Character c = value.charAt(i); - String charName = Character.getName(c.hashCode()); - usedValue += charNameToVarName(charName); - } - // remove trailing _ - usedValue = usedValue.replaceAll("[_]$", ""); - } - return usedValue; - } - - /** - * Replace - and " " with _ - * Remove SIGN - * - * @param charName - * @return - */ - private String charNameToVarName(String charName) { - String varName = charName.replaceAll("[\\-\\s]", "_"); - varName = varName.replaceAll("SIGN", ""); - return varName; - } - - protected List> buildEnumVars(List values, String dataType) { - List> enumVars = new ArrayList<>(); - int truncateIdx = 0; - - if (isRemoveEnumValuePrefix()) { - String commonPrefix = findCommonPrefixOfVars(values); - truncateIdx = commonPrefix.length(); - } - - for (Object value : values) { - Map enumVar = new HashMap<>(); - String enumName; - if (truncateIdx == 0) { - enumName = String.valueOf(value); - } else { - enumName = value.toString().substring(truncateIdx); - if (enumName.isEmpty()) { - enumName = value.toString(); - } - } - - enumVar.put("name", toEnumVarName(enumName, dataType)); - if (value instanceof Integer) { - enumVar.put("value", value); - } else if (value instanceof Double) { - enumVar.put("value", value); - } else if (value instanceof Long) { - enumVar.put("value", value); - } else if (value instanceof Float) { - enumVar.put("value", value); - } else if (value instanceof BigDecimal) { - enumVar.put("value", value); - } else if (value == null) { - enumVar.put("value", "schemas.NoneClass.NONE"); - } else if (value instanceof Boolean) { - if (value.equals(Boolean.TRUE)) { - enumVar.put("value", "schemas.BoolClass.TRUE"); - } else { - enumVar.put("value", "schemas.BoolClass.FALSE"); - } - } else { - String fixedValue = (String) processTestExampleData(value); - enumVar.put("value", ensureQuotes(fixedValue)); - } - enumVar.put("isString", isDataTypeString(dataType)); - enumVars.add(enumVar); - } - - if (enumUnknownDefaultCase) { - // If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response. - // With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case. - Map enumVar = new HashMap<>(); - String enumName = enumUnknownDefaultCaseName; - - String enumValue; - if (isDataTypeString(dataType)) { - enumValue = enumUnknownDefaultCaseName; - } else { - // This is a dummy value that attempts to avoid collisions with previously specified cases. - // Int.max / 192 - // The number 192 that is used to calculate this random value, is the Swift Evolution proposal for frozen/non-frozen enums. - // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) - // Since this functionality was born in the Swift 5 generator and latter on broth to all generators - // https://github.com/OpenAPITools/openapi-generator/pull/11013 - enumValue = String.valueOf(11184809); - } - - enumVar.put("name", toEnumVarName(enumName, dataType)); - enumVar.put("value", toEnumValue(enumValue, dataType)); - enumVar.put("isString", isDataTypeString(dataType)); - enumVars.add(enumVar); - } - - return enumVars; - } - - @Override - public void postProcessParameter(CodegenParameter p) { - postProcessPattern(p.pattern, p.vendorExtensions); - if (p.baseType != null && languageSpecificPrimitives.contains(p.baseType)) { - // set baseType to null so the api docs will not point to a model for languageSpecificPrimitives - p.baseType = null; - } - } - - /** - * Sets the value of the 'model.parent' property in CodegenModel - * We have a custom version of this function so we can add the dataType on the ArrayModel - */ - @Override - protected void addParentContainer(CodegenModel model, String name, Schema schema) { - super.addParentContainer(model, name, schema); - - List referencedModelNames = new ArrayList(); - model.dataType = getTypeString(schema, "", "", referencedModelNames); - } - - protected String toTestCaseName(String specTestCaseName) { - return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, specTestCaseName); - } - - protected String handleSpecialCharacters(String value) { - // handles escape characters and the like - String stringValue = value; - String backslash = "\\"; - if (stringValue.contains(backslash)) { - stringValue = stringValue.replace(backslash, "\\\\"); - } - String nullChar = "\0"; - if (stringValue.contains(nullChar)) { - stringValue = stringValue.replace(nullChar, "\\x00"); - } - String doubleQuoteChar = "\""; - if (stringValue.contains(doubleQuoteChar)) { - stringValue = stringValue.replace(doubleQuoteChar, "\\\""); - } - String lineSep = System.lineSeparator(); - if (stringValue.contains(lineSep)) { - stringValue = stringValue.replace(lineSep, "\\n"); - } - String carriageReturn = "\r"; - if (stringValue.contains(carriageReturn)) { - stringValue = stringValue.replace(carriageReturn, "\\r"); - } - String tab = "\t"; - if (stringValue.contains(tab)) { - stringValue = stringValue.replace(tab, "\\t"); - } - String formFeed = "\f"; - if (stringValue.contains(formFeed)) { - stringValue = stringValue.replace(formFeed, "\\f"); - } - return stringValue; - } - - protected Object processTestExampleData(Object value) { - if (value instanceof Integer){ - return value; - } else if (value instanceof Double || value instanceof Float || value instanceof Boolean){ - return value; - } else if (value instanceof String) { - return handleSpecialCharacters((String) value); - } else if (value instanceof LinkedHashMap) { - LinkedHashMap fixedValues = new LinkedHashMap(); - for (Map.Entry entry: ((LinkedHashMap) value).entrySet()) { - String entryKey = (String) processTestExampleData(entry.getKey()); - Object entryValue = processTestExampleData(entry.getValue()); - fixedValues.put(entryKey, entryValue); - } - return fixedValues; - } else if (value instanceof ArrayList) { - ArrayList fixedValues = (ArrayList) value; - for (int i = 0; i < fixedValues.size(); i++) { - Object item = processTestExampleData(fixedValues.get(i)); - fixedValues.set(i, item); - } - return fixedValues; - } else if (value == null) { - return value; - } - return value; - } - - /** - * Convert OAS Model object to Codegen Model object - * We have a custom version of this method so we can: - * - set the correct regex values for requiredVars + optionalVars - * - set model.defaultValue and model.hasRequired per the three use cases defined in this method - * - * @param name the name of the model - * @param sc OAS Model object - * @return Codegen Model object - */ - @Override - public CodegenModel fromModel(String name, Schema sc) { - CodegenModel cm = super.fromModel(name, sc); - - if (cm.isNullable) { - cm.setIsNull(true); - cm.isNullable = false; - cm.setHasMultipleTypes(true); - } - Boolean isNotPythonModelSimpleModel = (ModelUtils.isComposedSchema(sc) || ModelUtils.isObjectSchema(sc) || ModelUtils.isMapSchema(sc)); - setAdditionalPropsAndItemsVarNames(cm); - if (isNotPythonModelSimpleModel) { - return cm; - } - String defaultValue = toDefaultValue(sc); - if (sc.getDefault() != null) { - cm.defaultValue = defaultValue; - } - return cm; - } - - /** - * Returns the python type for the property. - * - * @param schema property schema - * @return string presentation of the type - **/ - @SuppressWarnings("static-method") - @Override - public String getSchemaType(Schema schema) { - String openAPIType = getSingleSchemaType(schema); - if (typeMapping.containsKey(openAPIType)) { - String type = typeMapping.get(openAPIType); - return type; - } - return toModelName(openAPIType); - } - - public String getModelName(Schema sc) { - if (sc.get$ref() != null) { - Schema unaliasedSchema = unaliasSchema(sc); - if (unaliasedSchema.get$ref() != null) { - return toModelName(ModelUtils.getSimpleRef(sc.get$ref())); - } - } - return null; - } - - /** - * Return a string representation of the Python types for the specified OAS schema. - * Primitive types in the OAS specification are implemented in Python using the corresponding - * Python primitive types. - * Composed types (e.g. allAll, oneOf, anyOf) are represented in Python using list of types. - *

    - * The caller should set the prefix and suffix arguments to empty string, except when - * getTypeString invokes itself recursively. A non-empty prefix/suffix may be specified - * to wrap the return value in a python dict, list or tuple. - *

    - * Examples: - * - "bool, date, float" The data must be a bool, date or float. - * - "[bool, date]" The data must be an array, and the array items must be a bool or date. - * - * @param p The OAS schema. - * @param prefix prepended to the returned value. - * @param suffix appended to the returned value. - * @param referencedModelNames a list of models that are being referenced while generating the types, - * may be used to generate imports. - * @return a comma-separated string representation of the Python types - */ - private String getTypeString(Schema p, String prefix, String suffix, List referencedModelNames) { - String fullSuffix = suffix; - if (")".equals(suffix)) { - fullSuffix = "," + suffix; - } - if (StringUtils.isNotEmpty(p.get$ref())) { - // The input schema is a reference. If the resolved schema is - // a composed schema, convert the name to a Python class. - Schema unaliasedSchema = unaliasSchema(p); - if (unaliasedSchema.get$ref() != null) { - String modelName = toModelName(ModelUtils.getSimpleRef(p.get$ref())); - if (referencedModelNames != null) { - referencedModelNames.add(modelName); - } - return prefix + modelName + fullSuffix; - } - } - if (ModelUtils.isAnyType(p)) { - return prefix + "bool, date, datetime, dict, float, int, list, str, none_type" + suffix; - } - // Resolve $ref because ModelUtils.isXYZ methods do not automatically resolve references. - if (ModelUtils.isNullable(ModelUtils.getReferencedSchema(this.openAPI, p))) { - fullSuffix = ", none_type" + suffix; - } - if (ModelUtils.isNumberSchema(p)) { - return prefix + "int, float" + fullSuffix; - } else if (ModelUtils.isTypeObjectSchema(p)) { - if (p.getAdditionalProperties() != null && p.getAdditionalProperties().equals(false)) { - if (p.getProperties() == null) { - // type object with no properties and additionalProperties = false, empty dict only - return prefix + "{str: typing.Any}" + fullSuffix; - } else { - // properties only - // TODO add type hints for those properties only as values - return prefix + "{str: typing.Any}" + fullSuffix; - } - } else { - // additionalProperties exists - Schema inner = getAdditionalProperties(p); - return prefix + "{str: " + getTypeString(inner, "(", ")", referencedModelNames) + "}" + fullSuffix; - // TODO add code here to add property values too if they exist - } - } else if (ModelUtils.isArraySchema(p)) { - ArraySchema ap = (ArraySchema) p; - Schema inner = ap.getItems(); - if (inner == null) { - // In OAS 3.0.x, the array "items" attribute is required. - // In OAS >= 3.1, the array "items" attribute is optional such that the OAS - // specification is aligned with the JSON schema specification. - // When "items" is not specified, the elements of the array may be anything at all. - // In that case, the return value should be: - // "[bool, date, datetime, dict, float, int, list, str, none_type]" - // Using recursion to wrap the allowed python types in an array. - Schema anyType = new Schema(); // A Schema without any attribute represents 'any type'. - return getTypeString(anyType, "[", "]", referencedModelNames); - } else { - return prefix + getTypeString(inner, "[", "]", referencedModelNames) + fullSuffix; - } - } else if (ModelUtils.isFileSchema(p)) { - return prefix + "file_type" + fullSuffix; - } - String baseType = getSchemaType(p); - return prefix + baseType + fullSuffix; - } - - /** - * Output the type declaration of a given name - * - * @param p property schema - * @return a string presentation of the type - */ - @Override - public String getTypeDeclaration(Schema p) { - // this is used to set dataType, which defines a python tuple of classes - // in Python we will wrap this in () to make it a tuple but here we - // will omit the parens so the generated documentation will not include - // them - return getTypeString(p, "", "", null); - } - - @Override - public String toInstantiationType(Schema property) { - if (ModelUtils.isArraySchema(property) || ModelUtils.isMapSchema(property) || property.getAdditionalProperties() != null) { - return getSchemaType(property); - } - return super.toInstantiationType(property); - } - - @Override - protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) { - } - - /** - * Gets an example if it exists - * - * @param sc input schema - * @return the example value - */ - protected Object getObjectExample(Schema sc) { - Schema schema = sc; - String ref = sc.get$ref(); - if (ref != null) { - schema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); - } - // TODO handle examples in object models in the future - Boolean objectModel = (ModelUtils.isObjectSchema(schema) || ModelUtils.isMapSchema(schema) || ModelUtils.isComposedSchema(schema)); - if (objectModel) { - return null; - } - if (schema.getExample() != null) { - return schema.getExample(); - } - if (schema.getDefault() != null) { - return schema.getDefault(); - } else if (schema.getEnum() != null && !schema.getEnum().isEmpty()) { - return schema.getEnum().get(0); - } - return null; - } - - /*** - * Ensures that the string has a leading and trailing quote - * - * @param in input string - * @return quoted string - */ - private String ensureQuotes(String in) { - String strPattern = "^['\"].*?['\"]$"; - if (in.matches(strPattern)) { - return in; - } - return "\"" + in + "\""; - } - - @Override - public String toExampleValue(Schema schema) { - String modelName = getModelName(schema); - Object objExample = getObjectExample(schema); - return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0, new ArrayList<>()); - } - - public String toExampleValue(Schema schema, Object objExample) { - String modelName = getModelName(schema); - return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0, new ArrayList<>()); - } - - private Boolean simpleStringSchema(Schema schema) { - Schema sc = schema; - String ref = schema.get$ref(); - if (ref != null) { - sc = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); - } - if (ModelUtils.isStringSchema(sc) && !ModelUtils.isDateSchema(sc) && !ModelUtils.isDateTimeSchema(sc) && !"Number".equalsIgnoreCase(sc.getFormat()) && !ModelUtils.isByteArraySchema(sc) && !ModelUtils.isBinarySchema(sc) && schema.getPattern() == null) { - return true; - } - return false; - } - - private MappedModel getDiscriminatorMappedModel(CodegenDiscriminator disc) { - for (MappedModel mm : disc.getMappedModels()) { - String modelName = mm.getModelName(); - Schema modelSchema = getModelNameToSchemaCache().get(modelName); - if (ModelUtils.isObjectSchema(modelSchema)) { - return mm; - } - } - return null; - } - - /*** - * Recursively generates string examples for schemas - * - * @param modelName the string name of the refed model that will be generated for the schema or null - * @param schema the schema that we need an example for - * @param objExample the example that applies to this schema, for now only string example are used - * @param indentationLevel integer indentation level that we are currently at - * we assume the indentaion amount is 4 spaces times this integer - * @param prefix the string prefix that we will use when assigning an example for this line - * this is used when setting key: value, pairs "key: " is the prefix - * and this is used when setting properties like some_property='some_property_example' - * @param exampleLine this is the current line that we are generatign an example for, starts at 0 - * we don't indentin the 0th line because using the example value looks like: - * prop = ModelName( line 0 - * some_property='some_property_example' line 1 - * ) line 2 - * and our example value is: - * ModelName( line 0 - * some_property='some_property_example' line 1 - * ) line 2 - * @param includedSchemas are a list of schemas that we have moved through to get here. If the new schemas that we - * are looking at is in includedSchemas then we have hit a cycle. - * @return the string example - */ - private String toExampleValueRecursive(String modelName, Schema schema, Object objExample, int indentationLevel, String prefix, Integer exampleLine, List includedSchemas) { - boolean couldHaveCycle = includedSchemas.size() > 0 && potentiallySelfReferencingSchema(schema); - // If we have seen the ContextAwareSchemaNode more than once before, we must be in a cycle. - boolean cycleFound = false; - if (couldHaveCycle) { - cycleFound = includedSchemas.subList(0, includedSchemas.size()-1).stream().anyMatch(s -> schema.equals(s)); - } - final String indentionConst = " "; - String currentIndentation = ""; - String closingIndentation = ""; - for (int i = 0; i < indentationLevel; i++) currentIndentation += indentionConst; - if (exampleLine.equals(0)) { - closingIndentation = currentIndentation; - currentIndentation = ""; - } else { - closingIndentation = currentIndentation; - } - String openChars = ""; - String closeChars = ""; - if (modelName != null) { - openChars = modelName + "("; - closeChars = ")"; - } - - String fullPrefix = currentIndentation + prefix + openChars; - - String example = null; - if (objExample != null) { - example = objExample.toString(); - } - if (null != schema.get$ref()) { - Map allDefinitions = ModelUtils.getSchemas(this.openAPI); - String ref = ModelUtils.getSimpleRef(schema.get$ref()); - Schema refSchema = allDefinitions.get(ref); - if (null == refSchema) { - LOGGER.warn("Unable to find referenced schema " + schema.get$ref() + "\n"); - return fullPrefix + "None" + closeChars; - } - String refModelName = getModelName(schema); - return toExampleValueRecursive(refModelName, refSchema, objExample, indentationLevel, prefix, exampleLine, includedSchemas); - } else if (ModelUtils.isNullType(schema)) { - // The 'null' type is allowed in OAS 3.1 and above. It is not supported by OAS 3.0.x, - // though this tooling supports it. - return fullPrefix + "None" + closeChars; - } else if (ModelUtils.isAnyType(schema)) { - /* - This schema may be a composed schema - TODO generate examples for some of these use cases in the future like - only oneOf without a discriminator - */ - if (cycleFound) { - return ""; - } - Boolean hasProperties = (schema.getProperties() != null && !schema.getProperties().isEmpty()); - CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI); - if (ModelUtils.isComposedSchema(schema)) { - if(includedSchemas.contains(schema)) { - return ""; - } - includedSchemas.add(schema); - // complex composed object type schemas not yet handled and the code returns early - if (hasProperties) { - // what if this composed schema defined properties + allOf? - // or items + properties, both a ist and a dict could be accepted as payloads - return fullPrefix + "{}" + closeChars; - } - ComposedSchema cs = (ComposedSchema) schema; - Integer allOfExists = 0; - if (cs.getAllOf() != null && !cs.getAllOf().isEmpty()) { - allOfExists = 1; - } - Integer anyOfExists = 0; - if (cs.getAnyOf() != null && !cs.getAnyOf().isEmpty()) { - anyOfExists = 1; - } - Integer oneOfExists = 0; - if (cs.getOneOf() != null && !cs.getOneOf().isEmpty()) { - oneOfExists = 1; - } - if (allOfExists + anyOfExists + oneOfExists > 1) { - // what if it needs one oneOf schema, one anyOf schema, and two allOf schemas? - return fullPrefix + "None" + closeChars; - } - // for now only oneOf with discriminator is supported - if (oneOfExists == 1 && disc != null) { - ; - } else { - return fullPrefix + "None" + closeChars; - } - } - if (disc != null) { - // a discriminator means that the type must be object - MappedModel mm = getDiscriminatorMappedModel(disc); - if (mm == null) { - return fullPrefix + "None" + closeChars; - } - String discPropNameValue = mm.getMappingName(); - String chosenModelName = mm.getModelName(); - Schema modelSchema = getModelNameToSchemaCache().get(chosenModelName); - CodegenProperty cp = new CodegenProperty(); - cp.setName(disc.getPropertyName()); - cp.setExample(discPropNameValue); - return exampleForObjectModel(modelSchema, fullPrefix, closeChars, cp, indentationLevel, exampleLine, closingIndentation, includedSchemas); - } - return fullPrefix + "None" + closeChars; - } else if (ModelUtils.isBooleanSchema(schema)) { - if (example == null) { - example = "True"; - } else { - if ("false".equalsIgnoreCase(objExample.toString())) { - example = "False"; - } else { - example = "True"; - } - } - return fullPrefix + example + closeChars; - } else if (ModelUtils.isStringSchema(schema)) { - if (example != null) { - return fullPrefix + ensureQuotes(handleSpecialCharacters(example)) + closeChars; - } - if (ModelUtils.isDateSchema(schema)) { - if (objExample == null) { - example = pythonDate("1970-01-01"); - } else { - example = pythonDate(objExample); - } - } else if (ModelUtils.isDateTimeSchema(schema)) { - if (objExample == null) { - example = pythonDateTime("1970-01-01T00:00:00.00Z"); - } else { - example = pythonDateTime(objExample); - } - } else if (ModelUtils.isBinarySchema(schema)) { - if (example == null) { - example = "/path/to/file"; - } - example = "open('" + example + "', 'rb')"; - return fullPrefix + example + closeChars; - } else if (ModelUtils.isByteArraySchema(schema)) { - if (objExample == null) { - example = "'YQ=='"; - } - } else if ("Number".equalsIgnoreCase(schema.getFormat())) { - // a BigDecimal: - example = "2"; - } else if (StringUtils.isNotBlank(schema.getPattern())) { - String pattern = schema.getPattern(); - /* - RxGen does not support our ECMA dialect https://github.com/curious-odd-man/RgxGen/issues/56 - So strip off the leading / and trailing / and turn on ignore case if we have it - */ - Pattern valueExtractor = Pattern.compile("^/?(.+?)/?(.?)$"); - Matcher m = valueExtractor.matcher(pattern); - RgxGen rgxGen = null; - if (m.find()) { - int groupCount = m.groupCount(); - if (groupCount == 1) { - // only pattern found - String isolatedPattern = m.group(1); - rgxGen = new RgxGen(isolatedPattern); - } else if (groupCount == 2) { - // patterns and flag found - String isolatedPattern = m.group(1); - String flags = m.group(2); - if (flags.contains("i")) { - rgxGen = new RgxGen(isolatedPattern); - RgxGenProperties properties = new RgxGenProperties(); - RgxGenOption.CASE_INSENSITIVE.setInProperties(properties, true); - rgxGen.setProperties(properties); - } else { - rgxGen = new RgxGen(isolatedPattern); - } - } - } else { - rgxGen = new RgxGen(pattern); - } - - // this seed makes it so if we have [a-z] we pick a - Random random = new Random(18); - if (rgxGen != null) { - example = rgxGen.generate(random); - } else { - throw new RuntimeException("rgxGen cannot be null. Please open an issue in the openapi-generator github repo."); - } - } else if (schema.getMinLength() != null) { - example = ""; - int len = schema.getMinLength().intValue(); - for (int i = 0; i < len; i++) example += "a"; - } else if (ModelUtils.isUUIDSchema(schema)) { - example = "046b6c7f-0b8a-43b9-b35d-6489e6daee91"; - } else { - example = "string_example"; - } - return fullPrefix + ensureQuotes(example) + closeChars; - } else if (ModelUtils.isIntegerSchema(schema)) { - if (objExample == null) { - if (schema.getMinimum() != null) { - example = schema.getMinimum().toString(); - } else { - example = "1"; - } - } - return fullPrefix + example + closeChars; - } else if (ModelUtils.isNumberSchema(schema)) { - if (objExample == null) { - if (schema.getMinimum() != null) { - example = schema.getMinimum().toString(); - } else { - example = "3.14"; - } - } - return fullPrefix + example + closeChars; - } else if (ModelUtils.isArraySchema(schema)) { - if (objExample instanceof Iterable) { - // If the example is already a list, return it directly instead of wrongly wrap it in another list - return fullPrefix + objExample.toString() + closeChars; - } - if (ModelUtils.isComposedSchema(schema)) { - // complex composed array type schemas not yet handled and the code returns early - return fullPrefix + "[]" + closeChars; - } - ArraySchema arrayschema = (ArraySchema) schema; - Schema itemSchema = arrayschema.getItems(); - String itemModelName = getModelName(itemSchema); - if(includedSchemas.contains(schema)) { - return ""; - } - includedSchemas.add(schema); - String itemExample = toExampleValueRecursive(itemModelName, itemSchema, objExample, indentationLevel + 1, "", exampleLine + 1, includedSchemas); - if (StringUtils.isEmpty(itemExample) || cycleFound) { - return fullPrefix + "[]" + closeChars; - } else { - return fullPrefix + "[" + "\n" + itemExample + "\n" + closingIndentation + "]" + closeChars; - } - } else if (ModelUtils.isTypeObjectSchema(schema)) { - if (modelName == null) { - fullPrefix += "dict("; - closeChars = ")"; - } - if (cycleFound) { - return fullPrefix + closeChars; - } - Boolean hasProperties = (schema.getProperties() != null && !schema.getProperties().isEmpty()); - CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI); - if (ModelUtils.isComposedSchema(schema)) { - // complex composed object type schemas not yet handled and the code returns early - if (hasProperties) { - // what if this composed schema defined properties + allOf? - return fullPrefix + closeChars; - } - ComposedSchema cs = (ComposedSchema) schema; - Integer allOfExists = 0; - if (cs.getAllOf() != null && !cs.getAllOf().isEmpty()) { - allOfExists = 1; - } - Integer anyOfExists = 0; - if (cs.getAnyOf() != null && !cs.getAnyOf().isEmpty()) { - anyOfExists = 1; - } - Integer oneOfExists = 0; - if (cs.getOneOf() != null && !cs.getOneOf().isEmpty()) { - oneOfExists = 1; - } - if (allOfExists + anyOfExists + oneOfExists > 1) { - // what if it needs one oneOf schema, one anyOf schema, and two allOf schemas? - return fullPrefix + closeChars; - } - // for now only oneOf with discriminator is supported - if (oneOfExists == 1 && disc != null) { - ; - } else { - return fullPrefix + closeChars; - } - } - if (disc != null) { - MappedModel mm = getDiscriminatorMappedModel(disc); - if (mm == null) { - return fullPrefix + closeChars; - } - String discPropNameValue = mm.getMappingName(); - String chosenModelName = mm.getModelName(); - Schema modelSchema = getModelNameToSchemaCache().get(chosenModelName); - CodegenProperty cp = new CodegenProperty(); - cp.setName(disc.getPropertyName()); - cp.setExample(discPropNameValue); - return exampleForObjectModel(modelSchema, fullPrefix, closeChars, cp, indentationLevel, exampleLine, closingIndentation, includedSchemas); - } - Object addPropsObj = schema.getAdditionalProperties(); - if (hasProperties) { - return exampleForObjectModel(schema, fullPrefix, closeChars, null, indentationLevel, exampleLine, closingIndentation, includedSchemas); - } else if (addPropsObj instanceof Schema) { - // TODO handle true case for additionalProperties - Schema addPropsSchema = (Schema) addPropsObj; - String key = "key"; - Object addPropsExample = getObjectExample(addPropsSchema); - if (addPropsSchema.getEnum() != null && !addPropsSchema.getEnum().isEmpty()) { - key = addPropsSchema.getEnum().get(0).toString(); - } - addPropsExample = exampleFromStringOrArraySchema(addPropsSchema, addPropsExample, key); - String addPropPrefix = key + "="; - if (modelName == null) { - addPropPrefix = ensureQuotes(key) + ": "; - } - String addPropsModelName = getModelName(addPropsSchema); - if(includedSchemas.contains(schema)) { - return ""; - } - includedSchemas.add(schema); - - example = fullPrefix + "\n" + toExampleValueRecursive(addPropsModelName, addPropsSchema, addPropsExample, indentationLevel + 1, addPropPrefix, exampleLine + 1, includedSchemas) + ",\n" + closingIndentation + closeChars; - } else { - example = fullPrefix + closeChars; - } - } else { - LOGGER.warn("Type " + schema.getType() + " not handled properly in toExampleValue"); - } - - return example; - } - - private boolean potentiallySelfReferencingSchema(Schema schema) { - return null != schema.get$ref() || ModelUtils.isArraySchema(schema) || ModelUtils.isMapSchema(schema) || ModelUtils.isObjectSchema(schema) || ModelUtils.isComposedSchema(schema); - } - - private String exampleForObjectModel(Schema schema, String fullPrefix, String closeChars, CodegenProperty discProp, int indentationLevel, int exampleLine, String closingIndentation, List includedSchemas) { - - Map requiredAndOptionalProps = schema.getProperties(); - if (requiredAndOptionalProps == null || requiredAndOptionalProps.isEmpty()) { - return fullPrefix + closeChars; - } - - if(includedSchemas.contains(schema)) { - return ""; - } - includedSchemas.add(schema); - - String example = fullPrefix + "\n"; - - for (Map.Entry entry : requiredAndOptionalProps.entrySet()) { - String propName = entry.getKey(); - Schema propSchema = entry.getValue(); - propName = toVarName(propName); - String propModelName = null; - Object propExample = null; - if (discProp != null && propName.equals(discProp.name)) { - propModelName = null; - propExample = discProp.example; - } else { - propModelName = getModelName(propSchema); - propExample = exampleFromStringOrArraySchema( - propSchema, - null, - propName); - } - - example += toExampleValueRecursive(propModelName, - propSchema, - propExample, - indentationLevel + 1, - propName + "=", - exampleLine + 1, - includedSchemas) + ",\n"; - } - - // TODO handle additionalProperties also - example += closingIndentation + closeChars; - return example; - - } - - private Object exampleFromStringOrArraySchema(Schema sc, Object currentExample, String propName) { - if (currentExample != null) { - return currentExample; - } - Schema schema = sc; - String ref = sc.get$ref(); - if (ref != null) { - schema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); - } - Object example = getObjectExample(schema); - if (example != null) { - return example; - } else if (simpleStringSchema(schema)) { - return propName + "_example"; - } else if (ModelUtils.isArraySchema(schema)) { - ArraySchema arraySchema = (ArraySchema) schema; - Schema itemSchema = arraySchema.getItems(); - example = getObjectExample(itemSchema); - if (example != null) { - return example; - } else if (simpleStringSchema(itemSchema)) { - return propName + "_example"; - } - } - return null; - } - - - /*** - * - * Set the codegenParameter example value - * We have a custom version of this function so we can invoke toExampleValue - * - * @param codegenParameter the item we are setting the example on - * @param parameter the base parameter that came from the spec - */ - @Override - public void setParameterExampleValue(CodegenParameter codegenParameter, Parameter parameter) { - Schema schema = parameter.getSchema(); - if (schema == null) { - LOGGER.warn("CodegenParameter.example defaulting to null because parameter lacks a schema"); - return; - } - - Object example = null; - if (codegenParameter.vendorExtensions != null && codegenParameter.vendorExtensions.containsKey("x-example")) { - example = codegenParameter.vendorExtensions.get("x-example"); - } else if (parameter.getExample() != null) { - example = parameter.getExample(); - } else if (parameter.getExamples() != null && !parameter.getExamples().isEmpty() && parameter.getExamples().values().iterator().next().getValue() != null) { - example = parameter.getExamples().values().iterator().next().getValue(); - } else { - example = getObjectExample(schema); - } - example = exampleFromStringOrArraySchema(schema, example, parameter.getName()); - String finalExample = toExampleValue(schema, example); - codegenParameter.example = finalExample; - } - - /** - * Return the example value of the parameter. - * - * @param codegenParameter Codegen parameter - * @param requestBody Request body - */ - @Override - public void setParameterExampleValue(CodegenParameter codegenParameter, RequestBody requestBody) { - if (codegenParameter.vendorExtensions != null && codegenParameter.vendorExtensions.containsKey("x-example")) { - codegenParameter.example = Json.pretty(codegenParameter.vendorExtensions.get("x-example")); - } - - Content content = requestBody.getContent(); - - if (content.size() > 1) { - // @see ModelUtils.getSchemaFromContent() - once(LOGGER).warn("Multiple MediaTypes found, using only the first one"); - } - - MediaType mediaType = content.values().iterator().next(); - Schema schema = mediaType.getSchema(); - if (schema == null) { - LOGGER.warn("CodegenParameter.example defaulting to null because requestBody content lacks a schema"); - return; - } - - Object example = null; - if (mediaType.getExample() != null) { - example = mediaType.getExample(); - } else if (mediaType.getExamples() != null && !mediaType.getExamples().isEmpty() && mediaType.getExamples().values().iterator().next().getValue() != null) { - example = mediaType.getExamples().values().iterator().next().getValue(); - } else { - example = getObjectExample(schema); - } - example = exampleFromStringOrArraySchema(schema, example, codegenParameter.paramName); - codegenParameter.example = toExampleValue(schema, example); - } - - /** - * Create a CodegenParameter for a Form Property - * We have a custom version of this method so we can invoke - * setParameterExampleValue(codegenParameter, parameter) - * rather than setParameterExampleValue(codegenParameter) - * This ensures that all of our samples are generated in - * toExampleValueRecursive - * - * @param name the property name - * @param propertySchema the property schema - * @param imports our import set - * @return the resultant CodegenParameter - */ - @Override - public CodegenParameter fromFormProperty(String name, Schema propertySchema, Set imports) { - CodegenParameter cp = super.fromFormProperty(name, propertySchema, imports); - Parameter p = new Parameter(); - p.setSchema(propertySchema); - p.setName(cp.paramName); - setParameterExampleValue(cp, p); - return cp; - } - - /** - * Return a map from model name to Schema for efficient lookup. - * - * @return map from model name to Schema. - */ - protected Map getModelNameToSchemaCache() { - if (modelNameToSchemaCache == null) { - // Create a cache to efficiently lookup schema based on model name. - Map m = new HashMap(); - ModelUtils.getSchemas(openAPI).forEach((key, schema) -> { - m.put(toModelName(key), schema); - }); - modelNameToSchemaCache = Collections.unmodifiableMap(m); - } - return modelNameToSchemaCache; - } - - /** - * Use cases: - * additional properties is unset: do nothing - * additional properties is true: add definiton to property - * additional properties is false: add definiton to property - * additional properties is schema: add definiton to property - * - * @param schema the schema that may contain an additional property schema - * @param property the property for the above schema - */ - @Override - protected void setAddProps(Schema schema, IJsonSchemaValidationProperties property){ - Schema addPropsSchema = getSchemaFromBooleanOrSchema(schema.getAdditionalProperties()); - if (addPropsSchema == null) { - return; - } - CodegenProperty addPropProp = fromProperty("", addPropsSchema, false, false); - property.setAdditionalProperties(addPropProp); - } - - /** - * Update property for array(list) container - * - * @param property Codegen property - * @param innerProperty Codegen inner property of map or list - */ - @Override - protected void updatePropertyForArray(CodegenProperty property, CodegenProperty innerProperty) { - if (innerProperty == null) { - if(LOGGER.isWarnEnabled()) { - LOGGER.warn("skipping invalid array property {}", Json.pretty(property)); - } - return; - } - property.dataFormat = innerProperty.dataFormat; - if (languageSpecificPrimitives.contains(innerProperty.baseType)) { - property.isPrimitiveType = true; - } - property.items = innerProperty; - property.mostInnerItems = getMostInnerItems(innerProperty); - // inner item is Enum - if (isPropertyInnerMostEnum(property)) { - // isEnum is set to true when the type is an enum - // or the inner type of an array/map is an enum - property.isEnum = true; - // update datatypeWithEnum and default value for array - // e.g. List => List - updateDataTypeWithEnumForArray(property); - // set allowable values to enum values (including array/map of enum) - property.allowableValues = getInnerEnumAllowableValues(property); - } - - } - - /** - * Sets the booleans that define the model's type - * - * @param model the model to update - * @param schema the model's schema - */ - protected void updateModelForString(CodegenModel model, Schema schema) { - if (ModelUtils.isDateTimeSchema(schema)) { - // isString stays true, format stores that this is a date-time - } else if (ModelUtils.isDateSchema(schema)) { - // isString stays true, format stores that this is a date - } else if (ModelUtils.isUUIDSchema(schema)) { - // isString stays true, format stores that this is a uuid - } else if (ModelUtils.isDecimalSchema(schema)) { - // isString stays true, format stores that this is a uuid - } else if (ModelUtils.isBinarySchema(schema)) { - // format stores that this is binary - model.isString = true; - } - } - - protected void updateModelForNumber(CodegenModel model, Schema schema) { - model.setIsNumber(true); - // float vs double info is stored in format - } - - protected void updateModelForInteger(CodegenModel model, Schema schema) { - model.isInteger = true; - // int32 int64 info is stored in format - } - - protected void updatePropertyForString(CodegenProperty property, Schema p) { - if (ModelUtils.isByteArraySchema(p)) { - // isString stays true, format stores that this is a byte - } else if (ModelUtils.isBinarySchema(p)) { - // format stores that this is binary - property.isString = true; - } else if (ModelUtils.isUUIDSchema(p)) { - // isString stays true, format stores that this is a uuid - } else if (ModelUtils.isURISchema(p)) { - property.isUri = true; - } else if (ModelUtils.isEmailSchema(p)) { - property.isEmail = true; - } else if (ModelUtils.isDateSchema(p)) { // date format - // isString stays true, format stores that this is a date - } else if (ModelUtils.isDateTimeSchema(p)) { // date-time format - // isString stays true, format stores that this is a date-time - } else if (ModelUtils.isDecimalSchema(p)) { // type: string, format: number - // isString stays true, format stores that this is a number - } - property.pattern = toRegularExpression(p.getPattern()); - } - - protected void updatePropertyForNumber(CodegenProperty property, Schema p) { - property.setIsNumber(true); - // float and double differentiation is determined with format info - } - - protected void updatePropertyForInteger(CodegenProperty property, Schema p) { - property.isInteger = true; - // int32 and int64 differentiation is determined with format info - } - - - @Override - protected void updatePropertyForObject(CodegenProperty property, Schema p) { - addVarsRequiredVarsAdditionalProps(p, property); - } - - @Override - protected void updatePropertyForAnyType(CodegenProperty property, Schema p) { - // The 'null' value is allowed when the OAS schema is 'any type'. - // See https://github.com/OAI/OpenAPI-Specification/issues/1389 - if (Boolean.FALSE.equals(p.getNullable())) { - LOGGER.warn("Schema '{}' is any type, which includes the 'null' value. 'nullable' cannot be set to 'false'", p.getName()); - } - addVarsRequiredVarsAdditionalProps(p, property); - } - - @Override - protected void updateModelForObject(CodegenModel m, Schema schema) { - // custom version of this method so properties are always added with addVars - if (schema.getProperties() != null || schema.getRequired() != null) { - // passing null to allProperties and allRequired as there's no parent - addVars(m, unaliasPropertySchema(schema.getProperties()), schema.getRequired(), null, null); - } - // an object or anyType composed schema that has additionalProperties set - addAdditionPropertiesToCodeGenModel(m, schema); - // process 'additionalProperties' - setAddProps(schema, m); - addRequiredVarsMap(schema, m); - } - - @Override - protected void updateModelForAnyType(CodegenModel m, Schema schema) { - // The 'null' value is allowed when the OAS schema is 'any type'. - // See https://github.com/OAI/OpenAPI-Specification/issues/1389 - if (Boolean.FALSE.equals(schema.getNullable())) { - LOGGER.error("Schema '{}' is any type, which includes the 'null' value. 'nullable' cannot be set to 'false'", m.name); - } - // todo add items support here in the future - if (schema.getProperties() != null || schema.getRequired() != null) { - // passing null to allProperties and allRequired as there's no parent - addVars(m, unaliasPropertySchema(schema.getProperties()), schema.getRequired(), null, null); - } - addAdditionPropertiesToCodeGenModel(m, schema); - // process 'additionalProperties' - setAddProps(schema, m); - addRequiredVarsMap(schema, m); - } - - @Override - protected void updateModelForComposedSchema(CodegenModel m, Schema schema, Map allDefinitions) { - final ComposedSchema composed = (ComposedSchema) schema; - - // TODO revise the logic below to set discriminator, xml attributes - if (composed.getAllOf() != null) { - int modelImplCnt = 0; // only one inline object allowed in a ComposedModel - int modelDiscriminators = 0; // only one discriminator allowed in a ComposedModel - for (Schema innerSchema : composed.getAllOf()) { // TODO need to work with anyOf, oneOf as well - if (m.discriminator == null && innerSchema.getDiscriminator() != null) { - LOGGER.debug("discriminator is set to null (not correctly set earlier): {}", m.name); - m.setDiscriminator(createDiscriminator(m.name, innerSchema, this.openAPI)); - if (!this.getLegacyDiscriminatorBehavior()) { - m.addDiscriminatorMappedModelsImports(); - } - modelDiscriminators++; - } - - if (innerSchema.getXml() != null) { - m.xmlPrefix = innerSchema.getXml().getPrefix(); - m.xmlNamespace = innerSchema.getXml().getNamespace(); - m.xmlName = innerSchema.getXml().getName(); - } - if (modelDiscriminators > 1) { - LOGGER.error("Allof composed schema is inheriting >1 discriminator. Only use one discriminator: {}", composed); - } - - if (modelImplCnt++ > 1) { - LOGGER.warn("More than one inline schema specified in allOf:. Only the first one is recognized. All others are ignored."); - break; // only one schema with discriminator allowed in allOf - } - } - } - - CodegenComposedSchemas cs = m.getComposedSchemas(); - if (cs != null) { - if (cs.getAllOf() != null && !cs.getAllOf().isEmpty()) { - for (CodegenProperty cp: cs.getAllOf()) { - if (cp.complexType != null) { - addImport(m, cp.complexType); - } - } - } - if (cs.getOneOf() != null && !cs.getOneOf().isEmpty()) { - for (CodegenProperty cp: cs.getOneOf()) { - if (cp.complexType != null) { - addImport(m, cp.complexType); - } - } - } - if (cs.getAnyOf() != null && !cs.getAnyOf().isEmpty()) { - for (CodegenProperty cp: cs.getAnyOf()) { - if (cp.complexType != null) { - addImport(m, cp.complexType); - } - } - } - } - } - - @Override - public ModelsMap postProcessModels(ModelsMap objs) { - // process enum in models - return postProcessModelsEnum(objs); - } - - /* - * 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. - */ - public void postProcessPattern(String pattern, Map vendorExtensions) { - if (pattern != null) { - int regexLength = pattern.length(); - String regex = pattern; - int i = pattern.lastIndexOf('/'); - if (regexLength >= 2 && pattern.charAt(0) == '/' && i != -1) { - // json schema tests do not include the leading and trailing slashes - // so I do not think that they are required - regex = pattern.substring(1, i); - } - regex = regex.replace("'", "\\'"); - List modifiers = new ArrayList(); - - if (i != -1) { - 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 apiDocFileFolder() { - return (outputFolder + "/" + apiDocPath); - } - - @Override - public String modelDocFileFolder() { - return (outputFolder + "/" + 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]+", "")); - } - - /** - * A custom version of this method is needed to ensure that the form object parameter is kept as-is - * as an object and is not exploded into separate parameters - * @param body the body that is being handled - * @param imports the imports for this body - * @return the list of length one containing a single type object CodegenParameter - */ - @Override - public List fromRequestBodyToFormParameters(RequestBody body, Set imports) { - List parameters = new ArrayList<>(); - LOGGER.debug("debugging fromRequestBodyToFormParameters= {}", body); - Schema schema = ModelUtils.getSchemaFromRequestBody(body); - schema = ModelUtils.getReferencedSchema(this.openAPI, schema); - CodegenParameter cp = fromFormProperty("body", schema, imports); - cp.setContent(getContent(body.getContent(), imports, "RequestBody")); - cp.isFormParam = false; - cp.isBodyParam = true; - parameters.add(cp); - return parameters; - } - - /** - * Custom version of this method so we can move the body parameter into bodyParam - * - * @param path the path of the operation - * @param httpMethod HTTP method - * @param operation OAS operation object - * @param servers list of servers - * @return the resultant CodegenOperation instance - */ - @Override - public CodegenOperation fromOperation(String path, - String httpMethod, - Operation operation, - List servers) { - CodegenOperation co = super.fromOperation(path, httpMethod, operation, servers); - co.httpMethod = httpMethod.toLowerCase(Locale.ROOT); - // smuggle the path enum variable name in operationIdLowerCase - co.operationIdLowerCase = toEnumVarName(co.path, "str"); - // smuggle pathModuleName in nickname - String pathModuleName = toVarName(path); - co.nickname = pathModuleName; - // smuggle path Api class name ins operationIdSnakeCase - co.operationIdSnakeCase = toModelName(path); - - if (co.bodyParam == null) { - for (CodegenParameter cp: co.allParams) { - if (cp.isBodyParam) { - co.bodyParam = cp; - co.bodyParams.add(cp); - } - } - } - return co; - } - - /** - * Custom version of this method to prevent mutation of - * codegenOperation.operationIdLowerCase/operationIdSnakeCase - * Property Usages: - * - operationId: endpoint method name when using tagged apis - * - httpMethod: endpoint method name when using path apis - * - operationIdCamelCase: Api class name containing single endpoint for tagged apis - * - operationIdLowerCase: (smuggled) path enum variable name - * - nickname: (smuggled) path module name for path apis - * - operationIdSnakeCase: (smuggled) path Api class name when using path apis - * - * @param tag name of the tag - * @param resourcePath path of the resource - * @param operation OAS Operation object - * @param co Codegen Operation object - * @param operations map of Codegen operations - */ - @Override - @SuppressWarnings("static-method") - public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation - co, Map> operations) { - List opList = operations.get(tag); - if (opList == null) { - opList = new ArrayList<>(); - operations.put(tag, opList); - } - // check for operationId uniqueness - String uniqueName = co.operationId; - int counter = 0; - for (CodegenOperation op : opList) { - if (uniqueName.equals(op.operationId)) { - uniqueName = co.operationId + "_" + counter; - counter++; - } - } - if (!co.operationId.equals(uniqueName)) { - LOGGER.warn("generated unique operationId `{}`", uniqueName); - } - co.operationId = uniqueName; - co.operationIdCamelCase = camelize(uniqueName); - opList.add(co); - co.baseName = tag; - } - - @Override - public String defaultTemplatingEngine() { - return "handlebars"; - } - - @Override - public String generatorLanguageVersion() { return ">=3.7"; }; - - @Override - public void preprocessOpenAPI(OpenAPI openAPI) { - String originalSpecVersion; - String xOriginalSwaggerVersion = "x-original-swagger-version"; - if (openAPI.getExtensions() != null && !openAPI.getExtensions().isEmpty() && openAPI.getExtensions().containsValue(xOriginalSwaggerVersion)) { - originalSpecVersion = (String) openAPI.getExtensions().get(xOriginalSwaggerVersion); - } else { - originalSpecVersion = openAPI.getOpenapi(); - } - Integer specMajorVersion = Integer.parseInt(originalSpecVersion.substring(0, 1)); - if (specMajorVersion < 3) { - throw new RuntimeException("Your spec version of "+originalSpecVersion+" is too low. python-experimental only works with specs with version >= 3.X.X. Please use a tool like Swagger Editor or Swagger Converter to convert your spec to v3"); - } - } - - /** - * Note: a custom version of this function is used so the original tag value can be used - * - * @param tag Tag - * @return the tag to use - */ - @Override - public String sanitizeTag(String tag) { - return tag; - } - - @Override - public void postProcess() { - System.out.println("################################################################################"); - System.out.println("# Thanks for using OpenAPI Generator. #"); - System.out.println("# Please consider donation to help us maintain this project \uD83D\uDE4F #"); - System.out.println("# https://opencollective.com/openapi_generator/donate #"); - System.out.println("# #"); - System.out.println("# This generator was written by Justin Black (https://github.com/spacether) #"); - System.out.println("# Please support his work directly via https://github.com/sponsors/spacether \uD83D\uDE4F#"); - System.out.println("################################################################################"); - } -} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonPriorClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonPriorClientCodegen.java new file mode 100644 index 000000000000..c6d071e3b990 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonPriorClientCodegen.java @@ -0,0 +1,1521 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * 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 com.google.common.collect.Sets; +import io.swagger.v3.core.util.Json; +import io.swagger.v3.oas.models.media.*; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.MediaType; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.parameters.RequestBody; +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.*; +import org.openapitools.codegen.CodegenDiscriminator.MappedModel; +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.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.github.curiousoddman.rgxgen.RgxGen; +import com.github.curiousoddman.rgxgen.config.RgxGenOption; +import com.github.curiousoddman.rgxgen.config.RgxGenProperties; + +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; +import java.io.File; +import java.util.*; +import java.util.regex.Pattern; +import java.util.regex.Matcher; + +import static org.openapitools.codegen.utils.OnceLogger.once; + +public class PythonPriorClientCodegen extends PythonLegacyClientCodegen { + private final Logger LOGGER = LoggerFactory.getLogger(PythonPriorClientCodegen.class); + + // A cache to efficiently lookup a Schema instance based on the return value of `toModelName()`. + private Map modelNameToSchemaCache; + private DateTimeFormatter iso8601Date = DateTimeFormatter.ISO_DATE; + private DateTimeFormatter iso8601DateTime = DateTimeFormatter.ISO_DATE_TIME; + + public PythonPriorClientCodegen() { + super(); + + embeddedTemplateDir = templateDir = "python-prior"; + + // Composed schemas can have the 'additionalProperties' keyword, as specified in JSON schema. + // In principle, this should be enabled by default for all code generators. However due to limitations + // in other code generators, support needs to be enabled on a case-by-case basis. + supportsAdditionalPropertiesWithComposedSchema = 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 + )) + .includeGlobalFeatures( + GlobalFeature.ParameterizedServer + ) + .excludeGlobalFeatures( + GlobalFeature.XMLStructureDefinitions, + GlobalFeature.Callbacks, + GlobalFeature.LinkObjects, + GlobalFeature.ParameterStyling + ) + .excludeSchemaSupportFeatures( + SchemaSupportFeature.Polymorphism + ) + .excludeParameterFeatures( + ParameterFeature.Cookie + ) + ); + // needed for type object with additionalProperties: false + typeMapping.put("object", "dict"); + + languageSpecificPrimitives.add("file_type"); + languageSpecificPrimitives.add("none_type"); + + // this generator does not use SORT_PARAMS_BY_REQUIRED_FLAG + // this generator uses the following order for endpoint parameters and model properties + // required params/props with no enum of length one + // required params/props with enum of length one (which is used to set a default value as a python named arg value) + // optional params/props with **kwargs in python + cliOptions.remove(4); + + cliOptions.add(new CliOption(CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET, CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET_DESC) + .defaultValue(Boolean.FALSE.toString())); + + cliOptions.add(new CliOption(CodegenConstants.INIT_REQUIRED_VARS, CodegenConstants.INIT_REQUIRED_VARS_DESC) + .defaultValue(Boolean.FALSE.toString())); + + // 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.FALSE.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. NOTE: "+ + "this option breaks composition and will be removed in 6.0.0" + ); + disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts); + cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt); + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.STABLE) + .build(); + } + + @Override + public void processOpts() { + this.setLegacyDiscriminatorBehavior(false); + + super.processOpts(); + modelPackage = packageName + "." + "model"; + + supportingFiles.add(new SupportingFile("model_utils.mustache", packagePath(), "model_utils.py")); + + + // add the models and apis folders + supportingFiles.add(new SupportingFile("__init__models.mustache", packagePath() + File.separatorChar + "models", "__init__.py")); + SupportingFile originalInitModel = supportingFiles.stream() + .filter(sf -> sf.getTemplateFile().equals("__init__model.mustache")) + .reduce((a, b) -> { + throw new IllegalStateException("Multiple elements: " + a + ", " + b); + }) + .orElse(null); + supportingFiles.remove(originalInitModel); + supportingFiles.add(new SupportingFile("__init__model.mustache", packagePath() + File.separatorChar + "model", "__init__.py")); + supportingFiles.add(new SupportingFile("__init__apis.mustache", packagePath() + File.separatorChar + "apis", "__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")); + } + + Boolean generateSourceCodeOnly = false; + if (additionalProperties.containsKey(CodegenConstants.SOURCECODEONLY_GENERATION)) { + generateSourceCodeOnly = Boolean.valueOf(additionalProperties.get(CodegenConstants.SOURCECODEONLY_GENERATION).toString()); + } + + // default this to true so the python ModelSimple models will be generated + ModelUtils.setGenerateAliasAsModel(true); + LOGGER.info( + "{} is hard coded to true in this generator. Alias models will only be generated if they contain validations or enums", + CodegenConstants.GENERATE_ALIAS_AS_MODEL); + + Boolean attrNoneIfUnset = false; + if (additionalProperties.containsKey(CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET)) { + attrNoneIfUnset = Boolean.valueOf(additionalProperties.get(CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET).toString()); + } + additionalProperties.put("attrNoneIfUnset", attrNoneIfUnset); + + // When the 'additionalProperties' keyword is not present in a OAS schema, allow + // undeclared properties. This is compliant with the JSON schema specification. + // setting this to false is required to have composed schemas work because: + // anyOf SchemaA + SchemaB, requires that props present only in A are accepted in B because in B + // they are additional properties + Boolean disallowAddProps = false; + if (additionalProperties.containsKey(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT)) { + disallowAddProps = Boolean.valueOf(additionalProperties.get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString()); + } + this.setDisallowAdditionalPropertiesIfNotPresent(disallowAddProps); + + Boolean initRequiredVars = false; + if (additionalProperties.containsKey(CodegenConstants.INIT_REQUIRED_VARS)) { + initRequiredVars = Boolean.valueOf(additionalProperties.get(CodegenConstants.INIT_REQUIRED_VARS).toString()); + } + additionalProperties.put("initRequiredVars", initRequiredVars); + + // check library option to ensure only urllib3 is supported + if (!DEFAULT_LIBRARY.equals(getLibrary())) { + throw new RuntimeException("Only the `urllib3` library is supported in the refactored `python` client generator at the moment. Please fall back to `python-legacy` client generator for the time being. We welcome contributions to add back `asyncio`, `tornado` support to the `python` client generator."); + } + } + + /** + * Configures a friendly name for the generator. This will be used by the + * generator to select the library with the -g flag. + * + * @return the friendly name for the generator + */ + @Override + public String getName() { + return "python-prior"; + } + + @Override + public Schema unaliasSchema(Schema schema) { + Map allSchemas = ModelUtils.getSchemas(openAPI); + if (allSchemas == null || allSchemas.isEmpty()) { + // skip the warning as the spec can have no model defined + //LOGGER.warn("allSchemas cannot be null/empty in unaliasSchema. Returned 'schema'"); + return schema; + } + + if (schema != null && StringUtils.isNotEmpty(schema.get$ref())) { + String simpleRef = ModelUtils.getSimpleRef(schema.get$ref()); + if (schemaMapping.containsKey(simpleRef)) { + LOGGER.debug("Schema unaliasing of {} omitted because aliased class is to be mapped to {}", simpleRef, schemaMapping.get(simpleRef)); + return schema; + } + Schema ref = allSchemas.get(simpleRef); + if (ref == null) { + once(LOGGER).warn("{} is not defined", schema.get$ref()); + return schema; + } else if (ref.getEnum() != null && !ref.getEnum().isEmpty()) { + // top-level enum class + return schema; + } else if (ModelUtils.isArraySchema(ref)) { + if (ModelUtils.isGenerateAliasAsModel(ref)) { + return schema; // generate a model extending array + } else { + return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); + } + } else if (ModelUtils.isComposedSchema(ref)) { + return schema; + } else if (ModelUtils.isMapSchema(ref)) { + if (ref.getProperties() != null && !ref.getProperties().isEmpty()) // has at least one property + return schema; // treat it as model + else { + if (ModelUtils.isGenerateAliasAsModel(ref)) { + return schema; // generate a model extending map + } else { + // treat it as a typical map + return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); + } + } + } else if (ModelUtils.isObjectSchema(ref)) { // model + if (ref.getProperties() != null && !ref.getProperties().isEmpty()) { // has at least one property + return schema; + } else { + // free form object (type: object) + if (ModelUtils.hasValidation(ref)) { + return schema; + } else if (!getAllOfDescendants(simpleRef, openAPI).isEmpty()) { + return schema; + } else { + return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); + } + } + } else if (ModelUtils.hasValidation(ref)) { + // non object non array non map schemas that have validations + // are returned so we can generate those schemas as models + // we do this to: + // - preserve the validations in that model class in python + // - use those validations when we use this schema in composed oneOf schemas + return schema; + } else { + return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); + } + } + return schema; + } + + public String pythonDate(Object dateValue) { + String strValue = null; + if (dateValue instanceof OffsetDateTime) { + OffsetDateTime date = null; + try { + date = (OffsetDateTime) dateValue; + } catch (ClassCastException e) { + LOGGER.warn("Invalid `date` format for value {}", dateValue); + date = ((Date) dateValue).toInstant().atOffset(ZoneOffset.UTC); + } + strValue = date.format(iso8601Date); + } else { + strValue = dateValue.toString(); + } + return "dateutil_parser('" + strValue + "').date()"; + } + + public String pythonDateTime(Object dateTimeValue) { + String strValue = null; + if (dateTimeValue instanceof OffsetDateTime) { + OffsetDateTime dateTime = null; + try { + dateTime = (OffsetDateTime) dateTimeValue; + } catch (ClassCastException e) { + LOGGER.warn("Invalid `date-time` format for value {}", dateTimeValue); + dateTime = ((Date) dateTimeValue).toInstant().atOffset(ZoneOffset.UTC); + } + strValue = dateTime.format(iso8601DateTime); + } else { + strValue = dateTimeValue.toString(); + } + return "dateutil_parser('" + strValue + "')"; + } + + /** + * Return the default value of the property + * + * @param p OpenAPI property object + * @return string presentation of the default value of the property + */ + @Override + public String toDefaultValue(Schema p) { + // if a variable has no default set and only has one allowed value + // using enum of length == 1 we use that value. Server/client usage: + // python servers: should only use default values for optional params + // python clients: should only use default values for required params + Object defaultObject = null; + if (p.getDefault() != null) { + defaultObject = p.getDefault(); + } else if (p.getEnum() != null && p.getEnum().size() == 1) { + defaultObject = p.getEnum().get(0); + } + + if (defaultObject == null) { + return null; + } + + String defaultValue = defaultObject.toString(); + if (ModelUtils.isDateSchema(p)) { + defaultValue = pythonDate(defaultObject); + } else if (ModelUtils.isDateTimeSchema(p)) { + defaultValue = pythonDateTime(defaultObject); + } else if (ModelUtils.isStringSchema(p) && !ModelUtils.isByteArraySchema(p) && !ModelUtils.isBinarySchema(p) && !ModelUtils.isFileSchema(p) && !ModelUtils.isUUIDSchema(p) && !ModelUtils.isEmailSchema(p)) { + defaultValue = ensureQuotes(defaultValue); + } else if (ModelUtils.isBooleanSchema(p)) { + if (!Boolean.valueOf(defaultValue)) { + defaultValue = "False"; + } else { + defaultValue = "True"; + } + } + return defaultValue; + } + + @Override + public String toModelImport(String name) { + // name looks like Cat + return "from " + modelPackage() + "." + toModelFilename(name) + " import " + toModelName(name); + } + + @Override + @SuppressWarnings("static-method") + public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { + // fix the imports that each model has, add the module reference to the model + // loops through imports and converts them all + // from 'Pet' to 'from petstore_api.model.pet import Pet' + + OperationMap val = objs.getOperations(); + List operations = val.getOperation(); + for (CodegenOperation operation : operations) { + if (operation.imports.isEmpty()) { + continue; + } + String[] modelNames = operation.imports.toArray(new String[0]); + operation.imports.clear(); + for (String modelName : modelNames) { + operation.imports.add(toModelImport(modelName)); + } + } + return objs; + } + + /*** + * Override with special post-processing for all models. + * we have a custom version of this method to: + * - remove any primitive models that do not contain validations + * these models are unaliased as inline definitions wherever the spec has them as refs + * this means that the generated client does not use these models + * because they are not used we do not write them + * - fix the model imports, go from model name to the full import string with toModelImport + globalImportFixer + * + * @param objs a map going from the model name to an object holding the model info + * @return the updated objs + */ + @Override + public Map postProcessAllModels(Map objs) { + super.postProcessAllModels(objs); + + List modelsToRemove = new ArrayList<>(); + Map allDefinitions = ModelUtils.getSchemas(this.openAPI); + for (String schemaName : allDefinitions.keySet()) { + Schema refSchema = new Schema().$ref("#/components/schemas/" + schemaName); + Schema unaliasedSchema = unaliasSchema(refSchema); + String modelName = toModelName(schemaName); + if (unaliasedSchema.get$ref() == null) { + modelsToRemove.add(modelName); + } else { + ModelsMap objModel = objs.get(modelName); + if (objModel != null) { // to avoid form parameter's models that are not generated (skipFormModel=true) + for (ModelMap model : objModel.getModels()) { + CodegenModel cm = model.getModel(); + String[] importModelNames = cm.imports.toArray(new String[0]); + cm.imports.clear(); + for (String importModelName : importModelNames) { + cm.imports.add(toModelImport(importModelName)); + String globalImportFixer = "globals()['" + importModelName + "'] = " + importModelName; + cm.imports.add(globalImportFixer); + } + } + } + } + } + + for (String modelName : modelsToRemove) { + objs.remove(modelName); + } + + return objs; + } + + /** + * Convert OAS Property object to Codegen Property object + * We have a custom version of this method to always set allowableValues.enumVars on all enum variables + * Together with unaliasSchema this sets primitive types with validations as models + * This method is used by fromResponse + * + * @param name name of the property + * @param p OAS property object + * @return Codegen Property object + */ + @Override + public CodegenProperty fromProperty(String name, Schema p, boolean required) { + CodegenProperty cp = super.fromProperty(name, p, required); + if (cp.isEnum) { + updateCodegenPropertyEnum(cp); + } + if (cp.isPrimitiveType && p.get$ref() != null) { + cp.complexType = cp.dataType; + } + if (cp.isArray && cp.complexType == null && cp.mostInnerItems.complexType != null) { + cp.complexType = cp.mostInnerItems.complexType; + } + return cp; + } + + /** + * Update codegen property's enum by adding "enumVars" (with name and value) + * + * @param var list of CodegenProperty + */ + @Override + public void updateCodegenPropertyEnum(CodegenProperty var) { + // we have a custom version of this method to omit overwriting the defaultValue + Map allowableValues = var.allowableValues; + + // handle array + if (var.mostInnerItems != null) { + allowableValues = var.mostInnerItems.allowableValues; + } + + if (allowableValues == null) { + return; + } + + List values = (List) allowableValues.get("values"); + if (values == null) { + return; + } + + String varDataType = var.mostInnerItems != null ? var.mostInnerItems.dataType : var.dataType; + Schema referencedSchema = getModelNameToSchemaCache().get(varDataType); + String dataType = (referencedSchema != null) ? getTypeDeclaration(referencedSchema) : varDataType; + + // put "enumVars" map into `allowableValues", including `name` and `value` + List> enumVars = buildEnumVars(values, dataType); + + // if "x-enum-varnames" or "x-enum-descriptions" defined, update varnames + Map extensions = var.mostInnerItems != null ? var.mostInnerItems.getVendorExtensions() : var.getVendorExtensions(); + if (referencedSchema != null) { + extensions = referencedSchema.getExtensions(); + } + updateEnumVarsWithExtensions(enumVars, extensions, dataType); + allowableValues.put("enumVars", enumVars); + // overwriting defaultValue omitted from here + } + + /*** + * We have a custom version of this method to produce links to models when they are + * primitive type (not map, not array, not object) and include validations or are enums + * + * @param body request body + * @param imports import collection + * @param bodyParameterName body parameter name + * @return the resultant CodegenParameter + */ + @Override + public CodegenParameter fromRequestBody(RequestBody body, Set imports, String bodyParameterName) { + CodegenParameter cp = super.fromRequestBody(body, imports, bodyParameterName); + Schema schema = ModelUtils.getSchemaFromRequestBody(body); + if (schema.get$ref() == null) { + return cp; + } + Schema unaliasedSchema = unaliasSchema(schema); + CodegenProperty unaliasedProp = fromProperty("body", unaliasedSchema, false); + Boolean dataTypeMismatch = !cp.dataType.equals(unaliasedProp.dataType); + Boolean baseTypeMismatch = !cp.baseType.equals(unaliasedProp.complexType) && unaliasedProp.complexType != null; + if (dataTypeMismatch || baseTypeMismatch) { + cp.dataType = unaliasedProp.dataType; + cp.baseType = unaliasedProp.complexType; + } + return cp; + } + + /*** + * Adds the body model schema to the body parameter + * We have a custom version of this method so we can flip forceSimpleRef + * to True based upon the results of unaliasSchema + * With this customization, we ensure that when schemas are passed to getSchemaType + * - if they have ref in them they are a model + * - if they do not have ref in them they are not a model + * + * @param codegenParameter the body parameter + * @param name model schema ref key in components + * @param schema the model schema (not refed) + * @param imports collection of imports + * @param bodyParameterName body parameter name + * @param forceSimpleRef if true use a model reference + */ + @Override + protected void addBodyModelSchema(CodegenParameter codegenParameter, String name, Schema schema, Set imports, String bodyParameterName, boolean forceSimpleRef) { + if (name != null) { + Schema bodySchema = new Schema().$ref("#/components/schemas/" + name); + Schema unaliased = unaliasSchema(bodySchema); + if (unaliased.get$ref() != null) { + forceSimpleRef = true; + } + } + super.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, forceSimpleRef); + + } + + + /** + * Return the sanitized variable name for enum + * + * @param value enum variable name + * @param datatype data type + * @return the sanitized variable name for enum + */ + public String toEnumVarName(String value, String datatype) { + // our enum var names are keys in a python dict, so change spaces to underscores + if (value.length() == 0) { + return "EMPTY"; + } + + String var = value.replaceAll("\\s+", "_").toUpperCase(Locale.ROOT); + return var; + } + + /** + * Return the enum value in the language specified format + * e.g. status becomes "status" + * + * @param value enum variable name + * @param datatype data type + * @return the sanitized value for enum + */ + public String toEnumValue(String value, String datatype) { + if ("int".equals(datatype) || "float".equals(datatype)) { + return value; + } else if ("bool".equals(datatype)) { + return value.substring(0, 1).toUpperCase(Locale.ROOT) + value.substring(1); + } else { + return ensureQuotes(value); + } + } + + @Override + public void postProcessModelProperty(CodegenModel model, CodegenProperty p) { + postProcessPattern(p.pattern, p.vendorExtensions); + // set property.complexType so the model docs will link to the ClassName.md + if (p.complexType == null && p.isArray && p.mostInnerItems.complexType != null && !languageSpecificPrimitives.contains(p.mostInnerItems.complexType)) { + // fix ListContainers + p.complexType = p.mostInnerItems.complexType; + } + } + + @Override + public void postProcessParameter(CodegenParameter p) { + postProcessPattern(p.pattern, p.vendorExtensions); + if (p.baseType != null && languageSpecificPrimitives.contains(p.baseType)) { + // set baseType to null so the api docs will not point to a model for languageSpecificPrimitives + p.baseType = null; + } + } + + private void fixComposedSchemaRequiredVars(Schema schema, CodegenModel result) { + // for composed schema models, if the required properties are only from oneOf or anyOf models + // remove them from the composed schema's required vars + // for composed schemas our code adds oneOf and anyOf required properties to + // the composed schema's required properties + // but they should not be required because if we have ComposedSchema: oneOf -schemaA -schemaB + // and the required props are only in schemaB, we do not need to use them when making an instance of + // ComposedSchema + schemaA + ComposedSchema cs = (ComposedSchema) schema; + + // these are the properties that are from properties in self cs or cs allOf + Map selfProperties = new LinkedHashMap<>(); + List selfRequired = new ArrayList<>(); + + // these are the properties that are from properties in cs oneOf or cs anyOf + Map otherProperties = new LinkedHashMap<>(); + List otherRequired = new ArrayList<>(); + + List oneOfanyOfSchemas = new ArrayList<>(); + List oneOf = cs.getOneOf(); + if (oneOf != null) { + oneOfanyOfSchemas.addAll(oneOf); + } + List anyOf = cs.getAnyOf(); + if (anyOf != null) { + oneOfanyOfSchemas.addAll(anyOf); + } + for (Schema sc : oneOfanyOfSchemas) { + Schema refSchema = ModelUtils.getReferencedSchema(this.openAPI, sc); + addProperties(otherProperties, otherRequired, refSchema, new HashSet<>()); + } + Set otherRequiredSet = new HashSet<>(otherRequired); + + List allOf = cs.getAllOf(); + if ((schema.getProperties() != null && !schema.getProperties().isEmpty()) || allOf != null) { + // NOTE: this function also adds the allOf properties inside schema + addProperties(selfProperties, selfRequired, schema, new HashSet<>()); + } + if (result.discriminator != null) { + selfRequired.add(result.discriminator.getPropertyBaseName()); + } + Set selfRequiredSet = new HashSet<>(selfRequired); + + List reqVars = result.getRequiredVars(); + List reqVarsThatMustBeOptional = new ArrayList<>(); + if (reqVars != null) { + for (CodegenProperty cp : reqVars) { + String propName = cp.baseName; + if (otherRequiredSet.contains(propName) && !selfRequiredSet.contains(propName)) { + cp.required = false; + reqVarsThatMustBeOptional.add(cp); + } + } + } + for (CodegenProperty cp : reqVarsThatMustBeOptional) { + result.getRequiredVars().remove(cp); + result.getOptionalVars().add(cp); + } + } + + /** + * Sets the value of the 'model.parent' property in CodegenModel + * We have a custom version of this function so we can add the dataType on the ArrayModel + */ + @Override + protected void addParentContainer(CodegenModel model, String name, Schema schema) { + super.addParentContainer(model, name, schema); + + List referencedModelNames = new ArrayList<>(); + model.dataType = getTypeString(schema, "", "", referencedModelNames); + } + + /** + * Convert OAS Model object to Codegen Model object + * We have a custom version of this method so we can: + * - set the correct regex values for requiredVars + optionalVars + * - set model.defaultValue and model.hasRequired per the three use cases defined in this method + * + * @param name the name of the model + * @param sc OAS Model object + * @return Codegen Model object + */ + @Override + public CodegenModel fromModel(String name, Schema sc) { + CodegenModel cm = super.fromModel(name, sc); + if (cm.requiredVars.size() > 0 && (cm.oneOf.size() > 0 || cm.anyOf.size() > 0)) { + fixComposedSchemaRequiredVars(sc, cm); + } + ArrayList> listOfLists = new ArrayList<>(); + listOfLists.add(cm.requiredVars); + listOfLists.add(cm.optionalVars); + for (List cpList : listOfLists) { + for (CodegenProperty cp : cpList) { + // sets regex values + postProcessModelProperty(cm, cp); + } + } + Boolean isNotPythonModelSimpleModel = (ModelUtils.isComposedSchema(sc) || ModelUtils.isObjectSchema(sc) || ModelUtils.isMapSchema(sc)); + if (isNotPythonModelSimpleModel) { + return cm; + } + // Use cases for default values / enums of length one + // 1. no default exists + // schema does not contain default + // cm.defaultValue unset, cm.hasRequired = true + // 2. spec has a default + // schema contains default + // cm.defaultValue set, cm.hasRequired = false + // different value here to differentiate between use case 3 below + // This defaultValue is used when a consumer (client or server) lacks the input argument, defaultValue will be used + // 3. only one value is allowed in an enum + // schema does not contain default + // cm.defaultValue set, cm.hasRequired = false + // because we know what value needs to be set so the user doesn't need to input it + // This defaultValue is used in the client and is sent to the server + String defaultValue = toDefaultValue(sc); + if (sc.getDefault() == null && defaultValue == null) { + cm.hasRequired = true; + } else if (sc.getDefault() != null) { + cm.defaultValue = defaultValue; + cm.hasRequired = false; + } else if (defaultValue != null && cm.defaultValue == null) { + cm.defaultValue = defaultValue; + cm.hasRequired = false; + } + return cm; + } + + /** + * Returns the python type for the property. + * + * @param schema property schema + * @return string presentation of the type + **/ + @SuppressWarnings("static-method") + @Override + public String getSchemaType(Schema schema) { + String openAPIType = getSingleSchemaType(schema); + if (typeMapping.containsKey(openAPIType)) { + String type = typeMapping.get(openAPIType); + return type; + } + return toModelName(openAPIType); + } + + public String getModelName(Schema sc) { + if (sc.get$ref() != null) { + Schema unaliasedSchema = unaliasSchema(sc); + if (unaliasedSchema.get$ref() != null) { + return toModelName(ModelUtils.getSimpleRef(sc.get$ref())); + } + } + return null; + } + + @Override + protected Schema getAdditionalProperties(Schema schema) { + /* + Use cases: + 1. addProps set to schema in spec: return that schema + 2. addProps unset w/ getDisallowAdditionalPropertiesIfNotPresent -> null + 3. addProps unset w/ getDisallowAdditionalPropertiesIfNotPresent=False -> new Schema() + 4. addProps true -> new Schema() NOTE: v3 only + 5. addprops false -> null NOTE: v3 only + */ + Object addProps = schema.getAdditionalProperties(); + if (addProps instanceof Schema) { + return (Schema) addProps; + } + if (addProps == null) { + // When reaching this code path, this should indicate the 'additionalProperties' keyword is + // not present in the OAS schema. This is true for OAS 3.0 documents. + // However, the parsing logic is broken for OAS 2.0 documents because of the + // https://github.com/swagger-api/swagger-parser/issues/1369 issue. + // When OAS 2.0 documents are parsed, the swagger-v2-converter ignores the 'additionalProperties' + // keyword if the value is boolean. That means codegen is unable to determine whether + // additional properties are allowed or not. + // + // The original behavior was to assume additionalProperties had been set to false. + if (getDisallowAdditionalPropertiesIfNotPresent()) { + // If the 'additionalProperties' keyword is not present in a OAS schema, + // interpret as if the 'additionalProperties' keyword had been set to false. + // This is NOT compliant with the JSON schema specification. It is the original + // 'openapi-generator' behavior. + return null; + } + /* + // The disallowAdditionalPropertiesIfNotPresent CLI option has been set to true, + // but for now that only works with OAS 3.0 documents. + // The new behavior does not work with OAS 2.0 documents. + if (extensions == null || !extensions.containsKey(EXTENSION_OPENAPI_DOC_VERSION)) { + // Fallback to the legacy behavior. + return null; + } + // Get original swagger version from OAS extension. + // Note openAPI.getOpenapi() is always set to 3.x even when the document + // is converted from a OAS/Swagger 2.0 document. + // https://github.com/swagger-api/swagger-parser/pull/1374 + SemVer version = new SemVer((String)extensions.get(EXTENSION_OPENAPI_DOC_VERSION)); + if (version.major != 3) { + return null; + } + */ + } + if (addProps == null || (addProps instanceof Boolean && (Boolean) addProps)) { + // Return empty schema to allow any type + return new Schema(); + } + return null; + } + + /** + * Return a string representation of the Python types for the specified OAS schema. + * Primitive types in the OAS specification are implemented in Python using the corresponding + * Python primitive types. + * Composed types (e.g. allAll, oneOf, anyOf) are represented in Python using list of types. + *

    + * The caller should set the prefix and suffix arguments to empty string, except when + * getTypeString invokes itself recursively. A non-empty prefix/suffix may be specified + * to wrap the return value in a python dict, list or tuple. + *

    + * Examples: + * - "bool, date, float" The data must be a bool, date or float. + * - "[bool, date]" The data must be an array, and the array items must be a bool or date. + * + * @param p The OAS schema. + * @param prefix prepended to the returned value. + * @param suffix appended to the returned value. + * @param referencedModelNames a list of models that are being referenced while generating the types, + * may be used to generate imports. + * @return a comma-separated string representation of the Python types + */ + private String getTypeString(Schema p, String prefix, String suffix, List referencedModelNames) { + String fullSuffix = suffix; + if (")".equals(suffix)) { + fullSuffix = "," + suffix; + } + if (StringUtils.isNotEmpty(p.get$ref())) { + // The input schema is a reference. If the resolved schema is + // a composed schema, convert the name to a Python class. + Schema unaliasedSchema = unaliasSchema(p); + if (unaliasedSchema.get$ref() != null) { + String modelName = toModelName(ModelUtils.getSimpleRef(p.get$ref())); + if (referencedModelNames != null) { + referencedModelNames.add(modelName); + } + return prefix + modelName + fullSuffix; + } + } + if (ModelUtils.isAnyType(p)) { + // for v2 specs only, swagger-parser never generates an AnyType schemas even though it should generate them + // https://github.com/swagger-api/swagger-parser/issues/1378 + // switch to v3 if you need AnyType to work + return prefix + "bool, date, datetime, dict, float, int, list, str, none_type" + suffix; + } + String originalSpecVersion = "X"; + if (this.openAPI.getExtensions() != null && this.openAPI.getExtensions().containsKey("x-original-swagger-version")) { + originalSpecVersion = (String) this.openAPI.getExtensions().get("x-original-swagger-version"); + originalSpecVersion = originalSpecVersion.substring(0, 1); + + } + Boolean v2DisallowAdditionalPropertiesIfNotPresentAddPropsNullCase = (getAdditionalProperties(p) == null && this.getDisallowAdditionalPropertiesIfNotPresent() && originalSpecVersion.equals("2")); + Schema emptySchema = new Schema(); + Boolean v2WithCompositionAddPropsAnyTypeSchemaCase = (getAdditionalProperties(p) != null && emptySchema.equals(getAdditionalProperties(p)) && originalSpecVersion.equals("2")); + if (isFreeFormObject(p) && (v2DisallowAdditionalPropertiesIfNotPresentAddPropsNullCase || v2WithCompositionAddPropsAnyTypeSchemaCase)) { + // for v2 specs only, input AnyType schemas (type unset) or schema {} results in FreeFromObject schemas + // per https://github.com/swagger-api/swagger-parser/issues/1378 + // v2 spec uses cases + // 1. AnyType schemas + // 2. type object schema with no other info + // use case 1 + 2 -> both become use case 1 + // switch to v3 if you need use cases 1 + 2 to work correctly + return prefix + "bool, date, datetime, dict, float, int, list, str, none_type" + fullSuffix; + } + // Resolve $ref because ModelUtils.isXYZ methods do not automatically resolve references. + if (ModelUtils.isNullable(ModelUtils.getReferencedSchema(this.openAPI, p))) { + fullSuffix = ", none_type" + suffix; + } + Boolean v3WithCompositionAddPropsAnyTypeSchemaCase = (getAdditionalProperties(p) != null && emptySchema.equals(getAdditionalProperties(p)) && originalSpecVersion.equals("3")); + if (isFreeFormObject(p) && v3WithCompositionAddPropsAnyTypeSchemaCase) { + // v3 code path, use case: type object schema with no other schema info + return prefix + "{str: (bool, date, datetime, dict, float, int, list, str, none_type)}" + fullSuffix; + } else if ((ModelUtils.isMapSchema(p) || "object".equals(p.getType())) && getAdditionalProperties(p) != null) { + Schema inner = getAdditionalProperties(p); + return prefix + "{str: " + getTypeString(inner, "(", ")", referencedModelNames) + "}" + fullSuffix; + } else if (ModelUtils.isArraySchema(p)) { + ArraySchema ap = (ArraySchema) p; + Schema inner = ap.getItems(); + if (inner == null) { + // In OAS 3.0.x, the array "items" attribute is required. + // In OAS >= 3.1, the array "items" attribute is optional such that the OAS + // specification is aligned with the JSON schema specification. + // When "items" is not specified, the elements of the array may be anything at all. + // In that case, the return value should be: + // "[bool, date, datetime, dict, float, int, list, str, none_type]" + // Using recursion to wrap the allowed python types in an array. + Schema anyType = new Schema(); // A Schema without any attribute represents 'any type'. + return getTypeString(anyType, "[", "]", referencedModelNames); + } else { + return prefix + getTypeString(inner, "[", "]", referencedModelNames) + fullSuffix; + } + } + if (ModelUtils.isFileSchema(p)) { + return prefix + "file_type" + fullSuffix; + } + String baseType = getSchemaType(p); + return prefix + baseType + fullSuffix; + } + + /** + * Output the type declaration of a given name + * + * @param p property schema + * @return a string presentation of the type + */ + @Override + public String getTypeDeclaration(Schema p) { + // this is used to set dataType, which defines a python tuple of classes + // in Python we will wrap this in () to make it a tuple but here we + // will omit the parens so the generated documentation will not include + // them + return getTypeString(p, "", "", null); + } + + @Override + public String toInstantiationType(Schema property) { + if (ModelUtils.isArraySchema(property) || ModelUtils.isMapSchema(property) || property.getAdditionalProperties() != null) { + return getSchemaType(property); + } + return super.toInstantiationType(property); + } + + @Override + protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) { + Schema addProps = getAdditionalProperties(schema); + if (addProps != null) { + // if AdditionalProperties exists, get its datatype and + // store it in codegenModel.additionalPropertiesType. + // The 'addProps' may be a reference, getTypeDeclaration will resolve + // the reference. + List referencedModelNames = new ArrayList<>(); + getTypeString(addProps, "", "", referencedModelNames); + if (referencedModelNames.size() != 0) { + // Models that are referenced in the 'additionalPropertiesType' keyword + // must be added to the imports. + codegenModel.imports.addAll(referencedModelNames); + } + } + // If addProps is null, the value of the 'additionalProperties' keyword is set + // to false, i.e. no additional properties are allowed. + } + + /** + * Gets an example if it exists + * + * @param sc input schema + * @return the example value + */ + protected Object getObjectExample(Schema sc) { + Schema schema = sc; + String ref = sc.get$ref(); + if (ref != null) { + schema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); + } + // TODO handle examples in object models in the future + Boolean objectModel = (ModelUtils.isObjectSchema(schema) || ModelUtils.isMapSchema(schema) || ModelUtils.isComposedSchema(schema)); + if (objectModel) { + return null; + } + if (schema.getExample() != null) { + return schema.getExample(); + } + if (schema.getDefault() != null) { + return schema.getDefault(); + } else if (schema.getEnum() != null && !schema.getEnum().isEmpty()) { + return schema.getEnum().get(0); + } + return null; + } + + /*** + * Ensures that the string has a leading and trailing quote + * + * @param in input string + * @return quoted string + */ + private String ensureQuotes(String in) { + Pattern pattern = Pattern.compile("\r\n|\r|\n"); + Matcher matcher = pattern.matcher(in); + if (matcher.find()) { + // if a string has a new line in it add triple quotes to make it a python multiline string + return "'''" + in + "'''"; + } + String strPattern = "^['\"].*?['\"]$"; + if (in.matches(strPattern)) { + return in; + } + return "\"" + in + "\""; + } + + @Override + public String toExampleValue(Schema schema) { + Object objExample = getObjectExample(schema); + String modelName = getModelName(schema); + return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0, Sets.newHashSet()); + } + + public String toExampleValue(Schema schema, Object objExample) { + String modelName = getModelName(schema); + return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0, Sets.newHashSet()); + } + + private Boolean simpleStringSchema(Schema schema) { + Schema sc = schema; + String ref = schema.get$ref(); + if (ref != null) { + sc = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); + } + if (ModelUtils.isStringSchema(sc) && !ModelUtils.isDateSchema(sc) && !ModelUtils.isDateTimeSchema(sc) && !"Number".equalsIgnoreCase(sc.getFormat()) && !ModelUtils.isByteArraySchema(sc) && !ModelUtils.isBinarySchema(sc) && schema.getPattern() == null) { + return true; + } + return false; + } + + private MappedModel getDiscriminatorMappedModel(CodegenDiscriminator disc) { + for (MappedModel mm : disc.getMappedModels()) { + String modelName = mm.getModelName(); + Schema modelSchema = getModelNameToSchemaCache().get(modelName); + if (ModelUtils.isObjectSchema(modelSchema)) { + return mm; + } + } + return null; + } + + /*** + * Recursively generates string examples for schemas + * + * @param modelName the string name of the refed model that will be generated for the schema or null + * @param schema the schema that we need an example for + * @param objExample the example that applies to this schema, for now only string example are used + * @param indentationLevel integer indentation level that we are currently at + * we assume the indentation amount is 4 spaces times this integer + * @param prefix the string prefix that we will use when assigning an example for this line + * this is used when setting key: value, pairs "key: " is the prefix + * and this is used when setting properties like some_property='some_property_example' + * @param exampleLine this is the current line that we are generating an example for, starts at 0 + * we don't indent the 0th line because using the example value looks like: + * prop = ModelName( line 0 + * some_property='some_property_example' line 1 + * ) line 2 + * and our example value is: + * ModelName( line 0 + * some_property='some_property_example' line 1 + * ) line 2 + * @param seenSchemas This set contains all the schemas passed into the recursive function. It is used to check + * if a schema was already passed into the function and breaks the infinite recursive loop. The + * only schemas that are not added are ones that contain $ref != null + * @return the string example + */ + private String toExampleValueRecursive(String modelName, Schema schema, Object objExample, int indentationLevel, String prefix, Integer exampleLine, Set seenSchemas) { + final String indentionConst = " "; + String currentIndentation = ""; + String closingIndentation = ""; + for (int i = 0; i < indentationLevel; i++) currentIndentation += indentionConst; + if (exampleLine.equals(0)) { + closingIndentation = currentIndentation; + currentIndentation = ""; + } else { + closingIndentation = currentIndentation; + } + String openChars = ""; + String closeChars = ""; + if (modelName != null) { + openChars = modelName + "("; + closeChars = ")"; + } + + String fullPrefix = currentIndentation + prefix + openChars; + + String example = null; + if (objExample != null) { + example = objExample.toString(); + } + // checks if the current schema has already been passed in. If so, breaks the current recursive pass + if (seenSchemas.contains(schema)) { + if (modelName != null) { + return fullPrefix + closeChars; + } else { + // this is a recursive schema + // need to add a reasonable example to avoid + // infinite recursion + if (ModelUtils.isNullable(schema)) { + // if the schema is nullable, then 'None' is a valid value + return fullPrefix + "None" + closeChars; + } else if (ModelUtils.isArraySchema(schema)) { + // the schema is an array, add an empty array + return fullPrefix + "[]" + closeChars; + } else { + // the schema is an object, make an empty object + return fullPrefix + "{}" + closeChars; + } + } + } + + if (null != schema.get$ref()) { + Map allDefinitions = ModelUtils.getSchemas(this.openAPI); + String ref = ModelUtils.getSimpleRef(schema.get$ref()); + Schema refSchema = allDefinitions.get(ref); + if (null == refSchema) { + LOGGER.warn("Unable to find referenced schema {}\n", schema.get$ref()); + return fullPrefix + "None" + closeChars; + } + String refModelName = getModelName(schema); + return toExampleValueRecursive(refModelName, refSchema, objExample, indentationLevel, prefix, exampleLine, seenSchemas); + } else if (ModelUtils.isNullType(schema) || ModelUtils.isAnyType(schema)) { + // The 'null' type is allowed in OAS 3.1 and above. It is not supported by OAS 3.0.x, + // though this tooling supports it. + return fullPrefix + "None" + closeChars; + } else if (ModelUtils.isBooleanSchema(schema)) { + if (objExample == null) { + example = "True"; + } else { + if ("false".equalsIgnoreCase(objExample.toString())) { + example = "False"; + } else { + example = "True"; + } + } + return fullPrefix + example + closeChars; + } else if (ModelUtils.isDateSchema(schema)) { + if (objExample == null) { + example = pythonDate("1970-01-01"); + } else { + example = pythonDate(objExample); + } + return fullPrefix + example + closeChars; + } else if (ModelUtils.isDateTimeSchema(schema)) { + if (objExample == null) { + example = pythonDateTime("1970-01-01T00:00:00.00Z"); + } else { + example = pythonDateTime(objExample); + } + return fullPrefix + example + closeChars; + } else if (ModelUtils.isBinarySchema(schema)) { + if (objExample == null) { + example = "/path/to/file"; + } + example = "open('" + example + "', 'rb')"; + return fullPrefix + example + closeChars; + } else if (ModelUtils.isByteArraySchema(schema)) { + if (objExample == null) { + example = "'YQ=='"; + } + return fullPrefix + example + closeChars; + } else if (ModelUtils.isStringSchema(schema)) { + if (objExample == null) { + // a BigDecimal: + if ("Number".equalsIgnoreCase(schema.getFormat())) { + example = "2"; + return fullPrefix + example + closeChars; + } else if (StringUtils.isNotBlank(schema.getPattern())) { + String pattern = schema.getPattern(); + /* + RxGen does not support our ECMA dialect https://github.com/curious-odd-man/RgxGen/issues/56 + So strip off the leading /, trailing / and trailing /i, and turn on ignore case if we have it + */ + Pattern valueExtractor = Pattern.compile("^/?(.+?)/?(i?)$"); + Matcher m = valueExtractor.matcher(pattern); + RgxGen rgxGen = null; + if (m.find()) { + int groupCount = m.groupCount(); + if (groupCount == 1) { + // only pattern found + String isolatedPattern = m.group(1); + rgxGen = new RgxGen(isolatedPattern); + } else if (groupCount == 2) { + // patterns and flag found + String isolatedPattern = m.group(1); + String flags = m.group(2); + if (flags.contains("i")) { + rgxGen = new RgxGen(isolatedPattern); + RgxGenProperties properties = new RgxGenProperties(); + RgxGenOption.CASE_INSENSITIVE.setInProperties(properties, true); + rgxGen.setProperties(properties); + } else { + rgxGen = new RgxGen(isolatedPattern); + } + } + } else { + rgxGen = new RgxGen(pattern); + } + + // this seed makes it so if we have [a-z] we pick a + Random random = new Random(18); + if (rgxGen != null) { + example = rgxGen.generate(random); + } else { + throw new RuntimeException("rgxGen cannot be null. Please open an issue in the openapi-generator github repo."); + } + } else if (schema.getMinLength() != null) { + example = ""; + int len = schema.getMinLength().intValue(); + for (int i = 0; i < len; i++) example += "a"; + } else if (ModelUtils.isUUIDSchema(schema)) { + example = "046b6c7f-0b8a-43b9-b35d-6489e6daee91"; + } else { + example = "string_example"; + } + } + return fullPrefix + ensureQuotes(example) + closeChars; + } else if (ModelUtils.isIntegerSchema(schema)) { + if (objExample == null) { + if (schema.getMinimum() != null) { + example = schema.getMinimum().toString(); + } else { + example = "1"; + } + } + return fullPrefix + example + closeChars; + } else if (ModelUtils.isNumberSchema(schema)) { + if (objExample == null) { + if (schema.getMinimum() != null) { + example = schema.getMinimum().toString(); + } else { + example = "3.14"; + } + } + return fullPrefix + example + closeChars; + } else if (ModelUtils.isArraySchema(schema)) { + ArraySchema arrayschema = (ArraySchema) schema; + Schema itemSchema = arrayschema.getItems(); + String itemModelName = getModelName(itemSchema); + if (objExample instanceof Iterable && itemModelName == null) { + // If the example is already a list, return it directly instead of wrongly wrap it in another list + return fullPrefix + objExample + closeChars; + } + Set newSeenSchemas = new HashSet<>(seenSchemas); + newSeenSchemas.add(schema); + example = fullPrefix + "[" + "\n" + toExampleValueRecursive(itemModelName, itemSchema, objExample, indentationLevel + 1, "", exampleLine + 1, newSeenSchemas) + ",\n" + closingIndentation + "]" + closeChars; + return example; + } else if (ModelUtils.isMapSchema(schema)) { + if (modelName == null) { + fullPrefix += "{"; + closeChars = "}"; + } + Object addPropsObj = schema.getAdditionalProperties(); + // TODO handle true case for additionalProperties + if (addPropsObj instanceof Schema) { + Schema addPropsSchema = (Schema) addPropsObj; + String key = "key"; + Object addPropsExample = getObjectExample(addPropsSchema); + if (addPropsSchema.getEnum() != null && !addPropsSchema.getEnum().isEmpty()) { + key = addPropsSchema.getEnum().get(0).toString(); + } + addPropsExample = exampleFromStringOrArraySchema(addPropsSchema, addPropsExample, key); + String addPropPrefix = key + "="; + if (modelName == null) { + addPropPrefix = ensureQuotes(key) + ": "; + } + String addPropsModelName = getModelName(addPropsSchema); + Set newSeenSchemas = new HashSet<>(seenSchemas); + newSeenSchemas.add(schema); + example = fullPrefix + "\n" + toExampleValueRecursive(addPropsModelName, addPropsSchema, addPropsExample, indentationLevel + 1, addPropPrefix, exampleLine + 1, newSeenSchemas) + ",\n" + closingIndentation + closeChars; + } else { + example = fullPrefix + closeChars; + } + return example; + } else if (ModelUtils.isObjectSchema(schema)) { + if (modelName == null) { + fullPrefix += "{"; + closeChars = "}"; + } + CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI); + if (disc != null) { + MappedModel mm = getDiscriminatorMappedModel(disc); + if (mm != null) { + String discPropNameValue = mm.getMappingName(); + String chosenModelName = mm.getModelName(); + // TODO handle this case in the future, this is when the discriminated + // schema allOf includes this schema, like Cat allOf includes Pet + // so this is the composed schema use case + } else { + return fullPrefix + closeChars; + } + } + Set newSeenSchemas = new HashSet<>(seenSchemas); + newSeenSchemas.add(schema); + String exampleForObjectModel = exampleForObjectModel(schema, fullPrefix, closeChars, null, indentationLevel, exampleLine, closingIndentation, newSeenSchemas); + return exampleForObjectModel; + } else if (ModelUtils.isComposedSchema(schema)) { + // TODO add examples for composed schema models without discriminators + + CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI); + if (disc != null) { + MappedModel mm = getDiscriminatorMappedModel(disc); + if (mm != null) { + String discPropNameValue = mm.getMappingName(); + String chosenModelName = mm.getModelName(); + Schema modelSchema = getModelNameToSchemaCache().get(chosenModelName); + CodegenProperty cp = new CodegenProperty(); + cp.setName(disc.getPropertyName()); + cp.setExample(discPropNameValue); + // Adds schema to seenSchemas before running example model function. removes schema after running + // the function. It also doesn't keep track of any schemas within the ObjectModel. + Set newSeenSchemas = new HashSet<>(seenSchemas); + newSeenSchemas.add(schema); + String exampleForObjectModel = exampleForObjectModel(modelSchema, fullPrefix, closeChars, cp, indentationLevel, exampleLine, closingIndentation, newSeenSchemas); + return exampleForObjectModel; + } else { + return fullPrefix + closeChars; + } + } + return fullPrefix + closeChars; + } else { + LOGGER.warn("Type {} not handled properly in toExampleValue", schema.getType()); + } + + return example; + } + + private String exampleForObjectModel(Schema schema, String fullPrefix, String closeChars, CodegenProperty discProp, int indentationLevel, int exampleLine, String closingIndentation, Set seenSchemas) { + Map requiredAndOptionalProps = schema.getProperties(); + if (requiredAndOptionalProps == null || requiredAndOptionalProps.isEmpty()) { + return fullPrefix + closeChars; + } + + String example = fullPrefix + "\n"; + for (Map.Entry entry : requiredAndOptionalProps.entrySet()) { + String propName = entry.getKey(); + Schema propSchema = entry.getValue(); + boolean readOnly = false; + if (propSchema.getReadOnly() != null) { + readOnly = propSchema.getReadOnly(); + } + if (readOnly) { + continue; + } + String ref = propSchema.get$ref(); + if (ref != null) { + Schema refSchema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); + if (refSchema.getReadOnly() != null) { + readOnly = refSchema.getReadOnly(); + } + if (readOnly) { + continue; + } + } + propName = toVarName(propName); + String propModelName = null; + Object propExample = null; + if (discProp != null && propName.equals(discProp.name)) { + propModelName = null; + propExample = discProp.example; + } else { + propModelName = getModelName(propSchema); + propExample = exampleFromStringOrArraySchema(propSchema, null, propName); + } + example += toExampleValueRecursive(propModelName, propSchema, propExample, indentationLevel + 1, propName + "=", exampleLine + 1, seenSchemas) + ",\n"; + } + // TODO handle additionalProperties also + example += closingIndentation + closeChars; + return example; + } + + private Object exampleFromStringOrArraySchema(Schema sc, Object currentExample, String propName) { + if (currentExample != null) { + return currentExample; + } + Schema schema = sc; + String ref = sc.get$ref(); + if (ref != null) { + schema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); + } + Object example = getObjectExample(schema); + if (example != null) { + return example; + } else if (simpleStringSchema(schema)) { + return propName + "_example"; + } else if (ModelUtils.isArraySchema(schema)) { + ArraySchema arraySchema = (ArraySchema) schema; + Schema itemSchema = arraySchema.getItems(); + example = getObjectExample(itemSchema); + if (example != null) { + return example; + } else if (simpleStringSchema(itemSchema)) { + return propName + "_example"; + } + } + return null; + } + + + /*** + * + * Set the codegenParameter example value + * We have a custom version of this function so we can invoke toExampleValue + * + * @param codegenParameter the item we are setting the example on + * @param parameter the base parameter that came from the spec + */ + @Override + public void setParameterExampleValue(CodegenParameter codegenParameter, Parameter parameter) { + Schema schema = parameter.getSchema(); + if (schema == null) { + LOGGER.warn("CodegenParameter.example defaulting to null because parameter lacks a schema"); + return; + } + + Object example = null; + if (codegenParameter.vendorExtensions != null && codegenParameter.vendorExtensions.containsKey("x-example")) { + example = codegenParameter.vendorExtensions.get("x-example"); + } else if (parameter.getExample() != null) { + example = parameter.getExample(); + } else if (parameter.getExamples() != null && !parameter.getExamples().isEmpty() && parameter.getExamples().values().iterator().next().getValue() != null) { + example = parameter.getExamples().values().iterator().next().getValue(); + } else { + example = getObjectExample(schema); + } + example = exampleFromStringOrArraySchema(schema, example, parameter.getName()); + String finalExample = toExampleValue(schema, example); + codegenParameter.example = finalExample; + } + + /** + * Return the example value of the parameter. + * + * @param codegenParameter Codegen parameter + * @param requestBody Request body + */ + @Override + public void setParameterExampleValue(CodegenParameter codegenParameter, RequestBody requestBody) { + if (codegenParameter.vendorExtensions != null && codegenParameter.vendorExtensions.containsKey("x-example")) { + codegenParameter.example = Json.pretty(codegenParameter.vendorExtensions.get("x-example")); + } + + Content content = requestBody.getContent(); + + if (content.size() > 1) { + // @see ModelUtils.getSchemaFromContent() + once(LOGGER).warn("Multiple MediaTypes found, using only the first one"); + } + + MediaType mediaType = content.values().iterator().next(); + Schema schema = mediaType.getSchema(); + if (schema == null) { + LOGGER.warn("CodegenParameter.example defaulting to null because requestBody content lacks a schema"); + return; + } + + Object example = null; + if (mediaType.getExample() != null) { + example = mediaType.getExample(); + } else if (mediaType.getExamples() != null && !mediaType.getExamples().isEmpty() && mediaType.getExamples().values().iterator().next().getValue() != null) { + example = mediaType.getExamples().values().iterator().next().getValue(); + } else { + example = getObjectExample(schema); + } + example = exampleFromStringOrArraySchema(schema, example, codegenParameter.paramName); + codegenParameter.example = toExampleValue(schema, example); + } + + /** + * Create a CodegenParameter for a Form Property + * We have a custom version of this method so we can invoke + * setParameterExampleValue(codegenParameter, parameter) + * rather than setParameterExampleValue(codegenParameter) + * This ensures that all of our samples are generated in + * toExampleValueRecursive + * + * @param name the property name + * @param propertySchema the property schema + * @param imports our import set + * @return the resultant CodegenParameter + */ + @Override + public CodegenParameter fromFormProperty(String name, Schema propertySchema, Set imports) { + CodegenParameter cp = super.fromFormProperty(name, propertySchema, imports); + Parameter p = new Parameter(); + p.setSchema(propertySchema); + p.setName(cp.paramName); + setParameterExampleValue(cp, p); + return cp; + } + + /** + * Return a map from model name to Schema for efficient lookup. + * + * @return map from model name to Schema. + */ + protected Map getModelNameToSchemaCache() { + if (modelNameToSchemaCache == null) { + // Create a cache to efficiently lookup schema based on model name. + Map m = new HashMap<>(); + ModelUtils.getSchemas(openAPI).forEach((key, schema) -> { + m.put(toModelName(key), schema); + }); + modelNameToSchemaCache = Collections.unmodifiableMap(m); + } + return modelNameToSchemaCache; + } + + @Override + public String generatorLanguageVersion() { return ">=3.6"; }; + + @Override + protected void addImport(ComposedSchema composed, Schema childSchema, CodegenModel model, String modelName ) { + // import everything (including child schema of a composed schema) + addImport(model, modelName); + } +} 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 55a1e66eb88d..11a9572215d3 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,7 +98,7 @@ org.openapitools.codegen.languages.ProtobufSchemaCodegen org.openapitools.codegen.languages.PythonLegacyClientCodegen org.openapitools.codegen.languages.PythonClientCodegen org.openapitools.codegen.languages.PythonFastAPIServerCodegen -org.openapitools.codegen.languages.PythonExperimentalClientCodegen +org.openapitools.codegen.languages.PythonPriorClientCodegen org.openapitools.codegen.languages.PythonFlaskConnexionServerCodegen org.openapitools.codegen.languages.PythonAiohttpConnexionServerCodegen org.openapitools.codegen.languages.PythonBluePlanetServerCodegen diff --git a/modules/openapi-generator/src/main/resources/python/README.mustache b/modules/openapi-generator/src/main/resources/python-prior/README.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/README.mustache rename to modules/openapi-generator/src/main/resources/python-prior/README.mustache diff --git a/modules/openapi-generator/src/main/resources/python/README_common.mustache b/modules/openapi-generator/src/main/resources/python-prior/README_common.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/README_common.mustache rename to modules/openapi-generator/src/main/resources/python-prior/README_common.mustache diff --git a/modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache b/modules/openapi-generator/src/main/resources/python-prior/README_onlypackage.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache rename to modules/openapi-generator/src/main/resources/python-prior/README_onlypackage.mustache diff --git a/modules/openapi-generator/src/main/resources/python/__init__.mustache b/modules/openapi-generator/src/main/resources/python-prior/__init__.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/__init__.mustache rename to modules/openapi-generator/src/main/resources/python-prior/__init__.mustache diff --git a/modules/openapi-generator/src/main/resources/python/__init__api.mustache b/modules/openapi-generator/src/main/resources/python-prior/__init__api.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/__init__api.mustache rename to modules/openapi-generator/src/main/resources/python-prior/__init__api.mustache diff --git a/modules/openapi-generator/src/main/resources/python/__init__apis.mustache b/modules/openapi-generator/src/main/resources/python-prior/__init__apis.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/__init__apis.mustache rename to modules/openapi-generator/src/main/resources/python-prior/__init__apis.mustache diff --git a/modules/openapi-generator/src/main/resources/python/__init__model.mustache b/modules/openapi-generator/src/main/resources/python-prior/__init__model.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/__init__model.mustache rename to modules/openapi-generator/src/main/resources/python-prior/__init__model.mustache diff --git a/modules/openapi-generator/src/main/resources/python/__init__models.mustache b/modules/openapi-generator/src/main/resources/python-prior/__init__models.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/__init__models.mustache rename to modules/openapi-generator/src/main/resources/python-prior/__init__models.mustache diff --git a/modules/openapi-generator/src/main/resources/python/__init__package.mustache b/modules/openapi-generator/src/main/resources/python-prior/__init__package.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/__init__package.mustache rename to modules/openapi-generator/src/main/resources/python-prior/__init__package.mustache diff --git a/modules/openapi-generator/src/main/resources/python/api.mustache b/modules/openapi-generator/src/main/resources/python-prior/api.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/api.mustache rename to modules/openapi-generator/src/main/resources/python-prior/api.mustache diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python-prior/api_client.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/api_client.mustache rename to modules/openapi-generator/src/main/resources/python-prior/api_client.mustache diff --git a/modules/openapi-generator/src/main/resources/python/api_doc.mustache b/modules/openapi-generator/src/main/resources/python-prior/api_doc.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/api_doc.mustache rename to modules/openapi-generator/src/main/resources/python-prior/api_doc.mustache diff --git a/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache b/modules/openapi-generator/src/main/resources/python-prior/api_doc_example.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/api_doc_example.mustache rename to modules/openapi-generator/src/main/resources/python-prior/api_doc_example.mustache diff --git a/modules/openapi-generator/src/main/resources/python/api_test.mustache b/modules/openapi-generator/src/main/resources/python-prior/api_test.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/api_test.mustache rename to modules/openapi-generator/src/main/resources/python-prior/api_test.mustache diff --git a/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache b/modules/openapi-generator/src/main/resources/python-prior/asyncio/rest.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache rename to modules/openapi-generator/src/main/resources/python-prior/asyncio/rest.mustache diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python-prior/configuration.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/configuration.mustache rename to modules/openapi-generator/src/main/resources/python-prior/configuration.mustache diff --git a/modules/openapi-generator/src/main/resources/python/exceptions.mustache b/modules/openapi-generator/src/main/resources/python-prior/exceptions.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/exceptions.mustache rename to modules/openapi-generator/src/main/resources/python-prior/exceptions.mustache diff --git a/modules/openapi-generator/src/main/resources/python/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/python-prior/git_push.sh.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/git_push.sh.mustache rename to modules/openapi-generator/src/main/resources/python-prior/git_push.sh.mustache diff --git a/modules/openapi-generator/src/main/resources/python/gitignore.mustache b/modules/openapi-generator/src/main/resources/python-prior/gitignore.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/gitignore.mustache rename to modules/openapi-generator/src/main/resources/python-prior/gitignore.mustache diff --git a/modules/openapi-generator/src/main/resources/python/gitlab-ci.mustache b/modules/openapi-generator/src/main/resources/python-prior/gitlab-ci.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/gitlab-ci.mustache rename to modules/openapi-generator/src/main/resources/python-prior/gitlab-ci.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model.mustache b/modules/openapi-generator/src/main/resources/python-prior/model.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_doc.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_doc.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_doc.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_doc.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/classvars.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/classvars.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/classvars.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/classvars.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/docstring_allowed.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/docstring_allowed.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/docstring_allowed.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/docstring_allowed.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/docstring_init_required_kwargs.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/docstring_init_required_kwargs.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/docstring_init_required_kwargs.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/docstring_init_required_kwargs.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/docstring_openapi_validations.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/docstring_openapi_validations.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/docstring_openapi_validations.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/docstring_openapi_validations.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/invalid_pos_args.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/invalid_pos_args.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/invalid_pos_args.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/invalid_pos_args.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/method_from_openapi_data_composed.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_composed.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/method_from_openapi_data_composed.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_composed.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/method_from_openapi_data_normal.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_normal.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/method_from_openapi_data_normal.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_normal.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/method_from_openapi_data_shared.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_shared.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/method_from_openapi_data_shared.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_shared.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/method_from_openapi_data_simple.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_simple.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/method_from_openapi_data_simple.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/method_from_openapi_data_simple.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/method_init_composed.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_composed.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/method_init_composed.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_composed.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/method_init_normal.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_normal.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/method_init_normal.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_normal.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/method_init_shared.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_shared.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/method_init_shared.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_shared.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/method_init_simple.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_simple.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/method_init_simple.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/method_init_simple.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/method_set_attribute.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/method_set_attribute.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/method_set_attribute.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/method_set_attribute.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/methods_setattr_getattr_composed.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_setattr_getattr_composed.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/methods_setattr_getattr_composed.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_setattr_getattr_composed.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/methods_setattr_getattr_normal.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_setattr_getattr_normal.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/methods_setattr_getattr_normal.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_setattr_getattr_normal.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/methods_shared.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_shared.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/methods_shared.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_shared.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/methods_todict_tostr_eq_shared.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_todict_tostr_eq_shared.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/methods_todict_tostr_eq_shared.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_todict_tostr_eq_shared.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/methods_tostr_eq_simple.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_tostr_eq_simple.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/methods_tostr_eq_simple.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/methods_tostr_eq_simple.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/model_composed.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/model_composed.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/model_composed.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/model_composed.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/model_normal.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/model_normal.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/model_normal.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/model_normal.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/model_simple.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/model_simple.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/model_simple.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/model_simple.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/validations.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_templates/validations.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_templates/validations.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_templates/validations.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_test.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_test.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_test.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_test.mustache diff --git a/modules/openapi-generator/src/main/resources/python/model_utils.mustache b/modules/openapi-generator/src/main/resources/python-prior/model_utils.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/model_utils.mustache rename to modules/openapi-generator/src/main/resources/python-prior/model_utils.mustache diff --git a/modules/openapi-generator/src/main/resources/python/partial_header.mustache b/modules/openapi-generator/src/main/resources/python-prior/partial_header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/partial_header.mustache rename to modules/openapi-generator/src/main/resources/python-prior/partial_header.mustache diff --git a/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache b/modules/openapi-generator/src/main/resources/python-prior/python_doc_auth_partial.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache rename to modules/openapi-generator/src/main/resources/python-prior/python_doc_auth_partial.mustache diff --git a/modules/openapi-generator/src/main/resources/python/requirements.mustache b/modules/openapi-generator/src/main/resources/python-prior/requirements.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/requirements.mustache rename to modules/openapi-generator/src/main/resources/python-prior/requirements.mustache diff --git a/modules/openapi-generator/src/main/resources/python/rest.mustache b/modules/openapi-generator/src/main/resources/python-prior/rest.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/rest.mustache rename to modules/openapi-generator/src/main/resources/python-prior/rest.mustache diff --git a/modules/openapi-generator/src/main/resources/python/setup.mustache b/modules/openapi-generator/src/main/resources/python-prior/setup.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/setup.mustache rename to modules/openapi-generator/src/main/resources/python-prior/setup.mustache diff --git a/modules/openapi-generator/src/main/resources/python/setup_cfg.mustache b/modules/openapi-generator/src/main/resources/python-prior/setup_cfg.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/setup_cfg.mustache rename to modules/openapi-generator/src/main/resources/python-prior/setup_cfg.mustache diff --git a/modules/openapi-generator/src/main/resources/python/signing.mustache b/modules/openapi-generator/src/main/resources/python-prior/signing.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/signing.mustache rename to modules/openapi-generator/src/main/resources/python-prior/signing.mustache diff --git a/modules/openapi-generator/src/main/resources/python/test-requirements.mustache b/modules/openapi-generator/src/main/resources/python-prior/test-requirements.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/test-requirements.mustache rename to modules/openapi-generator/src/main/resources/python-prior/test-requirements.mustache diff --git a/modules/openapi-generator/src/main/resources/python/tornado/rest.mustache b/modules/openapi-generator/src/main/resources/python-prior/tornado/rest.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/tornado/rest.mustache rename to modules/openapi-generator/src/main/resources/python-prior/tornado/rest.mustache diff --git a/modules/openapi-generator/src/main/resources/python/tox.mustache b/modules/openapi-generator/src/main/resources/python-prior/tox.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/tox.mustache rename to modules/openapi-generator/src/main/resources/python-prior/tox.mustache diff --git a/modules/openapi-generator/src/main/resources/python/travis.mustache b/modules/openapi-generator/src/main/resources/python-prior/travis.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/python/travis.mustache rename to modules/openapi-generator/src/main/resources/python-prior/travis.mustache diff --git a/modules/openapi-generator/src/main/resources/python-experimental/README.handlebars b/modules/openapi-generator/src/main/resources/python/README.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/README.handlebars rename to modules/openapi-generator/src/main/resources/python/README.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/README_common.handlebars b/modules/openapi-generator/src/main/resources/python/README_common.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/README_common.handlebars rename to modules/openapi-generator/src/main/resources/python/README_common.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/README_onlypackage.handlebars b/modules/openapi-generator/src/main/resources/python/README_onlypackage.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/README_onlypackage.handlebars rename to modules/openapi-generator/src/main/resources/python/README_onlypackage.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/__init__.handlebars b/modules/openapi-generator/src/main/resources/python/__init__.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/__init__.handlebars rename to modules/openapi-generator/src/main/resources/python/__init__.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/__init__apis.handlebars b/modules/openapi-generator/src/main/resources/python/__init__apis.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/__init__apis.handlebars rename to modules/openapi-generator/src/main/resources/python/__init__apis.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/__init__apis_tags.handlebars b/modules/openapi-generator/src/main/resources/python/__init__apis_tags.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/__init__apis_tags.handlebars rename to modules/openapi-generator/src/main/resources/python/__init__apis_tags.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/__init__model.handlebars b/modules/openapi-generator/src/main/resources/python/__init__model.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/__init__model.handlebars rename to modules/openapi-generator/src/main/resources/python/__init__model.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/__init__models.handlebars b/modules/openapi-generator/src/main/resources/python/__init__models.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/__init__models.handlebars rename to modules/openapi-generator/src/main/resources/python/__init__models.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/__init__package.handlebars b/modules/openapi-generator/src/main/resources/python/__init__package.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/__init__package.handlebars rename to modules/openapi-generator/src/main/resources/python/__init__package.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/__init__paths.handlebars b/modules/openapi-generator/src/main/resources/python/__init__paths.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/__init__paths.handlebars rename to modules/openapi-generator/src/main/resources/python/__init__paths.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/__init__paths_enum.handlebars b/modules/openapi-generator/src/main/resources/python/__init__paths_enum.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/__init__paths_enum.handlebars rename to modules/openapi-generator/src/main/resources/python/__init__paths_enum.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/__init__paths_x.handlebars b/modules/openapi-generator/src/main/resources/python/__init__paths_x.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/__init__paths_x.handlebars rename to modules/openapi-generator/src/main/resources/python/__init__paths_x.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/__init__test_paths.handlebars b/modules/openapi-generator/src/main/resources/python/__init__test_paths.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/__init__test_paths.handlebars rename to modules/openapi-generator/src/main/resources/python/__init__test_paths.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api.handlebars b/modules/openapi-generator/src/main/resources/python/api.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/api.handlebars rename to modules/openapi-generator/src/main/resources/python/api.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars b/modules/openapi-generator/src/main/resources/python/api_client.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars rename to modules/openapi-generator/src/main/resources/python/api_client.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api_doc.handlebars b/modules/openapi-generator/src/main/resources/python/api_doc.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/api_doc.handlebars rename to modules/openapi-generator/src/main/resources/python/api_doc.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api_doc_example.handlebars b/modules/openapi-generator/src/main/resources/python/api_doc_example.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/api_doc_example.handlebars rename to modules/openapi-generator/src/main/resources/python/api_doc_example.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api_doc_schema_type_hint.handlebars b/modules/openapi-generator/src/main/resources/python/api_doc_schema_type_hint.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/api_doc_schema_type_hint.handlebars rename to modules/openapi-generator/src/main/resources/python/api_doc_schema_type_hint.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api_test.handlebars b/modules/openapi-generator/src/main/resources/python/api_test.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/api_test.handlebars rename to modules/openapi-generator/src/main/resources/python/api_test.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api_test_partial.handlebars b/modules/openapi-generator/src/main/resources/python/api_test_partial.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/api_test_partial.handlebars rename to modules/openapi-generator/src/main/resources/python/api_test_partial.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/apis_path_module.handlebars b/modules/openapi-generator/src/main/resources/python/apis_path_module.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/apis_path_module.handlebars rename to modules/openapi-generator/src/main/resources/python/apis_path_module.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/apis_path_to_api.handlebars b/modules/openapi-generator/src/main/resources/python/apis_path_to_api.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/apis_path_to_api.handlebars rename to modules/openapi-generator/src/main/resources/python/apis_path_to_api.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/apis_tag_to_api.handlebars b/modules/openapi-generator/src/main/resources/python/apis_tag_to_api.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/apis_tag_to_api.handlebars rename to modules/openapi-generator/src/main/resources/python/apis_tag_to_api.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/comma.handlebars b/modules/openapi-generator/src/main/resources/python/comma.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/comma.handlebars rename to modules/openapi-generator/src/main/resources/python/comma.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/configuration.handlebars b/modules/openapi-generator/src/main/resources/python/configuration.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/configuration.handlebars rename to modules/openapi-generator/src/main/resources/python/configuration.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/doc_auth_partial.handlebars b/modules/openapi-generator/src/main/resources/python/doc_auth_partial.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/doc_auth_partial.handlebars rename to modules/openapi-generator/src/main/resources/python/doc_auth_partial.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/endpoint.handlebars b/modules/openapi-generator/src/main/resources/python/endpoint.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/endpoint.handlebars rename to modules/openapi-generator/src/main/resources/python/endpoint.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/endpoint_args.handlebars b/modules/openapi-generator/src/main/resources/python/endpoint_args.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/endpoint_args.handlebars rename to modules/openapi-generator/src/main/resources/python/endpoint_args.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/endpoint_args_passed.handlebars b/modules/openapi-generator/src/main/resources/python/endpoint_args_passed.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/endpoint_args_passed.handlebars rename to modules/openapi-generator/src/main/resources/python/endpoint_args_passed.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/endpoint_body_serialization.handlebars b/modules/openapi-generator/src/main/resources/python/endpoint_body_serialization.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/endpoint_body_serialization.handlebars rename to modules/openapi-generator/src/main/resources/python/endpoint_body_serialization.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/endpoint_parameter.handlebars b/modules/openapi-generator/src/main/resources/python/endpoint_parameter.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/endpoint_parameter.handlebars rename to modules/openapi-generator/src/main/resources/python/endpoint_parameter.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/endpoint_stub.handlebars b/modules/openapi-generator/src/main/resources/python/endpoint_stub.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/endpoint_stub.handlebars rename to modules/openapi-generator/src/main/resources/python/endpoint_stub.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/exceptions.handlebars b/modules/openapi-generator/src/main/resources/python/exceptions.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/exceptions.handlebars rename to modules/openapi-generator/src/main/resources/python/exceptions.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/git_push.sh.handlebars b/modules/openapi-generator/src/main/resources/python/git_push.sh.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/git_push.sh.handlebars rename to modules/openapi-generator/src/main/resources/python/git_push.sh.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/gitignore.handlebars b/modules/openapi-generator/src/main/resources/python/gitignore.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/gitignore.handlebars rename to modules/openapi-generator/src/main/resources/python/gitignore.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/gitlab-ci.handlebars b/modules/openapi-generator/src/main/resources/python/gitlab-ci.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/gitlab-ci.handlebars rename to modules/openapi-generator/src/main/resources/python/gitlab-ci.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model.handlebars b/modules/openapi-generator/src/main/resources/python/model.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model.handlebars rename to modules/openapi-generator/src/main/resources/python/model.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_doc.handlebars b/modules/openapi-generator/src/main/resources/python/model_doc.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_doc.handlebars rename to modules/openapi-generator/src/main/resources/python/model_doc.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_stub.handlebars b/modules/openapi-generator/src/main/resources/python/model_stub.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_stub.handlebars rename to modules/openapi-generator/src/main/resources/python/model_stub.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/classname.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/classname.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/classname.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/classname.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/composed_schemas.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/composed_schemas.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/composed_schemas.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/composed_schemas.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/dict_partial.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/dict_partial.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/dict_partial.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/dict_partial.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/enums.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/enums.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/enums.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/enums.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/format_base.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/format_base.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/format_base.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/format_base.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/imports_schema_types.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/imports_schema_types.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schemas.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/imports_schemas.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schemas.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/imports_schemas.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/list_partial.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/list_partial.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/list_partial.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/list_partial.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/new.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/new.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/new.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/new.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/notes_msg.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/notes_msg.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/notes_msg.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/notes_msg.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/payload_renderer.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/payload_renderer.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/payload_renderer.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/payload_renderer.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_getitems_with_addprops.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/property_getitems_with_addprops.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_getitems_with_addprops.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/property_getitems_with_addprops.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_getitems_with_addprops_getitem.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/property_getitems_with_addprops_getitem.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_getitems_with_addprops_getitem.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/property_getitems_with_addprops_getitem.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_getitems_without_addprops.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/property_getitems_without_addprops.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_getitems_without_addprops.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/property_getitems_without_addprops.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_type_hints.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/property_type_hints.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_type_hints.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/property_type_hints.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_type_hints_required.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/property_type_hints_required.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/property_type_hints_required.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/property_type_hints_required.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/schema.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/schema.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_accessed_types.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/schema_accessed_types.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_accessed_types.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/schema_accessed_types.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_composed_or_anytype.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/schema_composed_or_anytype.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_composed_or_anytype.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/schema_composed_or_anytype.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_dict.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/schema_dict.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_dict.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/schema_dict.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_list.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/schema_list.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_list.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/schema_list.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_python_types.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/schema_python_types.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_python_types.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/schema_python_types.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_simple.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/schema_simple.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_simple.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/schema_simple.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/validations.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/validations.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/validations.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/validations.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/var_equals_cls.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/var_equals_cls.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/var_equals_cls.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/var_equals_cls.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/xbase_schema.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/xbase_schema.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_templates/xbase_schema.handlebars rename to modules/openapi-generator/src/main/resources/python/model_templates/xbase_schema.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_test.handlebars b/modules/openapi-generator/src/main/resources/python/model_test.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/model_test.handlebars rename to modules/openapi-generator/src/main/resources/python/model_test.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/partial_header.handlebars b/modules/openapi-generator/src/main/resources/python/partial_header.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/partial_header.handlebars rename to modules/openapi-generator/src/main/resources/python/partial_header.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/requirements.handlebars b/modules/openapi-generator/src/main/resources/python/requirements.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/requirements.handlebars rename to modules/openapi-generator/src/main/resources/python/requirements.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/rest.handlebars b/modules/openapi-generator/src/main/resources/python/rest.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/rest.handlebars rename to modules/openapi-generator/src/main/resources/python/rest.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/schema_doc.handlebars b/modules/openapi-generator/src/main/resources/python/schema_doc.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/schema_doc.handlebars rename to modules/openapi-generator/src/main/resources/python/schema_doc.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars b/modules/openapi-generator/src/main/resources/python/schemas.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars rename to modules/openapi-generator/src/main/resources/python/schemas.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/setup.handlebars b/modules/openapi-generator/src/main/resources/python/setup.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/setup.handlebars rename to modules/openapi-generator/src/main/resources/python/setup.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/setup_cfg.handlebars b/modules/openapi-generator/src/main/resources/python/setup_cfg.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/setup_cfg.handlebars rename to modules/openapi-generator/src/main/resources/python/setup_cfg.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/signing.handlebars b/modules/openapi-generator/src/main/resources/python/signing.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/signing.handlebars rename to modules/openapi-generator/src/main/resources/python/signing.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/test-requirements.handlebars b/modules/openapi-generator/src/main/resources/python/test-requirements.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/test-requirements.handlebars rename to modules/openapi-generator/src/main/resources/python/test-requirements.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/tox.handlebars b/modules/openapi-generator/src/main/resources/python/tox.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/tox.handlebars rename to modules/openapi-generator/src/main/resources/python/tox.handlebars diff --git a/modules/openapi-generator/src/main/resources/python-experimental/travis.handlebars b/modules/openapi-generator/src/main/resources/python/travis.handlebars similarity index 100% rename from modules/openapi-generator/src/main/resources/python-experimental/travis.handlebars rename to modules/openapi-generator/src/main/resources/python/travis.handlebars diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index f1d1d182d132..cfdc60aa0aa5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -268,7 +268,7 @@ public void testDateTimeFormParameterHasDefaultValue() { @Test public void testOriginalOpenApiDocumentVersion() { // Test with OAS 2.0 document. - String location = "src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml"; + String location = "src/test/resources/2_0/python-prior/petstore-with-fake-endpoints-models-for-testing.yaml"; OpenAPI openAPI = TestUtils.parseFlattenSpec(location); SemVer version = ModelUtils.getOpenApiVersion(openAPI, location, null); Assert.assertEquals(version, new SemVer("2.0.0")); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java index dd11b886a9a6..f4ed0384bfbf 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PythonClientOptionsProvider.java @@ -19,7 +19,7 @@ import com.google.common.collect.ImmutableMap; import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.languages.PythonClientCodegen; +import org.openapitools.codegen.languages.PythonPriorClientCodegen; import java.util.Map; @@ -42,7 +42,7 @@ public String getLanguage() { @Override public Map createOptions() { ImmutableMap.Builder builder = new ImmutableMap.Builder(); - return builder.put(PythonClientCodegen.PACKAGE_URL, PACKAGE_URL_VALUE) + return builder.put(PythonPriorClientCodegen.PACKAGE_URL, PACKAGE_URL_VALUE) .put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE) .put(CodegenConstants.PROJECT_NAME, PROJECT_NAME_VALUE) .put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE) @@ -50,9 +50,9 @@ public Map createOptions() { .put(CodegenConstants.SOURCECODEONLY_GENERATION, "false") .put(CodegenConstants.LIBRARY, "urllib3") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT) - .put(PythonClientCodegen.USE_NOSE, USE_NOSE_VALUE) - .put(PythonClientCodegen.RECURSION_LIMIT, RECURSION_LIMIT) - .put(PythonClientCodegen.PYTHON_ATTR_NONE_IF_UNSET, PYTHON_ATTR_NONE_IF_UNSET) + .put(PythonPriorClientCodegen.USE_NOSE, USE_NOSE_VALUE) + .put(PythonPriorClientCodegen.RECURSION_LIMIT, RECURSION_LIMIT) + .put(PythonPriorClientCodegen.PYTHON_ATTR_NONE_IF_UNSET, PYTHON_ATTR_NONE_IF_UNSET) .put(CodegenConstants.INIT_REQUIRED_VARS, INIT_REQUIRED_VARS) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientTest.java index 2ff86d741d6e..56b5d92a79a7 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientTest.java @@ -15,548 +15,105 @@ */ package org.openapitools.codegen.python; -import com.google.common.io.Resources; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import org.openapitools.codegen.config.CodegenConfigurator; -import com.google.common.collect.Sets; +import com.google.common.io.Resources; 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 java.io.File; -import java.math.BigDecimal; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import org.openapitools.codegen.*; import org.openapitools.codegen.languages.PythonClientCodegen; import org.openapitools.codegen.utils.ModelUtils; import org.testng.Assert; -import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import java.io.IOException; +import java.nio.charset.StandardCharsets; + @SuppressWarnings("static-method") public class PythonClientTest { - @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 PythonClientCodegen(); - 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, "post", 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 PythonClientCodegen(); - 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 PythonClientCodegen(); - 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, "[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 PythonClientCodegen(); - 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, "{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 DefaultCodegen codegen = new PythonClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPI(); - final Schema model = new Schema() - .description("a sample model") - .addProperties("children", new Schema().$ref("#/components/schemas/Children")); - final Schema children = new Schema() - .type("object") - .addProperties("number", new Schema().type("integer")); - openAPI.getComponents().addSchemas("sample", model); - openAPI.getComponents().addSchemas("Children", children); - 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 DefaultCodegen codegen = new PythonClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPI(); - final Schema model = new Schema() - .description("a sample model") - .addProperties("children", new ArraySchema() - .items(new Schema().$ref("#/components/schemas/Children"))); - final Schema children = new Schema() - .type("object") - .addProperties("number", new Schema().type("integer")); - openAPI.getComponents().addSchemas("sample", model); - openAPI.getComponents().addSchemas("Children", children); - 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, "[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 DefaultCodegen codegen = new PythonClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPI(); - final Schema model = new Schema() - .description("a sample model") - .addProperties("children", new MapSchema() - .additionalProperties(new Schema().$ref("#/components/schemas/Children"))); - final Schema children = new Schema() - .type("object") - .addProperties("number", new Schema().type("integer")); - openAPI.getComponents().addSchemas("sample", model); - openAPI.getComponents().addSchemas("Children", children); - 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, "{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); - } - + @Test(description = "tests RecursiveExampleValueWithCycle") + public void testRecursiveExampleValueWithCycle() throws Exception { - // should not start with 'null'. need help from the community to investigate further - @Test(description = "convert an array model") - public void arrayModelTest() { + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/issue_7532.yaml"); final PythonClientCodegen codegen = new PythonClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPI(); - - final Schema model = new ArraySchema() - .items(new Schema().$ref("#/components/schemas/Children")) - .description("an array model"); - final Schema children = new Schema() - .type("object") - .addProperties("number", new Schema().type("integer")); - openAPI.getComponents().addSchemas("sample", model); - openAPI.getComponents().addSchemas("Children", children); - codegen.setOpenAPI(openAPI); - - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.classVarName, "sample"); - Assert.assertEquals(cm.description, "an array model"); - Assert.assertEquals(cm.vars.size(), 0); // the array model has no vars - Assert.assertEquals(cm.parent, "list"); - Assert.assertEquals(cm.imports.size(), 1); - Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1); - - final Map childExample = new HashMap<>(); - childExample.put("number", 3); - final List> example = Arrays.asList(childExample); - String exampleValue = codegen.toExampleValue(model, example); - Assert.assertEquals("[Children(number=1,),]", exampleValue.replaceAll("\\s+","")); - } - - // should not start with 'null'. need help from the community to investigate further - @Test(description = "convert a map model") - public void mapModelTest() { - final DefaultCodegen codegen = new PythonClientCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPI(); - final Schema sample = new Schema() - .description("a map model") - .additionalProperties(new Schema().$ref("#/components/schemas/Children")); - final Schema children = new Schema() - .type("object") - .addProperties("number", new Schema().type("integer")); - openAPI.getComponents().addSchemas("sample", sample); - openAPI.getComponents().addSchemas("Children", children); codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", sample); - - 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(), 1); - } - - @Test(description = "parse date and date-time example value") - public void parseDateAndDateTimeExamplesTest() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml"); - final DefaultCodegen codegen = new PythonClientCodegen(); + Schema schemaWithCycleInTreesProperty = openAPI.getComponents().getSchemas().get("Forest"); + String exampleValue = codegen.toExampleValue(schemaWithCycleInTreesProperty, null); - Schema modelSchema = ModelUtils.getSchema(openAPI, "DateTimeTest"); - String defaultValue = codegen.toDefaultValue(modelSchema); - Assert.assertEquals(defaultValue, "dateutil_parser('2010-01-01T10:10:10.000111+01:00')"); - } - - @Test(description = "format imports of models containing special characters") - public void importSpecialModelNameTest() { - final PythonClientCodegen codegen = new PythonClientCodegen(); - - String importValue = codegen.toModelImport("special.ModelName"); - Assert.assertEquals(importValue, "from models.special_model_name import SpecialModelName"); + String expectedValue = Resources.toString( + Resources.getResource("3_0/issue_7532_tree_example_value_expected.txt"), + StandardCharsets.UTF_8); + expectedValue = expectedValue.replaceAll("\\r\\n", "\n"); + Assert.assertEquals(exampleValue.trim(), expectedValue.trim()); } - @Test(description = "format imports of models containing special characters") - public void defaultSettingInPrimitiveModelWithValidations() { + @Test + public void testSpecWithTooLowVersionThrowsException() throws RuntimeException { + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/2_0/petstore.yaml"); final PythonClientCodegen codegen = new PythonClientCodegen(); - - OpenAPI openAPI = TestUtils.createOpenAPI(); - final Schema noDefault = new Schema() - .type("number") - .minimum(new BigDecimal("10")); - final Schema hasDefault = new Schema() - .type("number") - .minimum(new BigDecimal("10")); - hasDefault.setDefault("15.0"); - final Schema noDefaultEumLengthOne = new Schema() - .type("number") - .minimum(new BigDecimal("10")); - noDefaultEumLengthOne.setEnum(Arrays.asList("15.0")); - openAPI.getComponents().addSchemas("noDefaultModel", noDefault); - openAPI.getComponents().addSchemas("hasDefaultModel", hasDefault); - openAPI.getComponents().addSchemas("noDefaultEumLengthOneModel", noDefaultEumLengthOne); - codegen.setOpenAPI(openAPI); - - final CodegenModel noDefaultModel = codegen.fromModel("noDefaultModel", noDefault); - Assert.assertEquals(noDefaultModel.defaultValue, null); - Assert.assertEquals(noDefaultModel.hasRequired, true); - - final CodegenModel hasDefaultModel = codegen.fromModel("hasDefaultModel", hasDefault); - Assert.assertEquals(hasDefaultModel.defaultValue, "15.0"); - Assert.assertEquals(hasDefaultModel.hasRequired, false); - - final CodegenModel noDefaultEumLengthOneModel = codegen.fromModel("noDefaultEumLengthOneModel", noDefaultEumLengthOne); - Assert.assertEquals(noDefaultEumLengthOneModel.defaultValue, "15.0"); - Assert.assertEquals(noDefaultEumLengthOneModel.hasRequired, false); + codegen.preprocessOpenAPI(openAPI); } @Test - public void testObjectModelWithRefedAdditionalPropertiesIsGenerated() throws Exception { - File output = Files.createTempDirectory("test").toFile(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("python") - .setInputSpec("src/test/resources/3_0/issue_7372.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - TestUtils.ensureContainsFile(files, output, "openapi_client/model/a.py"); - TestUtils.ensureContainsFile(files, output, "openapi_client/model/b.py"); - output.deleteOnExit(); + public void testSpecWithAcceptableVersion() { + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/petstore.yaml"); + final PythonClientCodegen codegen = new PythonClientCodegen(); + codegen.preprocessOpenAPI(openAPI); + Assert.assertEquals(openAPI.getOpenapi() , "3.0.0"); + Assert.assertTrue(openAPI.getExtensions() == null); } @Test - public void testFreeFormSchemas() throws Exception { - File output = Files.createTempDirectory("test").toFile(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("python") - .setInputSpec("src/test/resources/3_0/issue_7361.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - TestUtils.ensureContainsFile(files, output, "openapi_client/model/free_form_with_validation.py"); - TestUtils.ensureContainsFile(files, output, "openapi_client/model/free_form_interface.py"); - TestUtils.ensureDoesNotContainsFile(files, output, "openapi_client/model/free_form.py"); - output.deleteOnExit(); + public void testSpecWithAcceptableVersionAndExtension() { + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/issue_12196.yaml"); + final PythonClientCodegen codegen = new PythonClientCodegen(); + codegen.preprocessOpenAPI(openAPI); + Assert.assertEquals(openAPI.getOpenapi() , "3.0.0"); + Assert.assertFalse(openAPI.getExtensions().isEmpty()); + Assert.assertFalse(openAPI.getExtensions().containsValue("x-original-swagger-version")); } - @Test(description = "tests ObjectWithValidations") - public void testObjectWithValidations() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7361.yaml"); - final DefaultCodegen codegen = new PythonClientCodegen(); - codegen.setOpenAPI(openAPI); + @Test(description = "tests GeoJson Example for GeoJsonGeometry") + public void testRecursiveGeoJsonExampleWhenTypeIsGeoJsonGeometry() throws IOException { - String modelName = "FreeFormWithValidation"; - Schema modelSchema = ModelUtils.getSchema(openAPI, modelName); - final CodegenModel model = codegen.fromModel(modelName, modelSchema); - Assert.assertEquals((int) model.getMinProperties(), 1); - } - - @Test(description = "tests RegexObjects") - public void testRegexObjects() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_11521.yaml"); - final DefaultCodegen codegen = new PythonClientCodegen(); - codegen.setOpenAPI(openAPI); + testEndpointExampleValue("/geojson", + "src/test/resources/3_0/issue_13043_recursive_model.yaml", + "3_0/issue_13043_recursive_model_expected_value.txt"); - String modelName = "DateTimeObject"; - Schema modelSchema = ModelUtils.getSchema(openAPI, modelName); - final CodegenModel model = codegen.fromModel(modelName, modelSchema); - final CodegenProperty property1 = model.vars.get(0); - Assert.assertEquals(property1.baseName, "datetime"); - Assert.assertEquals(property1.pattern, "/[\\d]{4}-[\\d]{2}-[\\d]{2}T[\\d]{1,2}:[\\d]{2}Z/"); - Assert.assertEquals(property1.vendorExtensions.get("x-regex"), "[\\d]{4}-[\\d]{2}-[\\d]{2}T[\\d]{1,2}:[\\d]{2}Z"); - // ignore warnings, should be the same as in issue_11521.yaml - Pattern pattern = Pattern.compile("[\\d]{4}-[\\d]{2}-[\\d]{2}T[\\d]{1,2}:[\\d]{2}Z"); - Matcher matcher = pattern.matcher(property1.example); - Assert.assertTrue(matcher.find()); } - @Test(description = "tests uuid example works even if a pattern is provided") - public void testUuidExampleWorksEvenIfPatternIsDefined() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issues_13069.yaml"); - final DefaultCodegen codegen = new PythonClientCodegen(); - codegen.setOpenAPI(openAPI); - - Operation operation = openAPI.getPaths().get("/test").getGet(); - CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - codegen.setParameterExampleValue(codegenParameter, operation.getParameters().get(0)); + @Test(description = "tests GeoJson Example for GeometryCollection") + public void testRecursiveGeoJsonExampleWhenTypeIsGeometryCollection() throws IOException { - String modelName = "UUID"; - Schema modelSchema = ModelUtils.getSchema(openAPI, modelName); - final CodegenModel model = codegen.fromModel(modelName, modelSchema); + testEndpointExampleValue("/geojson_geometry_collection", + "src/test/resources/3_0/issue_13043_recursive_model.yaml", + "3_0/issue_13043_geometry_collection_expected_value.txt"); - Pattern pattern = Pattern.compile("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"); - Matcher matcher = pattern.matcher(codegenParameter.example); - Assert.assertTrue(matcher.find()); } - @Test(description = "tests RecursiveToExample") - public void testRecursiveToExample() throws IOException { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_8052_recursive_model.yaml"); + private void testEndpointExampleValue(String endpoint, String specFilePath, String expectedAnswerPath) throws IOException { + final OpenAPI openAPI = TestUtils.parseFlattenSpec(specFilePath); final PythonClientCodegen codegen = new PythonClientCodegen(); codegen.setOpenAPI(openAPI); - final Operation operation = openAPI.getPaths().get("/geojson").getPost(); + final Operation operation = openAPI.getPaths().get(endpoint).getPost(); Schema schema = ModelUtils.getSchemaFromRequestBody(operation.getRequestBody()); String exampleValue = codegen.toExampleValue(schema, null); // uncomment if you need to regenerate the expected value - // PrintWriter printWriter = new PrintWriter("src/test/resources/3_0/issue_8052_recursive_model_expected_value.txt"); + // PrintWriter printWriter = new PrintWriter("src/test/resources/" + expectedAnswerPath); // printWriter.write(exampleValue); // printWriter.close(); // org.junit.Assert.assertTrue(false); String expectedValue = Resources.toString( - Resources.getResource("3_0/issue_8052_recursive_model_expected_value.txt"), + Resources.getResource(expectedAnswerPath), StandardCharsets.UTF_8); expectedValue = expectedValue.replaceAll("\\r\\n", "\n"); - - Assert.assertEquals(exampleValue.trim(), expectedValue.trim()); } - @Test(description = "tests NoProxyPyClient") - public void testNoProxyPyClient() throws Exception { - - final String gen = "python"; - final String spec = "src/test/resources/3_0/petstore.yaml"; - - File output = Files.createTempDirectory("test").toFile(); - final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName(gen) - .setInputSpec(spec) - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - for (String f : new String[] { "openapi_client/configuration.py", "openapi_client/rest.py" } ) { - TestUtils.ensureContainsFile(files, output, f); - Path p = output.toPath().resolve(f); - TestUtils.assertFileContains(p, "no_proxy"); - } - } - - @DataProvider - public Object[][] testToModelData() { - return new Object[][] { - new Object[] {"", "", "foo", "Foo"}, - new Object[] {"Abc", "", "foo", "AbcFoo"}, - new Object[] {"", "Abc", "foo", "FooAbc"}, - new Object[] {"Abc", "Xyz", "foo", "AbcFooXyz"}, - - new Object[] {"", "", "1", "Model1"}, - new Object[] {"Abc", "", "1", "Abc1"}, - new Object[] {"", "Abc", "1", "Model1Abc"}, - new Object[] {"Abc", "Xyz", "1", "Abc1Xyz"}, - - new Object[] {"", "", "and", "ModelAnd"}, - new Object[] {"Abc", "", "and", "AbcAnd"}, - new Object[] {"", "Abc", "and", "AndAbc"}, - new Object[] {"Abc", "Xyz", "and", "AbcAndXyz"}, - }; - } - - @Test(dataProvider = "testToModelData") - public void testToModel(String prefix, String suffix, String input, String want) { - PythonClientCodegen codegen = new PythonClientCodegen(); - codegen.setModelNamePrefix(prefix); - codegen.setModelNameSuffix(suffix); - Assert.assertEquals(codegen.toModelName(input), want); - } - - } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonExperimentalClientTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonExperimentalClientTest.java deleted file mode 100644 index 284d3c415f7d..000000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonExperimentalClientTest.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * - * 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.io.Resources; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.*; -import java.io.PrintWriter; -import org.openapitools.codegen.*; -import org.openapitools.codegen.languages.PythonExperimentalClientCodegen; -import org.openapitools.codegen.utils.ModelUtils; -import org.testng.Assert; -import org.testng.annotations.Test; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import org.testng.reporters.jq.Model; - -@SuppressWarnings("static-method") -public class PythonExperimentalClientTest { - - @Test(description = "tests RecursiveExampleValueWithCycle") - public void testRecursiveExampleValueWithCycle() throws Exception { - - final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/issue_7532.yaml"); - final PythonExperimentalClientCodegen codegen = new PythonExperimentalClientCodegen(); - codegen.setOpenAPI(openAPI); - Schema schemaWithCycleInTreesProperty = openAPI.getComponents().getSchemas().get("Forest"); - String exampleValue = codegen.toExampleValue(schemaWithCycleInTreesProperty, null); - - String expectedValue = Resources.toString( - Resources.getResource("3_0/issue_7532_tree_example_value_expected.txt"), - StandardCharsets.UTF_8); - expectedValue = expectedValue.replaceAll("\\r\\n", "\n"); - Assert.assertEquals(exampleValue.trim(), expectedValue.trim()); - } - - @Test - public void testSpecWithTooLowVersionThrowsException() throws RuntimeException { - final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/2_0/petstore.yaml"); - final PythonExperimentalClientCodegen codegen = new PythonExperimentalClientCodegen(); - codegen.preprocessOpenAPI(openAPI); - } - - @Test - public void testSpecWithAcceptableVersion() { - final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/petstore.yaml"); - final PythonExperimentalClientCodegen codegen = new PythonExperimentalClientCodegen(); - codegen.preprocessOpenAPI(openAPI); - Assert.assertEquals(openAPI.getOpenapi() , "3.0.0"); - Assert.assertTrue(openAPI.getExtensions() == null); - } - - @Test - public void testSpecWithAcceptableVersionAndExtension() { - final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/issue_12196.yaml"); - final PythonExperimentalClientCodegen codegen = new PythonExperimentalClientCodegen(); - codegen.preprocessOpenAPI(openAPI); - Assert.assertEquals(openAPI.getOpenapi() , "3.0.0"); - Assert.assertFalse(openAPI.getExtensions().isEmpty()); - Assert.assertFalse(openAPI.getExtensions().containsValue("x-original-swagger-version")); - } - - @Test(description = "tests GeoJson Example for GeoJsonGeometry") - public void testRecursiveGeoJsonExampleWhenTypeIsGeoJsonGeometry() throws IOException { - - testEndpointExampleValue("/geojson", - "src/test/resources/3_0/issue_13043_recursive_model.yaml", - "3_0/issue_13043_recursive_model_expected_value.txt"); - - - } - - @Test(description = "tests GeoJson Example for GeometryCollection") - public void testRecursiveGeoJsonExampleWhenTypeIsGeometryCollection() throws IOException { - - testEndpointExampleValue("/geojson_geometry_collection", - "src/test/resources/3_0/issue_13043_recursive_model.yaml", - "3_0/issue_13043_geometry_collection_expected_value.txt"); - - } - - private void testEndpointExampleValue(String endpoint, String specFilePath, String expectedAnswerPath) throws IOException { - final OpenAPI openAPI = TestUtils.parseFlattenSpec(specFilePath); - final PythonExperimentalClientCodegen codegen = new PythonExperimentalClientCodegen(); - codegen.setOpenAPI(openAPI); - - final Operation operation = openAPI.getPaths().get(endpoint).getPost(); - Schema schema = ModelUtils.getSchemaFromRequestBody(operation.getRequestBody()); - String exampleValue = codegen.toExampleValue(schema, null); - - // uncomment if you need to regenerate the expected value - // PrintWriter printWriter = new PrintWriter("src/test/resources/" + expectedAnswerPath); - // printWriter.write(exampleValue); - // printWriter.close(); - // org.junit.Assert.assertTrue(false); - - String expectedValue = Resources.toString( - Resources.getResource(expectedAnswerPath), - StandardCharsets.UTF_8); - expectedValue = expectedValue.replaceAll("\\r\\n", "\n"); - Assert.assertEquals(exampleValue.trim(), expectedValue.trim()); - - } - -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPriorClientOptionsTest.java similarity index 86% rename from modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java rename to modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPriorClientOptionsTest.java index e423c6e85842..6c26a85ff905 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPriorClientOptionsTest.java @@ -19,7 +19,7 @@ import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.languages.PythonClientCodegen; +import org.openapitools.codegen.languages.PythonPriorClientCodegen; import org.openapitools.codegen.options.PythonClientOptionsProvider; import org.testng.Assert; @@ -28,10 +28,10 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; -public class PythonClientOptionsTest extends AbstractOptionsTest { - private PythonClientCodegen clientCodegen = mock(PythonClientCodegen.class, mockSettings); +public class PythonPriorClientOptionsTest extends AbstractOptionsTest { + private PythonPriorClientCodegen clientCodegen = mock(PythonPriorClientCodegen.class, mockSettings); - public PythonClientOptionsTest() { + public PythonPriorClientOptionsTest() { super(new PythonClientOptionsProvider()); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPriorClientTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPriorClientTest.java new file mode 100644 index 000000000000..df88361a53dd --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPriorClientTest.java @@ -0,0 +1,562 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * 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.io.Resources; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import org.openapitools.codegen.config.CodegenConfigurator; + +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 java.io.File; +import java.math.BigDecimal; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.codegen.*; +import org.openapitools.codegen.languages.PythonPriorClientCodegen; +import org.openapitools.codegen.utils.ModelUtils; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +@SuppressWarnings("static-method") +public class PythonPriorClientTest { + + @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 PythonPriorClientCodegen(); + 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, "post", 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 PythonPriorClientCodegen(); + 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 PythonPriorClientCodegen(); + 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, "[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 PythonPriorClientCodegen(); + 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, "{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 DefaultCodegen codegen = new PythonPriorClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPI(); + final Schema model = new Schema() + .description("a sample model") + .addProperties("children", new Schema().$ref("#/components/schemas/Children")); + final Schema children = new Schema() + .type("object") + .addProperties("number", new Schema().type("integer")); + openAPI.getComponents().addSchemas("sample", model); + openAPI.getComponents().addSchemas("Children", children); + 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 DefaultCodegen codegen = new PythonPriorClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPI(); + final Schema model = new Schema() + .description("a sample model") + .addProperties("children", new ArraySchema() + .items(new Schema().$ref("#/components/schemas/Children"))); + final Schema children = new Schema() + .type("object") + .addProperties("number", new Schema().type("integer")); + openAPI.getComponents().addSchemas("sample", model); + openAPI.getComponents().addSchemas("Children", children); + 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, "[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 DefaultCodegen codegen = new PythonPriorClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPI(); + final Schema model = new Schema() + .description("a sample model") + .addProperties("children", new MapSchema() + .additionalProperties(new Schema().$ref("#/components/schemas/Children"))); + final Schema children = new Schema() + .type("object") + .addProperties("number", new Schema().type("integer")); + openAPI.getComponents().addSchemas("sample", model); + openAPI.getComponents().addSchemas("Children", children); + 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, "{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 PythonPriorClientCodegen codegen = new PythonPriorClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPI(); + + final Schema model = new ArraySchema() + .items(new Schema().$ref("#/components/schemas/Children")) + .description("an array model"); + final Schema children = new Schema() + .type("object") + .addProperties("number", new Schema().type("integer")); + openAPI.getComponents().addSchemas("sample", model); + openAPI.getComponents().addSchemas("Children", children); + codegen.setOpenAPI(openAPI); + + final CodegenModel cm = codegen.fromModel("sample", model); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.classVarName, "sample"); + Assert.assertEquals(cm.description, "an array model"); + Assert.assertEquals(cm.vars.size(), 0); // the array model has no vars + Assert.assertEquals(cm.parent, "list"); + Assert.assertEquals(cm.imports.size(), 1); + Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1); + + final Map childExample = new HashMap<>(); + childExample.put("number", 3); + final List> example = Arrays.asList(childExample); + String exampleValue = codegen.toExampleValue(model, example); + Assert.assertEquals("[Children(number=1,),]", exampleValue.replaceAll("\\s+","")); + } + + // should not start with 'null'. need help from the community to investigate further + @Test(description = "convert a map model") + public void mapModelTest() { + final DefaultCodegen codegen = new PythonPriorClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPI(); + final Schema sample = new Schema() + .description("a map model") + .additionalProperties(new Schema().$ref("#/components/schemas/Children")); + final Schema children = new Schema() + .type("object") + .addProperties("number", new Schema().type("integer")); + openAPI.getComponents().addSchemas("sample", sample); + openAPI.getComponents().addSchemas("Children", children); + codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", sample); + + 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(), 1); + } + + @Test(description = "parse date and date-time example value") + public void parseDateAndDateTimeExamplesTest() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/python-prior/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml"); + final DefaultCodegen codegen = new PythonPriorClientCodegen(); + + Schema modelSchema = ModelUtils.getSchema(openAPI, "DateTimeTest"); + String defaultValue = codegen.toDefaultValue(modelSchema); + Assert.assertEquals(defaultValue, "dateutil_parser('2010-01-01T10:10:10.000111+01:00')"); + } + + @Test(description = "format imports of models containing special characters") + public void importSpecialModelNameTest() { + final PythonPriorClientCodegen codegen = new PythonPriorClientCodegen(); + + String importValue = codegen.toModelImport("special.ModelName"); + Assert.assertEquals(importValue, "from models.special_model_name import SpecialModelName"); + } + + @Test(description = "format imports of models containing special characters") + public void defaultSettingInPrimitiveModelWithValidations() { + final PythonPriorClientCodegen codegen = new PythonPriorClientCodegen(); + + OpenAPI openAPI = TestUtils.createOpenAPI(); + final Schema noDefault = new Schema() + .type("number") + .minimum(new BigDecimal("10")); + final Schema hasDefault = new Schema() + .type("number") + .minimum(new BigDecimal("10")); + hasDefault.setDefault("15.0"); + final Schema noDefaultEumLengthOne = new Schema() + .type("number") + .minimum(new BigDecimal("10")); + noDefaultEumLengthOne.setEnum(Arrays.asList("15.0")); + openAPI.getComponents().addSchemas("noDefaultModel", noDefault); + openAPI.getComponents().addSchemas("hasDefaultModel", hasDefault); + openAPI.getComponents().addSchemas("noDefaultEumLengthOneModel", noDefaultEumLengthOne); + codegen.setOpenAPI(openAPI); + + final CodegenModel noDefaultModel = codegen.fromModel("noDefaultModel", noDefault); + Assert.assertEquals(noDefaultModel.defaultValue, null); + Assert.assertEquals(noDefaultModel.hasRequired, true); + + final CodegenModel hasDefaultModel = codegen.fromModel("hasDefaultModel", hasDefault); + Assert.assertEquals(hasDefaultModel.defaultValue, "15.0"); + Assert.assertEquals(hasDefaultModel.hasRequired, false); + + final CodegenModel noDefaultEumLengthOneModel = codegen.fromModel("noDefaultEumLengthOneModel", noDefaultEumLengthOne); + Assert.assertEquals(noDefaultEumLengthOneModel.defaultValue, "15.0"); + Assert.assertEquals(noDefaultEumLengthOneModel.hasRequired, false); + } + + @Test + public void testObjectModelWithRefedAdditionalPropertiesIsGenerated() throws Exception { + File output = Files.createTempDirectory("test").toFile(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("python") + .setInputSpec("src/test/resources/3_0/issue_7372.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + + TestUtils.ensureContainsFile(files, output, "openapi_client/model/a.py"); + TestUtils.ensureContainsFile(files, output, "openapi_client/model/b.py"); + output.deleteOnExit(); + } + + @Test + public void testFreeFormSchemas() throws Exception { + File output = Files.createTempDirectory("test").toFile(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("python-prior") + .setInputSpec("src/test/resources/3_0/issue_7361.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + + TestUtils.ensureContainsFile(files, output, "openapi_client/model/free_form_with_validation.py"); + TestUtils.ensureContainsFile(files, output, "openapi_client/model/free_form_interface.py"); + TestUtils.ensureDoesNotContainsFile(files, output, "openapi_client/model/free_form.py"); + output.deleteOnExit(); + } + + @Test(description = "tests ObjectWithValidations") + public void testObjectWithValidations() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7361.yaml"); + final DefaultCodegen codegen = new PythonPriorClientCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName = "FreeFormWithValidation"; + Schema modelSchema = ModelUtils.getSchema(openAPI, modelName); + final CodegenModel model = codegen.fromModel(modelName, modelSchema); + Assert.assertEquals((int) model.getMinProperties(), 1); + } + + @Test(description = "tests RegexObjects") + public void testRegexObjects() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_11521.yaml"); + final DefaultCodegen codegen = new PythonPriorClientCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName = "DateTimeObject"; + Schema modelSchema = ModelUtils.getSchema(openAPI, modelName); + final CodegenModel model = codegen.fromModel(modelName, modelSchema); + final CodegenProperty property1 = model.vars.get(0); + Assert.assertEquals(property1.baseName, "datetime"); + Assert.assertEquals(property1.pattern, "/[\\d]{4}-[\\d]{2}-[\\d]{2}T[\\d]{1,2}:[\\d]{2}Z/"); + Assert.assertEquals(property1.vendorExtensions.get("x-regex"), "[\\d]{4}-[\\d]{2}-[\\d]{2}T[\\d]{1,2}:[\\d]{2}Z"); + + // ignore warnings, should be the same as in issue_11521.yaml + Pattern pattern = Pattern.compile("[\\d]{4}-[\\d]{2}-[\\d]{2}T[\\d]{1,2}:[\\d]{2}Z"); + Matcher matcher = pattern.matcher(property1.example); + Assert.assertTrue(matcher.find()); + } + + @Test(description = "tests uuid example works even if a pattern is provided") + public void testUuidExampleWorksEvenIfPatternIsDefined() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issues_13069.yaml"); + final DefaultCodegen codegen = new PythonPriorClientCodegen(); + codegen.setOpenAPI(openAPI); + + Operation operation = openAPI.getPaths().get("/test").getGet(); + CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); + codegen.setParameterExampleValue(codegenParameter, operation.getParameters().get(0)); + + String modelName = "UUID"; + Schema modelSchema = ModelUtils.getSchema(openAPI, modelName); + final CodegenModel model = codegen.fromModel(modelName, modelSchema); + + Pattern pattern = Pattern.compile("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"); + Matcher matcher = pattern.matcher(codegenParameter.example); + Assert.assertTrue(matcher.find()); + } + + @Test(description = "tests RecursiveToExample") + public void testRecursiveToExample() throws IOException { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_8052_recursive_model.yaml"); + final PythonPriorClientCodegen codegen = new PythonPriorClientCodegen(); + codegen.setOpenAPI(openAPI); + + final Operation operation = openAPI.getPaths().get("/geojson").getPost(); + Schema schema = ModelUtils.getSchemaFromRequestBody(operation.getRequestBody()); + String exampleValue = codegen.toExampleValue(schema, null); + + // uncomment if you need to regenerate the expected value + // PrintWriter printWriter = new PrintWriter("src/test/resources/3_0/issue_8052_recursive_model_expected_value.txt"); + // printWriter.write(exampleValue); + // printWriter.close(); + // org.junit.Assert.assertTrue(false); + + String expectedValue = Resources.toString( + Resources.getResource("3_0/issue_8052_recursive_model_expected_value.txt"), + StandardCharsets.UTF_8); + expectedValue = expectedValue.replaceAll("\\r\\n", "\n"); + + + Assert.assertEquals(exampleValue.trim(), expectedValue.trim()); + + } + + @Test(description = "tests NoProxyPyClient") + public void testNoProxyPyClient() throws Exception { + + final String gen = "python-prior"; + final String spec = "src/test/resources/3_0/petstore.yaml"; + + File output = Files.createTempDirectory("test").toFile(); + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName(gen) + .setInputSpec(spec) + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + + for (String f : new String[] { "openapi_client/configuration.py", "openapi_client/rest.py" } ) { + TestUtils.ensureContainsFile(files, output, f); + Path p = output.toPath().resolve(f); + TestUtils.assertFileContains(p, "no_proxy"); + } + } + + @DataProvider + public Object[][] testToModelData() { + return new Object[][] { + new Object[] {"", "", "foo", "Foo"}, + new Object[] {"Abc", "", "foo", "AbcFoo"}, + new Object[] {"", "Abc", "foo", "FooAbc"}, + new Object[] {"Abc", "Xyz", "foo", "AbcFooXyz"}, + + new Object[] {"", "", "1", "Model1"}, + new Object[] {"Abc", "", "1", "Abc1"}, + new Object[] {"", "Abc", "1", "Model1Abc"}, + new Object[] {"Abc", "Xyz", "1", "Abc1Xyz"}, + + new Object[] {"", "", "and", "ModelAnd"}, + new Object[] {"Abc", "", "and", "AbcAnd"}, + new Object[] {"", "Abc", "and", "AndAbc"}, + new Object[] {"Abc", "Xyz", "and", "AbcAndXyz"}, + }; + } + + @Test(dataProvider = "testToModelData") + public void testToModel(String prefix, String suffix, String input, String want) { + PythonPriorClientCodegen codegen = new PythonPriorClientCodegen(); + codegen.setModelNamePrefix(prefix); + codegen.setModelNameSuffix(suffix); + Assert.assertEquals(codegen.toModelName(input), want); + } + + +} diff --git a/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/python-prior/petstore-with-fake-endpoints-models-for-testing.yaml similarity index 100% rename from modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml rename to modules/openapi-generator/src/test/resources/2_0/python-prior/petstore-with-fake-endpoints-models-for-testing.yaml diff --git a/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/python-prior/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml similarity index 79% rename from modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml rename to modules/openapi-generator/src/test/resources/3_0/python-prior/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 3357b0ae1180..8d040105b98d 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python-prior/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -16,6 +16,8 @@ tags: description: Access to Petstore orders - name: user description: Operations about user + - name: fake + description: Fake api used for feature testing paths: /foo: get: @@ -31,17 +33,15 @@ paths: $ref: '#/components/schemas/Foo' /pet: servers: - - url: 'https://petstore.swagger.io/v2' - - url: 'https://path-server-test.petstore.local/v2' + - url: 'http://petstore.swagger.io/v2' + - url: 'http://path-server-test.petstore.local/v2' post: tags: - pet summary: Add a new pet to the store - description: Add a new pet to the store + description: '' operationId: addPet responses: - '200': - description: Ok '405': description: Invalid input security: @@ -135,6 +135,7 @@ paths: type: array items: type: string + example: ['tag1', 'tag2'] responses: '200': description: successful operation @@ -247,45 +248,6 @@ paths: - petstore_auth: - 'write:pets' - 'read:pets' - '/pet/{petId}/uploadImage': - post: - tags: - - pet - summary: uploads an image - description: '' - operationId: uploadImage - 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: @@ -555,7 +517,7 @@ paths: - 'fake_classname_tags 123#$%^' summary: To test class name in snake case description: To test class name in snake case - operationId: Classname + operationId: testClassname responses: '200': description: successful operation @@ -573,7 +535,7 @@ paths: - fake summary: To test "client" model description: To test "client" model - operationId: ClientModel + operationId: testClientModel responses: '200': description: successful operation @@ -588,7 +550,7 @@ paths: - fake summary: To test enum parameters description: To test enum parameters - operationId: EnumParameters + operationId: testEnumParameters parameters: - name: enum_header_string_array in: header @@ -691,7 +653,7 @@ paths: 假端點 偽のエンドポイント 가짜 엔드 포인트 - operationId: EndpointParameters + operationId: testEndpointParameters responses: '400': description: Invalid username supplied @@ -730,12 +692,14 @@ paths: type: number format: float maximum: 987.6 + exclusiveMaximum: true double: description: None type: number format: double minimum: 67.8 maximum: 123.4 + exclusiveMaximum: true string: description: None type: string @@ -783,7 +747,7 @@ paths: - bearer_test: [] summary: Fake endpoint to test group parameters (optional) description: Fake endpoint to test group parameters (optional) - operationId: GroupParameters + operationId: testGroupParameters x-group-parameters: true parameters: - name: required_string_group @@ -918,6 +882,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AnimalFarm' + examples: + simple-list: + summary: Simple list example + description: Should not get into code examples + value: + - className: foo + color: yellow + - className: bar + color: green required: false responses: '200': @@ -932,13 +905,13 @@ paths: tags: - fake description: Test serialization of object with $refed properties - operationId: ComposedOneOfDifferentTypes + operationId: ComposedOneOfNumberWithValidations requestBody: description: Input model content: application/json: schema: - $ref: '#/components/schemas/ComposedOneOfDifferentTypes' + $ref: '#/components/schemas/ComposedOneOfNumberWithValidations' required: false responses: '200': @@ -946,7 +919,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ComposedOneOfDifferentTypes' + $ref: '#/components/schemas/ComposedOneOfNumberWithValidations' /fake/refs/object_model_with_ref_props: post: tags: @@ -1009,6 +982,26 @@ paths: application/json: schema: $ref: '#/components/schemas/ArrayOfEnums' + /fake/refs/enum-test: + post: + tags: + - fake + summary: Object contains enum properties and array properties containing enums + operationId: EnumTest + requestBody: + description: Input object + content: + application/json: + schema: + $ref: '#/components/schemas/Enum_Test' + required: false + responses: + 200: + description: Got object containing enums + content: + application/json: + schema: + $ref: '#/components/schemas/Enum_Test' /fake/additional-properties-with-array-of-enums: get: tags: @@ -1035,7 +1028,7 @@ paths: - fake summary: test json serialization of form data description: '' - operationId: JsonFormData + operationId: testJsonFormData responses: '200': description: successful operation @@ -1060,7 +1053,7 @@ paths: - fake summary: test inline additionalProperties description: '' - operationId: InlineAdditionalProperties + operationId: testInlineAdditionalProperties responses: '200': description: successful operation @@ -1077,7 +1070,7 @@ paths: put: tags: - fake - operationId: BodyWithQueryParams + operationId: testBodyWithQueryParams parameters: - name: query in: query @@ -1116,7 +1109,7 @@ paths: description: >- For this test, the body for this request much reference a schema named `File`. - operationId: BodyWithFileSchema + operationId: testBodyWithFileSchema responses: '200': description: Success @@ -1126,37 +1119,12 @@ paths: schema: $ref: '#/components/schemas/FileSchemaTestClass' required: true - /fake/case-sensitive-params: - put: - tags: - - fake - description: Ensures that original naming is used in endpoint params, that way we on't have collisions - operationId: CaseSensitiveParams - parameters: - - name: someVar - in: query - required: true - schema: - type: string - - name: SomeVar - in: query - required: true - schema: - type: string - - name: some_var - in: query - required: true - schema: - type: string - responses: - "200": - description: Success - /fake/test-query-paramters: + /fake/test-query-parameters: put: tags: - fake description: To test the collection format in query parameters - operationId: QueryParameterCollectionFormat + operationId: testQueryParameterCollectionFormat parameters: - name: pipe in: query @@ -1199,153 +1167,37 @@ paths: type: array items: type: string - - name: refParam - in: query - required: true - schema: - $ref: '#/components/schemas/StringWithValidation' 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/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/: - post: + /{fileName}: + get: + servers: + - url: http://www.jtricks.com tags: - fake - summary: parameter collision case - operationId: parameterCollisions + summary: downloads a file using Content-Disposition + operationId: downloadAttachment parameters: - - name: 1 - in: query - schema: - type: string - - name: aB - in: query - schema: - type: string - - name: Ab - in: query - schema: - type: string - - name: self - in: query - schema: - type: string - - name: A-B - in: query - schema: - type: string - - name: 1 - in: header - schema: - type: string - - name: aB - in: header - schema: - type: string - - name: self - in: header - schema: - type: string - - name: A-B - in: header - schema: - type: string - - name: 1 + - name: fileName in: path + description: file name required: true schema: type: string - - name: aB - in: path - required: true - schema: - type: string - - name: Ab - in: path - required: true - schema: - type: string - - name: self - in: path - required: true - schema: - type: string - - name: A-B - in: path - required: true - schema: - type: string - - name: 1 - in: cookie - schema: - type: string - - name: aB - in: cookie - schema: - type: string - - name: Ab - in: cookie - schema: - type: string - - name: self - in: cookie - schema: - type: string - - name: A-B - in: cookie - schema: - type: string - requestBody: - content: - application/json: - schema: {} responses: 200: - description: success + description: successful operation content: - application/json: - schema: {} + 'text/plain': + schema: + type: string + format: binary + headers: + Content-Disposition: + schema: + type: string + description: "describes the received file. Looks like: 'attachment; filename=fileName.txt'" /fake/uploadFile: post: tags: @@ -1436,162 +1288,100 @@ paths: application/json: schema: $ref: '#/components/schemas/HealthCheckResult' - /fake/inlineComposition/: + /fake/postInlineAdditionalPropertiesRefPayload: post: tags: - fake - summary: testing composed schemas at inline locations - operationId: inlineComposition - parameters: - - name: compositionAtRoot - in: query - schema: - allOf: - - type: string - minLength: 1 - - name: compositionInProperty - in: query - schema: - type: object - properties: - someProp: - allOf: - - type: string - minLength: 1 + operationId: postInlineAdditionalPropertiesRefPayload + responses: + 200: + description: InlineAdditionalPropertiesRefPayload + content: + application/json: + schema: + $ref: '#/components/schemas/InlineAdditionalPropertiesRefPayload' requestBody: content: application/json: schema: - allOf: - - type: string - minLength: 1 - multipart/form-data: - schema: - type: object - properties: - someProp: - allOf: - - type: string - minLength: 1 + $ref: '#/components/schemas/InlineAdditionalPropertiesRefPayload' + /fake/postInlineAdditionalPropertiesPayload: + post: + tags: + - fake + operationId: postInlineAdditionalPropertiesPayload responses: 200: - description: success + description: InlineAdditionalPropertiesPayload content: application/json: schema: - allOf: - - type: string - minLength: 1 - multipart/form-data: - schema: + description: this payload is used for verification that some model_to_dict issues are fixed type: object properties: - someProp: - allOf: - - type: string - minLength: 1 - '/fake/objInQuery': - get: - tags: - - fake - summary: user list - operationId: objectInQuery - parameters: - - name: mapBean - in: query - required: false - description: mapBean - style: deepObject - explode: true - schema: - type: object - properties: - keyword: - title: keyword - type: string - responses: - '200': - description: ok - '/fake/refObjInQuery': - get: - tags: - - fake - summary: user list - operationId: refObjectInQuery - parameters: - - name: mapBean - in: query - required: false - description: mapBean - style: deepObject - explode: true - schema: - $ref: '#/components/schemas/Foo' - responses: - '200': - description: ok - '/fake/jsonWithCharset': + arrayData: + type: array + nullable: true + items: + type: object + properties: + labels: + type: array + items: + type: string + nullable: true + requestBody: + content: + application/json: + schema: + description: this payload is used for verification that some model_to_dict issues are fixed + type: object + properties: + arrayData: + type: array + nullable: true + items: + type: object + properties: + labels: + type: array + items: + type: string + nullable: true + /fake/TxRxAnyOfModel: post: tags: - fake - summary: json with charset tx and rx - operationId: jsonWithCharset - requestBody: - content: - application/json; charset=utf-8: - schema: {} + operationId: txRxAnyOfModel responses: 200: - description: success + description: TxRxAnyOfModel content: - application/json; charset=utf-8: - schema: {} - "/fake/responseWithoutSchema": - get: + application/json: + schema: + $ref: '#/components/schemas/GmFruitNoProperties' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GmFruitNoProperties' + /fake/TxRxAllOfModel: + post: tags: - fake - summary: receives a response without schema - operationId: responseWithoutSchema + operationId: txRxAllOfModel responses: - '200': - description: contents without schema definition + 200: + description: success content: - application/json: {} - application/xml: {} - /fake/jsonPatch: - patch: - summary: json patch - description: json patch route with a requestBody - operationId: jsonPatch - tags: - - fake + application/json: + schema: + $ref: '#/components/schemas/StreamOptions' requestBody: content: - application/json-patch+json: + application/json: schema: - $ref: '#/components/schemas/JSONPatchRequest' - responses: - '200': - description: OK - /fake/deleteCoffee/{id}: - delete: - operationId: deleteCoffee - summary: Delete coffee - description: Delete the coffee identified by the given id, (delete without request body) - tags: - - fake - parameters: - - name: id - in: path - description: The internal object id - required: true - schema: - type: string - responses: - '200': - description: OK - default: - description: Unexpected error + $ref: '#/components/schemas/StreamOptions' servers: - url: 'http://{server}.swagger.io:{port}/v2' description: petstore server @@ -1764,12 +1554,13 @@ components: Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 - anyTypeExceptNullProp: - description: any type except 'null' - Here the 'type' attribute is not specified, which means the value can be anything, - including the null value, string, number, boolean, array or object. - not: - type: 'null' + # TODO: this should be supported, currently there are some issues in the code generation. + #anyTypeExceptNullProp: + # description: any type except 'null' + # Here the 'type' attribute is not specified, which means the value can be anything, + # including the null value, string, number, boolean, array or object. + # not: + # type: 'null' anyTypePropNullable: description: test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, @@ -1841,7 +1632,6 @@ components: description: Model for testing reserved words properties: return: - description: this is a reserved python keyword type: integer format: int32 xml: @@ -1859,18 +1649,19 @@ components: type: integer format: int32 property: - description: this is a reserved python keyword type: string + 123Number: + type: integer + readOnly: true xml: name: Name 200_response: - description: model with an invalid class name for python, starts with a number + description: Model for testing model name starting with number properties: name: type: integer format: int32 class: - description: this is a reserved python keyword type: string xml: name: Name @@ -1886,6 +1677,8 @@ components: properties: breed: type: string + legs: + $ref: '#/components/schemas/Legs' Cat: allOf: - $ref: '#/components/schemas/Animal' @@ -1893,6 +1686,19 @@ components: properties: declawed: type: boolean + Legs: + type: object + required: + - legs + properties: + legs: + enum: + - '2' + - '4' + default: '4' + x-enum-as-string: true + name: + type: string Address: type: object additionalProperties: @@ -1909,11 +1715,15 @@ components: color: type: string default: red + tail: + type: boolean + default: true + readOnly: true AnimalFarm: type: array items: $ref: '#/components/schemas/Animal' - FormatTest: + format_test: type: object required: - number @@ -1929,9 +1739,6 @@ components: int32: type: integer format: int32 - int32withValidations: - type: integer - format: int32 maximum: 200 minimum: 20 int64: @@ -1943,27 +1750,15 @@ components: type: number multipleOf: 32.5 float: - description: this is a reserved python keyword type: number format: float maximum: 987.6 minimum: 54.3 - float32: - type: number - format: float double: type: number format: double maximum: 123.4 minimum: 67.8 - float64: - type: number - format: double - arrayWithUniqueItems: - type: array - items: - type: number - uniqueItems: true string: type: string pattern: '/[a-z]/i' @@ -2001,8 +1796,6 @@ components: 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' - noneProp: - type: 'null' EnumClass: type: string default: '-efg' @@ -2010,8 +1803,6 @@ components: - _abc - '-efg' - (xyz) - - COUNT_1M - - COUNT_50M Enum_Test: type: object required: @@ -2041,6 +1832,12 @@ components: enum: - 1.1 - -1.2 + enum_bool: + type: boolean + enum: + - false + boolEnum: + $ref: '#/components/schemas/BooleanEnum' stringEnum: $ref: '#/components/schemas/StringEnum' IntegerEnum: @@ -2051,6 +1848,12 @@ components: $ref: '#/components/schemas/IntegerEnumWithDefaultValue' IntegerEnumOneValue: $ref: '#/components/schemas/IntegerEnumOneValue' + InlineArrayOfStrEnum: + type: array + items: + $ref: '#/components/schemas/StringEnum' + ArrayOfStrEnum: + $ref: '#/components/schemas/ArrayOfEnums' AdditionalPropertiesClass: type: object properties: @@ -2095,6 +1898,11 @@ components: type: object additionalProperties: $ref: '#/components/schemas/Animal' + List: + type: object + properties: + 123-list: + type: string Client: type: object properties: @@ -2224,19 +2032,12 @@ components: multiple lines - "double quote \n with newline" - - null IntegerEnum: type: integer enum: - 0 - 1 - 2 - IntegerEnumBig: - type: integer - enum: - - 10 - - 11 - - 12 StringEnumWithDefaultValue: type: string enum: @@ -2255,51 +2056,29 @@ components: type: integer enum: - 0 - NullableString: - nullable: true - type: string ObjectModelWithRefProps: description: a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations type: object properties: - myNumber: + my_number: $ref: '#/definitions/NumberWithValidations' - myString: + my_readonly: + $ref: '#/definitions/Readonly' + my_string: $ref: '#/definitions/String' - myBoolean: + my_boolean: $ref: '#/definitions/Boolean' NumberWithValidations: type: number minimum: 10 maximum: 20 - ComposedAnyOfDifferentTypesNoValidations: - anyOf: - - type: object - - type: string - format: date - - type: string - format: date-time - - type: string - format: binary - - type: string - format: byte - - type: string - - type: object - - type: boolean - - type: 'null' - - type: array - items: {} - - type: number - - type: number - format: float - - type: number - format: double - - type: integer - - type: integer - format: int32 - - type: integer - format: int64 - ComposedOneOfDifferentTypes: + Readonly: + type: object + readOnly: true + properties: + name: + type: string + ComposedOneOfNumberWithValidations: description: this is a model that allows payloads of type object or number oneOf: - $ref: '#/components/schemas/NumberWithValidations' @@ -2307,16 +2086,6 @@ components: - type: 'null' - type: string format: date - - type: object - minProperties: 4 - maxProperties: 4 - - type: array - maxItems: 4 - minItems: 4 - items: {} - - type: string - format: date-time - pattern: '^2020.*' Number: type: number String: @@ -2343,26 +2112,13 @@ components: sourceURI: description: Test capitalization type: string - ObjectWithDifficultlyNamedProps: - type: object - description: model with properties that have invalid names for python + _special_model.name_: properties: '$special[property.name]': type: integer format: int64 - 123-list: - type: string - 123Number: - type: integer - readOnly: true - required: - - 123-list - _special_model.name_: - type: object - description: model with an invalid class name for python - properties: - a: - type: string + xml: + name: '$special[model.name]' HealthCheckResult: type: object properties: @@ -2409,6 +2165,9 @@ components: items: type: object nullable: true + object_nullable: + type: object + nullable: true object_nullable_prop: type: object nullable: true @@ -2426,9 +2185,21 @@ components: type: object nullable: true additionalProperties: - type: object nullable: true + ComposedSchemaWithPropsAndNoAddProps: + properties: + color: + type: string + allOf: + - $ref: '#/components/schemas/Tag' + # Below additionalProperties is set to false to validate the use + # case when a composed schema has additionalProperties set to false. + # This definition will only allow in object payloads that set color and no other properties because + # additionalProperties are evaluated at the schema level and do not include composed schema + # properties. Only color is defined here, all others are additional + additionalProperties: false fruit: + description: a schema that tests oneOf and includes a schema level property properties: color: type: string @@ -2470,8 +2241,6 @@ components: type: boolean className: type: string - enum: - - whale required: - className zebra: @@ -2485,8 +2254,6 @@ components: - grevys className: type: string - enum: - - zebra required: - className additionalProperties: true @@ -2501,8 +2268,6 @@ components: properties: className: type: string - enum: - - BasquePig required: - className DanishPig: @@ -2510,10 +2275,12 @@ components: properties: className: type: string - enum: - - DanishPig required: - className + GmFruitNoProperties: + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' gmFruit: properties: color: @@ -2522,6 +2289,8 @@ components: - $ref: '#/components/schemas/apple' - $ref: '#/components/schemas/banana' fruitReq: + description: a schema where additionalProperties is on in the composed schema and off in the oneOf object schemas + also, this schem accepts null as a value oneOf: - type: 'null' - $ref: '#/components/schemas/appleReq' @@ -2592,23 +2361,25 @@ components: propertyName: shapeType NullableShape: description: The value may be a shape or the 'null' value. - For a composed schema to validate a null payload, - one of its chosen oneOf schemas must be type null - or nullable (introduced in OAS schema >= 3.0) + The 'nullable' attribute was introduced in OAS schema >= 3.0 + and has been deprecated in OAS schema >= 3.1. oneOf: - $ref: '#/components/schemas/Triangle' - $ref: '#/components/schemas/Quadrilateral' - - type: "null" - TriangleInterface: + discriminator: + propertyName: shapeType + nullable: true + ShapeInterface: properties: shapeType: type: string - enum: - - 'Triangle' + required: + - shapeType + TriangleInterface: + properties: triangleType: type: string required: - - shapeType - triangleType Triangle: oneOf: @@ -2621,41 +2392,21 @@ components: # equivalent to allowing undeclared properties of any type. EquilateralTriangle: allOf: + - $ref: '#/components/schemas/ShapeInterface' - $ref: '#/components/schemas/TriangleInterface' - - type: object - properties: - triangleType: - type: string - enum: - - 'EquilateralTriangle' IsoscelesTriangle: allOf: + - $ref: '#/components/schemas/ShapeInterface' - $ref: '#/components/schemas/TriangleInterface' - - type: object - properties: - triangleType: - type: string - enum: - - 'IsoscelesTriangle' ScaleneTriangle: allOf: + - $ref: '#/components/schemas/ShapeInterface' - $ref: '#/components/schemas/TriangleInterface' - - type: object - properties: - triangleType: - type: string - enum: - - 'ScaleneTriangle' QuadrilateralInterface: properties: - shapeType: - type: string - enum: - - 'Quadrilateral' quadrilateralType: type: string required: - - shapeType - quadrilateralType Quadrilateral: oneOf: @@ -2665,22 +2416,12 @@ components: propertyName: quadrilateralType SimpleQuadrilateral: allOf: + - $ref: '#/components/schemas/ShapeInterface' - $ref: '#/components/schemas/QuadrilateralInterface' - - type: object - properties: - quadrilateralType: - type: string - enum: - - 'SimpleQuadrilateral' ComplexQuadrilateral: allOf: + - $ref: '#/components/schemas/ShapeInterface' - $ref: '#/components/schemas/QuadrilateralInterface' - - type: object - properties: - quadrilateralType: - type: string - enum: - - 'ComplexQuadrilateral' GrandparentAnimal: type: object required: @@ -2720,225 +2461,91 @@ components: type: object ObjectWithValidations: type: object - minProperties: 2 + minProperties: 1 SomeObject: allOf: - $ref: '#/components/schemas/ObjectInterface' - ArrayWithValidationsInItems: - type: array - maxItems: 2 - items: - type: integer - format: int64 - maximum: 7 - ArrayHoldingAnyType: - type: array - items: - description: any type can be stored here - DateWithValidations: - type: string - format: date - pattern: '^2020.*' - DateTimeWithValidations: - type: string - format: date-time - pattern: '^2020.*' - NoAdditionalProperties: - type: object - properties: - id: - type: integer - format: int64 - petId: - type: integer - format: int64 - required: - - id - additionalProperties: false - IntegerMax10: - type: integer - format: int64 - maximum: 10 - IntegerMin15: - type: integer - format: int64 - minimum: 15 - StringWithValidation: - type: string - minLength: 7 - Player: + SomeObjectWithSelfAttr: type: object - description: a model that includes a self reference this forces properties and additionalProperties - to be lazy loaded in python models because the Player class has not fully loaded when defining - properties properties: - name: - type: string - enemyPlayer: - $ref: '#/components/schemas/Player' - BooleanEnum: - type: boolean - enum: - - true - ComposedObject: - type: object - allOf: - - {} - ComposedNumber: - type: number - allOf: - - {} - ComposedString: - type: string - allOf: - - {} - ComposedBool: - type: boolean - allOf: - - {} - ComposedArray: - type: array - items: {} - allOf: - - {} - ComposedNone: - type: 'null' - allOf: - - {} - Currency: - type: string - enum: - - eur - - usd - Money: - type: object - properties: - amount: + self: type: string - format: number - currency: - $ref: '#/components/schemas/Currency' - required: - - amount - - currency - DecimalPayload: - type: string - format: number - ObjectWithDecimalProperties: + InlineAdditionalPropertiesRefPayload: + description: this payload is used for verification that some model_to_dict issues are fixed type: object properties: - length: - $ref: '#/components/schemas/DecimalPayload' - width: - type: string - format: number - cost: - $ref: '#/components/schemas/Money' - ObjectWithInlineCompositionProperty: - type: object - properties: - someProp: - allOf: - - type: string - minLength: 1 - UUIDString: - type: string - format: uuid - minLength: 1 - AnyTypeNotString: - not: - type: string - JSONPatchRequest: - type: array - items: - oneOf: - - $ref: '#/components/schemas/JSONPatchRequestAddReplaceTest' - - $ref: '#/components/schemas/JSONPatchRequestRemove' - - $ref: '#/components/schemas/JSONPatchRequestMoveCopy' - JSONPatchRequestAddReplaceTest: + arrayData: + type: array + nullable: true + items: + type: object + properties: + labels: + type: array + items: + type: string + nullable: true + Mole: type: object - additionalProperties: false required: - - value - - op - - path + - blind + - smell + - hearing properties: - path: - description: A JSON Pointer path. + blind: + type: boolean + readOnly: true + smell: type: string - value: - description: The value to add, replace or test. - op: - description: The operation to perform. + readOnly: false + touch: + type: boolean + readOnly: true + taste: type: string - enum: - - add - - replace - - test - JSONPatchRequestRemove: + readOnly: false + hearing: + type: boolean + seeingGhosts: + type: boolean + BooleanEnum: + type: boolean + enum: + - true + FooObject: type: object - additionalProperties: false - required: - - op - - path properties: - path: - description: A JSON Pointer path. - type: string - op: - description: The operation to perform. - type: string - enum: - - remove - JSONPatchRequestMoveCopy: + prop1: + type: array + items: + type: object + prop2: + type: object + StreamOptions: + allOf: + - $ref: "#/components/schemas/EgressThresholdOptions" + - $ref: "#/components/schemas/PublishOptions" + + EgressThresholdOptions: type: object - additionalProperties: false - required: - - from - - op - - path properties: - from: - description: A JSON Pointer path. - type: string - path: - description: A JSON Pointer path. - type: string - op: - description: The operation to perform. - type: string - enum: - - move - - copy - AdditionalPropertiesValidator: - type: object - allOf: - - type: object - additionalProperties: true - - type: object - additionalProperties: - minLength: 3 - - type: object + egressThresholds: + type: object additionalProperties: - maxLength: 5 - AnyTypeAndFormat: + type: number + minimum: 0 + maximum: 1 + example: 0.9 + + PublishOptions: type: object properties: - uuid: - format: uuid - date: - format: date - date-time: - format: date-time - number: - format: number - binary: - format: binary - int32: - format: int32 - int64: - format: int64 - double: - format: double - float: - format: float \ No newline at end of file + publish: + type : object + properties: + egressUnknownDetections: + type: boolean + example: true + filterZeroDetections: + type: boolean + example: true diff --git a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 8d040105b98d..3357b0ae1180 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -16,8 +16,6 @@ tags: description: Access to Petstore orders - name: user description: Operations about user - - name: fake - description: Fake api used for feature testing paths: /foo: get: @@ -33,15 +31,17 @@ paths: $ref: '#/components/schemas/Foo' /pet: servers: - - url: 'http://petstore.swagger.io/v2' - - url: 'http://path-server-test.petstore.local/v2' + - url: 'https://petstore.swagger.io/v2' + - url: 'https://path-server-test.petstore.local/v2' post: tags: - pet summary: Add a new pet to the store - description: '' + description: Add a new pet to the store operationId: addPet responses: + '200': + description: Ok '405': description: Invalid input security: @@ -135,7 +135,6 @@ paths: type: array items: type: string - example: ['tag1', 'tag2'] responses: '200': description: successful operation @@ -248,6 +247,45 @@ paths: - petstore_auth: - 'write:pets' - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadImage + 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: @@ -517,7 +555,7 @@ paths: - 'fake_classname_tags 123#$%^' summary: To test class name in snake case description: To test class name in snake case - operationId: testClassname + operationId: Classname responses: '200': description: successful operation @@ -535,7 +573,7 @@ paths: - fake summary: To test "client" model description: To test "client" model - operationId: testClientModel + operationId: ClientModel responses: '200': description: successful operation @@ -550,7 +588,7 @@ paths: - fake summary: To test enum parameters description: To test enum parameters - operationId: testEnumParameters + operationId: EnumParameters parameters: - name: enum_header_string_array in: header @@ -653,7 +691,7 @@ paths: 假端點 偽のエンドポイント 가짜 엔드 포인트 - operationId: testEndpointParameters + operationId: EndpointParameters responses: '400': description: Invalid username supplied @@ -692,14 +730,12 @@ paths: type: number format: float maximum: 987.6 - exclusiveMaximum: true double: description: None type: number format: double minimum: 67.8 maximum: 123.4 - exclusiveMaximum: true string: description: None type: string @@ -747,7 +783,7 @@ paths: - bearer_test: [] summary: Fake endpoint to test group parameters (optional) description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters + operationId: GroupParameters x-group-parameters: true parameters: - name: required_string_group @@ -882,15 +918,6 @@ paths: application/json: schema: $ref: '#/components/schemas/AnimalFarm' - examples: - simple-list: - summary: Simple list example - description: Should not get into code examples - value: - - className: foo - color: yellow - - className: bar - color: green required: false responses: '200': @@ -905,13 +932,13 @@ paths: tags: - fake description: Test serialization of object with $refed properties - operationId: ComposedOneOfNumberWithValidations + operationId: ComposedOneOfDifferentTypes requestBody: description: Input model content: application/json: schema: - $ref: '#/components/schemas/ComposedOneOfNumberWithValidations' + $ref: '#/components/schemas/ComposedOneOfDifferentTypes' required: false responses: '200': @@ -919,7 +946,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ComposedOneOfNumberWithValidations' + $ref: '#/components/schemas/ComposedOneOfDifferentTypes' /fake/refs/object_model_with_ref_props: post: tags: @@ -982,26 +1009,6 @@ paths: application/json: schema: $ref: '#/components/schemas/ArrayOfEnums' - /fake/refs/enum-test: - post: - tags: - - fake - summary: Object contains enum properties and array properties containing enums - operationId: EnumTest - requestBody: - description: Input object - content: - application/json: - schema: - $ref: '#/components/schemas/Enum_Test' - required: false - responses: - 200: - description: Got object containing enums - content: - application/json: - schema: - $ref: '#/components/schemas/Enum_Test' /fake/additional-properties-with-array-of-enums: get: tags: @@ -1028,7 +1035,7 @@ paths: - fake summary: test json serialization of form data description: '' - operationId: testJsonFormData + operationId: JsonFormData responses: '200': description: successful operation @@ -1053,7 +1060,7 @@ paths: - fake summary: test inline additionalProperties description: '' - operationId: testInlineAdditionalProperties + operationId: InlineAdditionalProperties responses: '200': description: successful operation @@ -1070,7 +1077,7 @@ paths: put: tags: - fake - operationId: testBodyWithQueryParams + operationId: BodyWithQueryParams parameters: - name: query in: query @@ -1109,7 +1116,7 @@ paths: description: >- For this test, the body for this request much reference a schema named `File`. - operationId: testBodyWithFileSchema + operationId: BodyWithFileSchema responses: '200': description: Success @@ -1119,12 +1126,37 @@ paths: schema: $ref: '#/components/schemas/FileSchemaTestClass' required: true - /fake/test-query-parameters: + /fake/case-sensitive-params: + put: + tags: + - fake + description: Ensures that original naming is used in endpoint params, that way we on't have collisions + operationId: CaseSensitiveParams + parameters: + - name: someVar + in: query + required: true + schema: + type: string + - name: SomeVar + in: query + required: true + schema: + type: string + - name: some_var + in: query + required: true + schema: + type: string + responses: + "200": + description: Success + /fake/test-query-paramters: put: tags: - fake description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat + operationId: QueryParameterCollectionFormat parameters: - name: pipe in: query @@ -1167,37 +1199,153 @@ paths: type: array items: type: string + - name: refParam + in: query + required: true + schema: + $ref: '#/components/schemas/StringWithValidation' responses: "200": description: Success - /{fileName}: - get: - servers: - - url: http://www.jtricks.com + '/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/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/: + post: tags: - fake - summary: downloads a file using Content-Disposition - operationId: downloadAttachment + summary: parameter collision case + operationId: parameterCollisions parameters: - - name: fileName + - name: 1 + in: query + schema: + type: string + - name: aB + in: query + schema: + type: string + - name: Ab + in: query + schema: + type: string + - name: self + in: query + schema: + type: string + - name: A-B + in: query + schema: + type: string + - name: 1 + in: header + schema: + type: string + - name: aB + in: header + schema: + type: string + - name: self + in: header + schema: + type: string + - name: A-B + in: header + schema: + type: string + - name: 1 in: path - description: file name required: true schema: type: string + - name: aB + in: path + required: true + schema: + type: string + - name: Ab + in: path + required: true + schema: + type: string + - name: self + in: path + required: true + schema: + type: string + - name: A-B + in: path + required: true + schema: + type: string + - name: 1 + in: cookie + schema: + type: string + - name: aB + in: cookie + schema: + type: string + - name: Ab + in: cookie + schema: + type: string + - name: self + in: cookie + schema: + type: string + - name: A-B + in: cookie + schema: + type: string + requestBody: + content: + application/json: + schema: {} responses: 200: - description: successful operation + description: success content: - 'text/plain': - schema: - type: string - format: binary - headers: - Content-Disposition: - schema: - type: string - description: "describes the received file. Looks like: 'attachment; filename=fileName.txt'" + application/json: + schema: {} /fake/uploadFile: post: tags: @@ -1288,100 +1436,162 @@ paths: application/json: schema: $ref: '#/components/schemas/HealthCheckResult' - /fake/postInlineAdditionalPropertiesRefPayload: + /fake/inlineComposition/: post: tags: - fake - operationId: postInlineAdditionalPropertiesRefPayload - responses: - 200: - description: InlineAdditionalPropertiesRefPayload - content: - application/json: - schema: - $ref: '#/components/schemas/InlineAdditionalPropertiesRefPayload' + summary: testing composed schemas at inline locations + operationId: inlineComposition + parameters: + - name: compositionAtRoot + in: query + schema: + allOf: + - type: string + minLength: 1 + - name: compositionInProperty + in: query + schema: + type: object + properties: + someProp: + allOf: + - type: string + minLength: 1 requestBody: content: application/json: schema: - $ref: '#/components/schemas/InlineAdditionalPropertiesRefPayload' - /fake/postInlineAdditionalPropertiesPayload: - post: - tags: - - fake - operationId: postInlineAdditionalPropertiesPayload + allOf: + - type: string + minLength: 1 + multipart/form-data: + schema: + type: object + properties: + someProp: + allOf: + - type: string + minLength: 1 responses: 200: - description: InlineAdditionalPropertiesPayload + description: success content: application/json: schema: - description: this payload is used for verification that some model_to_dict issues are fixed + allOf: + - type: string + minLength: 1 + multipart/form-data: + schema: type: object properties: - arrayData: - type: array - nullable: true - items: - type: object - properties: - labels: - type: array - items: - type: string - nullable: true - requestBody: - content: - application/json: - schema: - description: this payload is used for verification that some model_to_dict issues are fixed - type: object - properties: - arrayData: - type: array - nullable: true - items: - type: object - properties: - labels: - type: array - items: - type: string - nullable: true - /fake/TxRxAnyOfModel: - post: + someProp: + allOf: + - type: string + minLength: 1 + '/fake/objInQuery': + get: tags: - fake - operationId: txRxAnyOfModel + summary: user list + operationId: objectInQuery + parameters: + - name: mapBean + in: query + required: false + description: mapBean + style: deepObject + explode: true + schema: + type: object + properties: + keyword: + title: keyword + type: string responses: - 200: - description: TxRxAnyOfModel - content: - application/json: - schema: - $ref: '#/components/schemas/GmFruitNoProperties' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GmFruitNoProperties' - /fake/TxRxAllOfModel: + '200': + description: ok + '/fake/refObjInQuery': + get: + tags: + - fake + summary: user list + operationId: refObjectInQuery + parameters: + - name: mapBean + in: query + required: false + description: mapBean + style: deepObject + explode: true + schema: + $ref: '#/components/schemas/Foo' + responses: + '200': + description: ok + '/fake/jsonWithCharset': post: tags: - fake - operationId: txRxAllOfModel + summary: json with charset tx and rx + operationId: jsonWithCharset + requestBody: + content: + application/json; charset=utf-8: + schema: {} responses: 200: description: success content: - application/json: - schema: - $ref: '#/components/schemas/StreamOptions' + application/json; charset=utf-8: + schema: {} + "/fake/responseWithoutSchema": + get: + tags: + - fake + summary: receives a response without schema + operationId: responseWithoutSchema + responses: + '200': + description: contents without schema definition + content: + application/json: {} + application/xml: {} + /fake/jsonPatch: + patch: + summary: json patch + description: json patch route with a requestBody + operationId: jsonPatch + tags: + - fake requestBody: content: - application/json: + application/json-patch+json: schema: - $ref: '#/components/schemas/StreamOptions' + $ref: '#/components/schemas/JSONPatchRequest' + responses: + '200': + description: OK + /fake/deleteCoffee/{id}: + delete: + operationId: deleteCoffee + summary: Delete coffee + description: Delete the coffee identified by the given id, (delete without request body) + tags: + - fake + parameters: + - name: id + in: path + description: The internal object id + required: true + schema: + type: string + responses: + '200': + description: OK + default: + description: Unexpected error servers: - url: 'http://{server}.swagger.io:{port}/v2' description: petstore server @@ -1554,13 +1764,12 @@ components: Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 - # TODO: this should be supported, currently there are some issues in the code generation. - #anyTypeExceptNullProp: - # description: any type except 'null' - # Here the 'type' attribute is not specified, which means the value can be anything, - # including the null value, string, number, boolean, array or object. - # not: - # type: 'null' + anyTypeExceptNullProp: + description: any type except 'null' + Here the 'type' attribute is not specified, which means the value can be anything, + including the null value, string, number, boolean, array or object. + not: + type: 'null' anyTypePropNullable: description: test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, @@ -1632,6 +1841,7 @@ components: description: Model for testing reserved words properties: return: + description: this is a reserved python keyword type: integer format: int32 xml: @@ -1649,19 +1859,18 @@ components: type: integer format: int32 property: + description: this is a reserved python keyword type: string - 123Number: - type: integer - readOnly: true xml: name: Name 200_response: - description: Model for testing model name starting with number + description: model with an invalid class name for python, starts with a number properties: name: type: integer format: int32 class: + description: this is a reserved python keyword type: string xml: name: Name @@ -1677,8 +1886,6 @@ components: properties: breed: type: string - legs: - $ref: '#/components/schemas/Legs' Cat: allOf: - $ref: '#/components/schemas/Animal' @@ -1686,19 +1893,6 @@ components: properties: declawed: type: boolean - Legs: - type: object - required: - - legs - properties: - legs: - enum: - - '2' - - '4' - default: '4' - x-enum-as-string: true - name: - type: string Address: type: object additionalProperties: @@ -1715,15 +1909,11 @@ components: color: type: string default: red - tail: - type: boolean - default: true - readOnly: true AnimalFarm: type: array items: $ref: '#/components/schemas/Animal' - format_test: + FormatTest: type: object required: - number @@ -1739,6 +1929,9 @@ components: int32: type: integer format: int32 + int32withValidations: + type: integer + format: int32 maximum: 200 minimum: 20 int64: @@ -1750,15 +1943,27 @@ components: type: number multipleOf: 32.5 float: + description: this is a reserved python keyword type: number format: float maximum: 987.6 minimum: 54.3 + float32: + type: number + format: float double: type: number format: double maximum: 123.4 minimum: 67.8 + float64: + type: number + format: double + arrayWithUniqueItems: + type: array + items: + type: number + uniqueItems: true string: type: string pattern: '/[a-z]/i' @@ -1796,6 +2001,8 @@ components: 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' + noneProp: + type: 'null' EnumClass: type: string default: '-efg' @@ -1803,6 +2010,8 @@ components: - _abc - '-efg' - (xyz) + - COUNT_1M + - COUNT_50M Enum_Test: type: object required: @@ -1832,12 +2041,6 @@ components: enum: - 1.1 - -1.2 - enum_bool: - type: boolean - enum: - - false - boolEnum: - $ref: '#/components/schemas/BooleanEnum' stringEnum: $ref: '#/components/schemas/StringEnum' IntegerEnum: @@ -1848,12 +2051,6 @@ components: $ref: '#/components/schemas/IntegerEnumWithDefaultValue' IntegerEnumOneValue: $ref: '#/components/schemas/IntegerEnumOneValue' - InlineArrayOfStrEnum: - type: array - items: - $ref: '#/components/schemas/StringEnum' - ArrayOfStrEnum: - $ref: '#/components/schemas/ArrayOfEnums' AdditionalPropertiesClass: type: object properties: @@ -1898,11 +2095,6 @@ components: type: object additionalProperties: $ref: '#/components/schemas/Animal' - List: - type: object - properties: - 123-list: - type: string Client: type: object properties: @@ -2032,12 +2224,19 @@ components: multiple lines - "double quote \n with newline" + - null IntegerEnum: type: integer enum: - 0 - 1 - 2 + IntegerEnumBig: + type: integer + enum: + - 10 + - 11 + - 12 StringEnumWithDefaultValue: type: string enum: @@ -2056,29 +2255,51 @@ components: type: integer enum: - 0 + NullableString: + nullable: true + type: string ObjectModelWithRefProps: description: a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations type: object properties: - my_number: + myNumber: $ref: '#/definitions/NumberWithValidations' - my_readonly: - $ref: '#/definitions/Readonly' - my_string: + myString: $ref: '#/definitions/String' - my_boolean: + myBoolean: $ref: '#/definitions/Boolean' NumberWithValidations: type: number minimum: 10 maximum: 20 - Readonly: - type: object - readOnly: true - properties: - name: - type: string - ComposedOneOfNumberWithValidations: + ComposedAnyOfDifferentTypesNoValidations: + anyOf: + - type: object + - type: string + format: date + - type: string + format: date-time + - type: string + format: binary + - type: string + format: byte + - type: string + - type: object + - type: boolean + - type: 'null' + - type: array + items: {} + - type: number + - type: number + format: float + - type: number + format: double + - type: integer + - type: integer + format: int32 + - type: integer + format: int64 + ComposedOneOfDifferentTypes: description: this is a model that allows payloads of type object or number oneOf: - $ref: '#/components/schemas/NumberWithValidations' @@ -2086,6 +2307,16 @@ components: - type: 'null' - type: string format: date + - type: object + minProperties: 4 + maxProperties: 4 + - type: array + maxItems: 4 + minItems: 4 + items: {} + - type: string + format: date-time + pattern: '^2020.*' Number: type: number String: @@ -2112,13 +2343,26 @@ components: sourceURI: description: Test capitalization type: string - _special_model.name_: + ObjectWithDifficultlyNamedProps: + type: object + description: model with properties that have invalid names for python properties: '$special[property.name]': type: integer format: int64 - xml: - name: '$special[model.name]' + 123-list: + type: string + 123Number: + type: integer + readOnly: true + required: + - 123-list + _special_model.name_: + type: object + description: model with an invalid class name for python + properties: + a: + type: string HealthCheckResult: type: object properties: @@ -2165,9 +2409,6 @@ components: items: type: object nullable: true - object_nullable: - type: object - nullable: true object_nullable_prop: type: object nullable: true @@ -2185,21 +2426,9 @@ components: type: object nullable: true additionalProperties: + type: object nullable: true - ComposedSchemaWithPropsAndNoAddProps: - properties: - color: - type: string - allOf: - - $ref: '#/components/schemas/Tag' - # Below additionalProperties is set to false to validate the use - # case when a composed schema has additionalProperties set to false. - # This definition will only allow in object payloads that set color and no other properties because - # additionalProperties are evaluated at the schema level and do not include composed schema - # properties. Only color is defined here, all others are additional - additionalProperties: false fruit: - description: a schema that tests oneOf and includes a schema level property properties: color: type: string @@ -2241,6 +2470,8 @@ components: type: boolean className: type: string + enum: + - whale required: - className zebra: @@ -2254,6 +2485,8 @@ components: - grevys className: type: string + enum: + - zebra required: - className additionalProperties: true @@ -2268,6 +2501,8 @@ components: properties: className: type: string + enum: + - BasquePig required: - className DanishPig: @@ -2275,12 +2510,10 @@ components: properties: className: type: string + enum: + - DanishPig required: - className - GmFruitNoProperties: - anyOf: - - $ref: '#/components/schemas/apple' - - $ref: '#/components/schemas/banana' gmFruit: properties: color: @@ -2289,8 +2522,6 @@ components: - $ref: '#/components/schemas/apple' - $ref: '#/components/schemas/banana' fruitReq: - description: a schema where additionalProperties is on in the composed schema and off in the oneOf object schemas - also, this schem accepts null as a value oneOf: - type: 'null' - $ref: '#/components/schemas/appleReq' @@ -2361,25 +2592,23 @@ components: propertyName: shapeType NullableShape: description: The value may be a shape or the 'null' value. - The 'nullable' attribute was introduced in OAS schema >= 3.0 - and has been deprecated in OAS schema >= 3.1. + For a composed schema to validate a null payload, + one of its chosen oneOf schemas must be type null + or nullable (introduced in OAS schema >= 3.0) oneOf: - $ref: '#/components/schemas/Triangle' - $ref: '#/components/schemas/Quadrilateral' - discriminator: - propertyName: shapeType - nullable: true - ShapeInterface: + - type: "null" + TriangleInterface: properties: shapeType: type: string - required: - - shapeType - TriangleInterface: - properties: + enum: + - 'Triangle' triangleType: type: string required: + - shapeType - triangleType Triangle: oneOf: @@ -2392,21 +2621,41 @@ components: # equivalent to allowing undeclared properties of any type. EquilateralTriangle: allOf: - - $ref: '#/components/schemas/ShapeInterface' - $ref: '#/components/schemas/TriangleInterface' + - type: object + properties: + triangleType: + type: string + enum: + - 'EquilateralTriangle' IsoscelesTriangle: allOf: - - $ref: '#/components/schemas/ShapeInterface' - $ref: '#/components/schemas/TriangleInterface' + - type: object + properties: + triangleType: + type: string + enum: + - 'IsoscelesTriangle' ScaleneTriangle: allOf: - - $ref: '#/components/schemas/ShapeInterface' - $ref: '#/components/schemas/TriangleInterface' + - type: object + properties: + triangleType: + type: string + enum: + - 'ScaleneTriangle' QuadrilateralInterface: properties: + shapeType: + type: string + enum: + - 'Quadrilateral' quadrilateralType: type: string required: + - shapeType - quadrilateralType Quadrilateral: oneOf: @@ -2416,12 +2665,22 @@ components: propertyName: quadrilateralType SimpleQuadrilateral: allOf: - - $ref: '#/components/schemas/ShapeInterface' - $ref: '#/components/schemas/QuadrilateralInterface' + - type: object + properties: + quadrilateralType: + type: string + enum: + - 'SimpleQuadrilateral' ComplexQuadrilateral: allOf: - - $ref: '#/components/schemas/ShapeInterface' - $ref: '#/components/schemas/QuadrilateralInterface' + - type: object + properties: + quadrilateralType: + type: string + enum: + - 'ComplexQuadrilateral' GrandparentAnimal: type: object required: @@ -2461,91 +2720,225 @@ components: type: object ObjectWithValidations: type: object - minProperties: 1 + minProperties: 2 SomeObject: allOf: - $ref: '#/components/schemas/ObjectInterface' - SomeObjectWithSelfAttr: + ArrayWithValidationsInItems: + type: array + maxItems: 2 + items: + type: integer + format: int64 + maximum: 7 + ArrayHoldingAnyType: + type: array + items: + description: any type can be stored here + DateWithValidations: + type: string + format: date + pattern: '^2020.*' + DateTimeWithValidations: + type: string + format: date-time + pattern: '^2020.*' + NoAdditionalProperties: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + required: + - id + additionalProperties: false + IntegerMax10: + type: integer + format: int64 + maximum: 10 + IntegerMin15: + type: integer + format: int64 + minimum: 15 + StringWithValidation: + type: string + minLength: 7 + Player: type: object + description: a model that includes a self reference this forces properties and additionalProperties + to be lazy loaded in python models because the Player class has not fully loaded when defining + properties properties: - self: + name: type: string - InlineAdditionalPropertiesRefPayload: - description: this payload is used for verification that some model_to_dict issues are fixed + enemyPlayer: + $ref: '#/components/schemas/Player' + BooleanEnum: + type: boolean + enum: + - true + ComposedObject: + type: object + allOf: + - {} + ComposedNumber: + type: number + allOf: + - {} + ComposedString: + type: string + allOf: + - {} + ComposedBool: + type: boolean + allOf: + - {} + ComposedArray: + type: array + items: {} + allOf: + - {} + ComposedNone: + type: 'null' + allOf: + - {} + Currency: + type: string + enum: + - eur + - usd + Money: type: object properties: - arrayData: - type: array - nullable: true - items: - type: object - properties: - labels: - type: array - items: - type: string - nullable: true - Mole: + amount: + type: string + format: number + currency: + $ref: '#/components/schemas/Currency' + required: + - amount + - currency + DecimalPayload: + type: string + format: number + ObjectWithDecimalProperties: + type: object + properties: + length: + $ref: '#/components/schemas/DecimalPayload' + width: + type: string + format: number + cost: + $ref: '#/components/schemas/Money' + ObjectWithInlineCompositionProperty: + type: object + properties: + someProp: + allOf: + - type: string + minLength: 1 + UUIDString: + type: string + format: uuid + minLength: 1 + AnyTypeNotString: + not: + type: string + JSONPatchRequest: + type: array + items: + oneOf: + - $ref: '#/components/schemas/JSONPatchRequestAddReplaceTest' + - $ref: '#/components/schemas/JSONPatchRequestRemove' + - $ref: '#/components/schemas/JSONPatchRequestMoveCopy' + JSONPatchRequestAddReplaceTest: type: object + additionalProperties: false required: - - blind - - smell - - hearing + - value + - op + - path properties: - blind: - type: boolean - readOnly: true - smell: + path: + description: A JSON Pointer path. type: string - readOnly: false - touch: - type: boolean - readOnly: true - taste: + value: + description: The value to add, replace or test. + op: + description: The operation to perform. type: string - readOnly: false - hearing: - type: boolean - seeingGhosts: - type: boolean - BooleanEnum: - type: boolean - enum: - - true - FooObject: + enum: + - add + - replace + - test + JSONPatchRequestRemove: type: object + additionalProperties: false + required: + - op + - path properties: - prop1: - type: array - items: - type: object - prop2: - type: object - StreamOptions: - allOf: - - $ref: "#/components/schemas/EgressThresholdOptions" - - $ref: "#/components/schemas/PublishOptions" - - EgressThresholdOptions: + path: + description: A JSON Pointer path. + type: string + op: + description: The operation to perform. + type: string + enum: + - remove + JSONPatchRequestMoveCopy: type: object + additionalProperties: false + required: + - from + - op + - path properties: - egressThresholds: - type: object + from: + description: A JSON Pointer path. + type: string + path: + description: A JSON Pointer path. + type: string + op: + description: The operation to perform. + type: string + enum: + - move + - copy + AdditionalPropertiesValidator: + type: object + allOf: + - type: object + additionalProperties: true + - type: object additionalProperties: - type: number - minimum: 0 - maximum: 1 - example: 0.9 - - PublishOptions: + minLength: 3 + - type: object + additionalProperties: + maxLength: 5 + AnyTypeAndFormat: type: object properties: - publish: - type : object - properties: - egressUnknownDetections: - type: boolean - example: true - filterZeroDetections: - type: boolean - example: true + uuid: + format: uuid + date: + format: date + date-time: + format: date-time + number: + format: number + binary: + format: binary + int32: + format: int32 + int64: + format: int64 + double: + format: double + float: + format: float \ No newline at end of file diff --git a/pom.xml b/pom.xml index 96d5b44a8e71..b3b042c74e38 100644 --- a/pom.xml +++ b/pom.xml @@ -1018,7 +1018,7 @@ - samples/client/petstore/python + samples/client/petstore/python-prior @@ -1202,8 +1202,8 @@ - samples/client/petstore/python - samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent + samples/client/petstore/python-prior + samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent @@ -1249,7 +1249,7 @@ samples/openapi3/client/petstore/python - samples/openapi3/client/petstore/python-experimental + samples/openapi3/client/petstore/python-prior diff --git a/samples/client/petstore/python/.gitignore b/samples/client/petstore/python-prior/.gitignore similarity index 100% rename from samples/client/petstore/python/.gitignore rename to samples/client/petstore/python-prior/.gitignore diff --git a/samples/client/petstore/python/.gitlab-ci.yml b/samples/client/petstore/python-prior/.gitlab-ci.yml similarity index 100% rename from samples/client/petstore/python/.gitlab-ci.yml rename to samples/client/petstore/python-prior/.gitlab-ci.yml diff --git a/samples/client/petstore/python/.openapi-generator-ignore b/samples/client/petstore/python-prior/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/python/.openapi-generator-ignore rename to samples/client/petstore/python-prior/.openapi-generator-ignore diff --git a/samples/client/petstore/python/.openapi-generator/FILES b/samples/client/petstore/python-prior/.openapi-generator/FILES similarity index 100% rename from samples/client/petstore/python/.openapi-generator/FILES rename to samples/client/petstore/python-prior/.openapi-generator/FILES diff --git a/samples/client/petstore/python/.openapi-generator/VERSION b/samples/client/petstore/python-prior/.openapi-generator/VERSION similarity index 100% rename from samples/client/petstore/python/.openapi-generator/VERSION rename to samples/client/petstore/python-prior/.openapi-generator/VERSION diff --git a/samples/client/petstore/python/.travis.yml b/samples/client/petstore/python-prior/.travis.yml similarity index 100% rename from samples/client/petstore/python/.travis.yml rename to samples/client/petstore/python-prior/.travis.yml diff --git a/samples/client/petstore/python/Makefile b/samples/client/petstore/python-prior/Makefile similarity index 100% rename from samples/client/petstore/python/Makefile rename to samples/client/petstore/python-prior/Makefile diff --git a/samples/client/petstore/python/README.md b/samples/client/petstore/python-prior/README.md similarity index 99% rename from samples/client/petstore/python/README.md rename to samples/client/petstore/python-prior/README.md index 4b34d32b616d..eb14e3a2d74f 100644 --- a/samples/client/petstore/python/README.md +++ b/samples/client/petstore/python-prior/README.md @@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: - API version: 1.0.0 - Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.PythonClientCodegen +- Build package: org.openapitools.codegen.languages.PythonPriorClientCodegen ## Requirements. diff --git a/samples/client/petstore/python/dev-requirements.txt b/samples/client/petstore/python-prior/dev-requirements.txt similarity index 100% rename from samples/client/petstore/python/dev-requirements.txt rename to samples/client/petstore/python-prior/dev-requirements.txt diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/python-prior/docs/AdditionalPropertiesAnyType.md similarity index 100% rename from samples/client/petstore/python/docs/AdditionalPropertiesAnyType.md rename to samples/client/petstore/python-prior/docs/AdditionalPropertiesAnyType.md diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesArray.md b/samples/client/petstore/python-prior/docs/AdditionalPropertiesArray.md similarity index 100% rename from samples/client/petstore/python/docs/AdditionalPropertiesArray.md rename to samples/client/petstore/python-prior/docs/AdditionalPropertiesArray.md diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/python-prior/docs/AdditionalPropertiesBoolean.md similarity index 100% rename from samples/client/petstore/python/docs/AdditionalPropertiesBoolean.md rename to samples/client/petstore/python-prior/docs/AdditionalPropertiesBoolean.md diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python-prior/docs/AdditionalPropertiesClass.md similarity index 100% rename from samples/client/petstore/python/docs/AdditionalPropertiesClass.md rename to samples/client/petstore/python-prior/docs/AdditionalPropertiesClass.md diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/python-prior/docs/AdditionalPropertiesInteger.md similarity index 100% rename from samples/client/petstore/python/docs/AdditionalPropertiesInteger.md rename to samples/client/petstore/python-prior/docs/AdditionalPropertiesInteger.md diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/python-prior/docs/AdditionalPropertiesNumber.md similarity index 100% rename from samples/client/petstore/python/docs/AdditionalPropertiesNumber.md rename to samples/client/petstore/python-prior/docs/AdditionalPropertiesNumber.md diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesObject.md b/samples/client/petstore/python-prior/docs/AdditionalPropertiesObject.md similarity index 100% rename from samples/client/petstore/python/docs/AdditionalPropertiesObject.md rename to samples/client/petstore/python-prior/docs/AdditionalPropertiesObject.md diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesString.md b/samples/client/petstore/python-prior/docs/AdditionalPropertiesString.md similarity index 100% rename from samples/client/petstore/python/docs/AdditionalPropertiesString.md rename to samples/client/petstore/python-prior/docs/AdditionalPropertiesString.md diff --git a/samples/client/petstore/python/docs/Animal.md b/samples/client/petstore/python-prior/docs/Animal.md similarity index 100% rename from samples/client/petstore/python/docs/Animal.md rename to samples/client/petstore/python-prior/docs/Animal.md diff --git a/samples/client/petstore/python/docs/AnimalFarm.md b/samples/client/petstore/python-prior/docs/AnimalFarm.md similarity index 100% rename from samples/client/petstore/python/docs/AnimalFarm.md rename to samples/client/petstore/python-prior/docs/AnimalFarm.md diff --git a/samples/client/petstore/python/docs/AnotherFakeApi.md b/samples/client/petstore/python-prior/docs/AnotherFakeApi.md similarity index 100% rename from samples/client/petstore/python/docs/AnotherFakeApi.md rename to samples/client/petstore/python-prior/docs/AnotherFakeApi.md diff --git a/samples/client/petstore/python/docs/ApiResponse.md b/samples/client/petstore/python-prior/docs/ApiResponse.md similarity index 100% rename from samples/client/petstore/python/docs/ApiResponse.md rename to samples/client/petstore/python-prior/docs/ApiResponse.md diff --git a/samples/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/python-prior/docs/ArrayOfArrayOfNumberOnly.md similarity index 100% rename from samples/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md rename to samples/client/petstore/python-prior/docs/ArrayOfArrayOfNumberOnly.md diff --git a/samples/client/petstore/python/docs/ArrayOfNumberOnly.md b/samples/client/petstore/python-prior/docs/ArrayOfNumberOnly.md similarity index 100% rename from samples/client/petstore/python/docs/ArrayOfNumberOnly.md rename to samples/client/petstore/python-prior/docs/ArrayOfNumberOnly.md diff --git a/samples/client/petstore/python/docs/ArrayTest.md b/samples/client/petstore/python-prior/docs/ArrayTest.md similarity index 100% rename from samples/client/petstore/python/docs/ArrayTest.md rename to samples/client/petstore/python-prior/docs/ArrayTest.md diff --git a/samples/client/petstore/python/docs/Capitalization.md b/samples/client/petstore/python-prior/docs/Capitalization.md similarity index 100% rename from samples/client/petstore/python/docs/Capitalization.md rename to samples/client/petstore/python-prior/docs/Capitalization.md diff --git a/samples/client/petstore/python/docs/Cat.md b/samples/client/petstore/python-prior/docs/Cat.md similarity index 100% rename from samples/client/petstore/python/docs/Cat.md rename to samples/client/petstore/python-prior/docs/Cat.md diff --git a/samples/client/petstore/python/docs/CatAllOf.md b/samples/client/petstore/python-prior/docs/CatAllOf.md similarity index 100% rename from samples/client/petstore/python/docs/CatAllOf.md rename to samples/client/petstore/python-prior/docs/CatAllOf.md diff --git a/samples/client/petstore/python/docs/Category.md b/samples/client/petstore/python-prior/docs/Category.md similarity index 100% rename from samples/client/petstore/python/docs/Category.md rename to samples/client/petstore/python-prior/docs/Category.md diff --git a/samples/client/petstore/python/docs/Child.md b/samples/client/petstore/python-prior/docs/Child.md similarity index 100% rename from samples/client/petstore/python/docs/Child.md rename to samples/client/petstore/python-prior/docs/Child.md diff --git a/samples/client/petstore/python/docs/ChildAllOf.md b/samples/client/petstore/python-prior/docs/ChildAllOf.md similarity index 100% rename from samples/client/petstore/python/docs/ChildAllOf.md rename to samples/client/petstore/python-prior/docs/ChildAllOf.md diff --git a/samples/client/petstore/python/docs/ChildCat.md b/samples/client/petstore/python-prior/docs/ChildCat.md similarity index 100% rename from samples/client/petstore/python/docs/ChildCat.md rename to samples/client/petstore/python-prior/docs/ChildCat.md diff --git a/samples/client/petstore/python/docs/ChildCatAllOf.md b/samples/client/petstore/python-prior/docs/ChildCatAllOf.md similarity index 100% rename from samples/client/petstore/python/docs/ChildCatAllOf.md rename to samples/client/petstore/python-prior/docs/ChildCatAllOf.md diff --git a/samples/client/petstore/python/docs/ChildDog.md b/samples/client/petstore/python-prior/docs/ChildDog.md similarity index 100% rename from samples/client/petstore/python/docs/ChildDog.md rename to samples/client/petstore/python-prior/docs/ChildDog.md diff --git a/samples/client/petstore/python/docs/ChildDogAllOf.md b/samples/client/petstore/python-prior/docs/ChildDogAllOf.md similarity index 100% rename from samples/client/petstore/python/docs/ChildDogAllOf.md rename to samples/client/petstore/python-prior/docs/ChildDogAllOf.md diff --git a/samples/client/petstore/python/docs/ChildLizard.md b/samples/client/petstore/python-prior/docs/ChildLizard.md similarity index 100% rename from samples/client/petstore/python/docs/ChildLizard.md rename to samples/client/petstore/python-prior/docs/ChildLizard.md diff --git a/samples/client/petstore/python/docs/ChildLizardAllOf.md b/samples/client/petstore/python-prior/docs/ChildLizardAllOf.md similarity index 100% rename from samples/client/petstore/python/docs/ChildLizardAllOf.md rename to samples/client/petstore/python-prior/docs/ChildLizardAllOf.md diff --git a/samples/client/petstore/python/docs/ClassModel.md b/samples/client/petstore/python-prior/docs/ClassModel.md similarity index 100% rename from samples/client/petstore/python/docs/ClassModel.md rename to samples/client/petstore/python-prior/docs/ClassModel.md diff --git a/samples/client/petstore/python/docs/Client.md b/samples/client/petstore/python-prior/docs/Client.md similarity index 100% rename from samples/client/petstore/python/docs/Client.md rename to samples/client/petstore/python-prior/docs/Client.md diff --git a/samples/client/petstore/python/docs/Dog.md b/samples/client/petstore/python-prior/docs/Dog.md similarity index 100% rename from samples/client/petstore/python/docs/Dog.md rename to samples/client/petstore/python-prior/docs/Dog.md diff --git a/samples/client/petstore/python/docs/DogAllOf.md b/samples/client/petstore/python-prior/docs/DogAllOf.md similarity index 100% rename from samples/client/petstore/python/docs/DogAllOf.md rename to samples/client/petstore/python-prior/docs/DogAllOf.md diff --git a/samples/client/petstore/python/docs/EnumArrays.md b/samples/client/petstore/python-prior/docs/EnumArrays.md similarity index 100% rename from samples/client/petstore/python/docs/EnumArrays.md rename to samples/client/petstore/python-prior/docs/EnumArrays.md diff --git a/samples/client/petstore/python/docs/EnumClass.md b/samples/client/petstore/python-prior/docs/EnumClass.md similarity index 100% rename from samples/client/petstore/python/docs/EnumClass.md rename to samples/client/petstore/python-prior/docs/EnumClass.md diff --git a/samples/client/petstore/python/docs/EnumTest.md b/samples/client/petstore/python-prior/docs/EnumTest.md similarity index 100% rename from samples/client/petstore/python/docs/EnumTest.md rename to samples/client/petstore/python-prior/docs/EnumTest.md diff --git a/samples/client/petstore/python/docs/FakeApi.md b/samples/client/petstore/python-prior/docs/FakeApi.md similarity index 100% rename from samples/client/petstore/python/docs/FakeApi.md rename to samples/client/petstore/python-prior/docs/FakeApi.md diff --git a/samples/client/petstore/python/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-prior/docs/FakeClassnameTags123Api.md similarity index 100% rename from samples/client/petstore/python/docs/FakeClassnameTags123Api.md rename to samples/client/petstore/python-prior/docs/FakeClassnameTags123Api.md diff --git a/samples/client/petstore/python/docs/File.md b/samples/client/petstore/python-prior/docs/File.md similarity index 100% rename from samples/client/petstore/python/docs/File.md rename to samples/client/petstore/python-prior/docs/File.md diff --git a/samples/client/petstore/python/docs/FileSchemaTestClass.md b/samples/client/petstore/python-prior/docs/FileSchemaTestClass.md similarity index 100% rename from samples/client/petstore/python/docs/FileSchemaTestClass.md rename to samples/client/petstore/python-prior/docs/FileSchemaTestClass.md diff --git a/samples/client/petstore/python/docs/FormatTest.md b/samples/client/petstore/python-prior/docs/FormatTest.md similarity index 100% rename from samples/client/petstore/python/docs/FormatTest.md rename to samples/client/petstore/python-prior/docs/FormatTest.md diff --git a/samples/client/petstore/python/docs/Grandparent.md b/samples/client/petstore/python-prior/docs/Grandparent.md similarity index 100% rename from samples/client/petstore/python/docs/Grandparent.md rename to samples/client/petstore/python-prior/docs/Grandparent.md diff --git a/samples/client/petstore/python/docs/GrandparentAnimal.md b/samples/client/petstore/python-prior/docs/GrandparentAnimal.md similarity index 100% rename from samples/client/petstore/python/docs/GrandparentAnimal.md rename to samples/client/petstore/python-prior/docs/GrandparentAnimal.md diff --git a/samples/client/petstore/python/docs/HasOnlyReadOnly.md b/samples/client/petstore/python-prior/docs/HasOnlyReadOnly.md similarity index 100% rename from samples/client/petstore/python/docs/HasOnlyReadOnly.md rename to samples/client/petstore/python-prior/docs/HasOnlyReadOnly.md diff --git a/samples/client/petstore/python/docs/List.md b/samples/client/petstore/python-prior/docs/List.md similarity index 100% rename from samples/client/petstore/python/docs/List.md rename to samples/client/petstore/python-prior/docs/List.md diff --git a/samples/client/petstore/python/docs/MapTest.md b/samples/client/petstore/python-prior/docs/MapTest.md similarity index 100% rename from samples/client/petstore/python/docs/MapTest.md rename to samples/client/petstore/python-prior/docs/MapTest.md diff --git a/samples/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python-prior/docs/MixedPropertiesAndAdditionalPropertiesClass.md similarity index 100% rename from samples/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md rename to samples/client/petstore/python-prior/docs/MixedPropertiesAndAdditionalPropertiesClass.md diff --git a/samples/client/petstore/python/docs/Model200Response.md b/samples/client/petstore/python-prior/docs/Model200Response.md similarity index 100% rename from samples/client/petstore/python/docs/Model200Response.md rename to samples/client/petstore/python-prior/docs/Model200Response.md diff --git a/samples/client/petstore/python/docs/ModelReturn.md b/samples/client/petstore/python-prior/docs/ModelReturn.md similarity index 100% rename from samples/client/petstore/python/docs/ModelReturn.md rename to samples/client/petstore/python-prior/docs/ModelReturn.md diff --git a/samples/client/petstore/python/docs/Model_200Response.md b/samples/client/petstore/python-prior/docs/Model_200Response.md similarity index 100% rename from samples/client/petstore/python/docs/Model_200Response.md rename to samples/client/petstore/python-prior/docs/Model_200Response.md diff --git a/samples/client/petstore/python/docs/Model_Return.md b/samples/client/petstore/python-prior/docs/Model_Return.md similarity index 100% rename from samples/client/petstore/python/docs/Model_Return.md rename to samples/client/petstore/python-prior/docs/Model_Return.md diff --git a/samples/client/petstore/python/docs/Name.md b/samples/client/petstore/python-prior/docs/Name.md similarity index 100% rename from samples/client/petstore/python/docs/Name.md rename to samples/client/petstore/python-prior/docs/Name.md diff --git a/samples/client/petstore/python/docs/NumberOnly.md b/samples/client/petstore/python-prior/docs/NumberOnly.md similarity index 100% rename from samples/client/petstore/python/docs/NumberOnly.md rename to samples/client/petstore/python-prior/docs/NumberOnly.md diff --git a/samples/client/petstore/python/docs/NumberWithValidations.md b/samples/client/petstore/python-prior/docs/NumberWithValidations.md similarity index 100% rename from samples/client/petstore/python/docs/NumberWithValidations.md rename to samples/client/petstore/python-prior/docs/NumberWithValidations.md diff --git a/samples/client/petstore/python/docs/ObjectModelWithRefProps.md b/samples/client/petstore/python-prior/docs/ObjectModelWithRefProps.md similarity index 100% rename from samples/client/petstore/python/docs/ObjectModelWithRefProps.md rename to samples/client/petstore/python-prior/docs/ObjectModelWithRefProps.md diff --git a/samples/client/petstore/python/docs/Order.md b/samples/client/petstore/python-prior/docs/Order.md similarity index 100% rename from samples/client/petstore/python/docs/Order.md rename to samples/client/petstore/python-prior/docs/Order.md diff --git a/samples/client/petstore/python/docs/Parent.md b/samples/client/petstore/python-prior/docs/Parent.md similarity index 100% rename from samples/client/petstore/python/docs/Parent.md rename to samples/client/petstore/python-prior/docs/Parent.md diff --git a/samples/client/petstore/python/docs/ParentAllOf.md b/samples/client/petstore/python-prior/docs/ParentAllOf.md similarity index 100% rename from samples/client/petstore/python/docs/ParentAllOf.md rename to samples/client/petstore/python-prior/docs/ParentAllOf.md diff --git a/samples/client/petstore/python/docs/ParentPet.md b/samples/client/petstore/python-prior/docs/ParentPet.md similarity index 100% rename from samples/client/petstore/python/docs/ParentPet.md rename to samples/client/petstore/python-prior/docs/ParentPet.md diff --git a/samples/client/petstore/python/docs/Pet.md b/samples/client/petstore/python-prior/docs/Pet.md similarity index 100% rename from samples/client/petstore/python/docs/Pet.md rename to samples/client/petstore/python-prior/docs/Pet.md diff --git a/samples/client/petstore/python/docs/PetApi.md b/samples/client/petstore/python-prior/docs/PetApi.md similarity index 100% rename from samples/client/petstore/python/docs/PetApi.md rename to samples/client/petstore/python-prior/docs/PetApi.md diff --git a/samples/client/petstore/python/docs/Player.md b/samples/client/petstore/python-prior/docs/Player.md similarity index 100% rename from samples/client/petstore/python/docs/Player.md rename to samples/client/petstore/python-prior/docs/Player.md diff --git a/samples/client/petstore/python/docs/Polygon.md b/samples/client/petstore/python-prior/docs/Polygon.md similarity index 100% rename from samples/client/petstore/python/docs/Polygon.md rename to samples/client/petstore/python-prior/docs/Polygon.md diff --git a/samples/client/petstore/python/docs/PolygonAllOf.md b/samples/client/petstore/python-prior/docs/PolygonAllOf.md similarity index 100% rename from samples/client/petstore/python/docs/PolygonAllOf.md rename to samples/client/petstore/python-prior/docs/PolygonAllOf.md diff --git a/samples/client/petstore/python/docs/ReadOnlyFirst.md b/samples/client/petstore/python-prior/docs/ReadOnlyFirst.md similarity index 100% rename from samples/client/petstore/python/docs/ReadOnlyFirst.md rename to samples/client/petstore/python-prior/docs/ReadOnlyFirst.md diff --git a/samples/client/petstore/python/docs/Shape.md b/samples/client/petstore/python-prior/docs/Shape.md similarity index 100% rename from samples/client/petstore/python/docs/Shape.md rename to samples/client/petstore/python-prior/docs/Shape.md diff --git a/samples/client/petstore/python/docs/SpecialModelName.md b/samples/client/petstore/python-prior/docs/SpecialModelName.md similarity index 100% rename from samples/client/petstore/python/docs/SpecialModelName.md rename to samples/client/petstore/python-prior/docs/SpecialModelName.md diff --git a/samples/client/petstore/python/docs/Square.md b/samples/client/petstore/python-prior/docs/Square.md similarity index 100% rename from samples/client/petstore/python/docs/Square.md rename to samples/client/petstore/python-prior/docs/Square.md diff --git a/samples/client/petstore/python/docs/SquareAllOf.md b/samples/client/petstore/python-prior/docs/SquareAllOf.md similarity index 100% rename from samples/client/petstore/python/docs/SquareAllOf.md rename to samples/client/petstore/python-prior/docs/SquareAllOf.md diff --git a/samples/client/petstore/python/docs/StoreApi.md b/samples/client/petstore/python-prior/docs/StoreApi.md similarity index 100% rename from samples/client/petstore/python/docs/StoreApi.md rename to samples/client/petstore/python-prior/docs/StoreApi.md diff --git a/samples/client/petstore/python/docs/StringBooleanMap.md b/samples/client/petstore/python-prior/docs/StringBooleanMap.md similarity index 100% rename from samples/client/petstore/python/docs/StringBooleanMap.md rename to samples/client/petstore/python-prior/docs/StringBooleanMap.md diff --git a/samples/client/petstore/python/docs/StringEnum.md b/samples/client/petstore/python-prior/docs/StringEnum.md similarity index 100% rename from samples/client/petstore/python/docs/StringEnum.md rename to samples/client/petstore/python-prior/docs/StringEnum.md diff --git a/samples/client/petstore/python/docs/Tag.md b/samples/client/petstore/python-prior/docs/Tag.md similarity index 100% rename from samples/client/petstore/python/docs/Tag.md rename to samples/client/petstore/python-prior/docs/Tag.md diff --git a/samples/client/petstore/python/docs/Triangle.md b/samples/client/petstore/python-prior/docs/Triangle.md similarity index 100% rename from samples/client/petstore/python/docs/Triangle.md rename to samples/client/petstore/python-prior/docs/Triangle.md diff --git a/samples/client/petstore/python/docs/TriangleAllOf.md b/samples/client/petstore/python-prior/docs/TriangleAllOf.md similarity index 100% rename from samples/client/petstore/python/docs/TriangleAllOf.md rename to samples/client/petstore/python-prior/docs/TriangleAllOf.md diff --git a/samples/client/petstore/python/docs/TypeHolderDefault.md b/samples/client/petstore/python-prior/docs/TypeHolderDefault.md similarity index 100% rename from samples/client/petstore/python/docs/TypeHolderDefault.md rename to samples/client/petstore/python-prior/docs/TypeHolderDefault.md diff --git a/samples/client/petstore/python/docs/TypeHolderExample.md b/samples/client/petstore/python-prior/docs/TypeHolderExample.md similarity index 100% rename from samples/client/petstore/python/docs/TypeHolderExample.md rename to samples/client/petstore/python-prior/docs/TypeHolderExample.md diff --git a/samples/client/petstore/python/docs/User.md b/samples/client/petstore/python-prior/docs/User.md similarity index 100% rename from samples/client/petstore/python/docs/User.md rename to samples/client/petstore/python-prior/docs/User.md diff --git a/samples/client/petstore/python/docs/UserApi.md b/samples/client/petstore/python-prior/docs/UserApi.md similarity index 100% rename from samples/client/petstore/python/docs/UserApi.md rename to samples/client/petstore/python-prior/docs/UserApi.md diff --git a/samples/client/petstore/python/docs/XmlItem.md b/samples/client/petstore/python-prior/docs/XmlItem.md similarity index 100% rename from samples/client/petstore/python/docs/XmlItem.md rename to samples/client/petstore/python-prior/docs/XmlItem.md diff --git a/samples/client/petstore/python/git_push.sh b/samples/client/petstore/python-prior/git_push.sh similarity index 100% rename from samples/client/petstore/python/git_push.sh rename to samples/client/petstore/python-prior/git_push.sh diff --git a/samples/client/petstore/python/petstore_api/__init__.py b/samples/client/petstore/python-prior/petstore_api/__init__.py similarity index 100% rename from samples/client/petstore/python/petstore_api/__init__.py rename to samples/client/petstore/python-prior/petstore_api/__init__.py diff --git a/samples/client/petstore/python/petstore_api/api/__init__.py b/samples/client/petstore/python-prior/petstore_api/api/__init__.py similarity index 100% rename from samples/client/petstore/python/petstore_api/api/__init__.py rename to samples/client/petstore/python-prior/petstore_api/api/__init__.py diff --git a/samples/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-prior/petstore_api/api/another_fake_api.py similarity index 100% rename from samples/client/petstore/python/petstore_api/api/another_fake_api.py rename to samples/client/petstore/python-prior/petstore_api/api/another_fake_api.py diff --git a/samples/client/petstore/python/petstore_api/api/fake_api.py b/samples/client/petstore/python-prior/petstore_api/api/fake_api.py similarity index 100% rename from samples/client/petstore/python/petstore_api/api/fake_api.py rename to samples/client/petstore/python-prior/petstore_api/api/fake_api.py diff --git a/samples/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python-prior/petstore_api/api/fake_classname_tags123_api.py similarity index 100% rename from samples/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py rename to samples/client/petstore/python-prior/petstore_api/api/fake_classname_tags123_api.py diff --git a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-prior/petstore_api/api/fake_classname_tags_123_api.py similarity index 100% rename from samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py rename to samples/client/petstore/python-prior/petstore_api/api/fake_classname_tags_123_api.py diff --git a/samples/client/petstore/python/petstore_api/api/pet_api.py b/samples/client/petstore/python-prior/petstore_api/api/pet_api.py similarity index 100% rename from samples/client/petstore/python/petstore_api/api/pet_api.py rename to samples/client/petstore/python-prior/petstore_api/api/pet_api.py diff --git a/samples/client/petstore/python/petstore_api/api/store_api.py b/samples/client/petstore/python-prior/petstore_api/api/store_api.py similarity index 100% rename from samples/client/petstore/python/petstore_api/api/store_api.py rename to samples/client/petstore/python-prior/petstore_api/api/store_api.py diff --git a/samples/client/petstore/python/petstore_api/api/user_api.py b/samples/client/petstore/python-prior/petstore_api/api/user_api.py similarity index 100% rename from samples/client/petstore/python/petstore_api/api/user_api.py rename to samples/client/petstore/python-prior/petstore_api/api/user_api.py diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python-prior/petstore_api/api_client.py similarity index 100% rename from samples/client/petstore/python/petstore_api/api_client.py rename to samples/client/petstore/python-prior/petstore_api/api_client.py diff --git a/samples/client/petstore/python/petstore_api/apis/__init__.py b/samples/client/petstore/python-prior/petstore_api/apis/__init__.py similarity index 100% rename from samples/client/petstore/python/petstore_api/apis/__init__.py rename to samples/client/petstore/python-prior/petstore_api/apis/__init__.py diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python-prior/petstore_api/configuration.py similarity index 100% rename from samples/client/petstore/python/petstore_api/configuration.py rename to samples/client/petstore/python-prior/petstore_api/configuration.py diff --git a/samples/client/petstore/python/petstore_api/exceptions.py b/samples/client/petstore/python-prior/petstore_api/exceptions.py similarity index 100% rename from samples/client/petstore/python/petstore_api/exceptions.py rename to samples/client/petstore/python-prior/petstore_api/exceptions.py diff --git a/samples/client/petstore/python/petstore_api/model/__init__.py b/samples/client/petstore/python-prior/petstore_api/model/__init__.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/__init__.py rename to samples/client/petstore/python-prior/petstore_api/model/__init__.py diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_any_type.py b/samples/client/petstore/python-prior/petstore_api/model/additional_properties_any_type.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/additional_properties_any_type.py rename to samples/client/petstore/python-prior/petstore_api/model/additional_properties_any_type.py diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_array.py b/samples/client/petstore/python-prior/petstore_api/model/additional_properties_array.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/additional_properties_array.py rename to samples/client/petstore/python-prior/petstore_api/model/additional_properties_array.py diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_boolean.py b/samples/client/petstore/python-prior/petstore_api/model/additional_properties_boolean.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/additional_properties_boolean.py rename to samples/client/petstore/python-prior/petstore_api/model/additional_properties_boolean.py diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_class.py b/samples/client/petstore/python-prior/petstore_api/model/additional_properties_class.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/additional_properties_class.py rename to samples/client/petstore/python-prior/petstore_api/model/additional_properties_class.py diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_integer.py b/samples/client/petstore/python-prior/petstore_api/model/additional_properties_integer.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/additional_properties_integer.py rename to samples/client/petstore/python-prior/petstore_api/model/additional_properties_integer.py diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_number.py b/samples/client/petstore/python-prior/petstore_api/model/additional_properties_number.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/additional_properties_number.py rename to samples/client/petstore/python-prior/petstore_api/model/additional_properties_number.py diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_object.py b/samples/client/petstore/python-prior/petstore_api/model/additional_properties_object.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/additional_properties_object.py rename to samples/client/petstore/python-prior/petstore_api/model/additional_properties_object.py diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_string.py b/samples/client/petstore/python-prior/petstore_api/model/additional_properties_string.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/additional_properties_string.py rename to samples/client/petstore/python-prior/petstore_api/model/additional_properties_string.py diff --git a/samples/client/petstore/python/petstore_api/model/animal.py b/samples/client/petstore/python-prior/petstore_api/model/animal.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/animal.py rename to samples/client/petstore/python-prior/petstore_api/model/animal.py diff --git a/samples/client/petstore/python/petstore_api/model/animal_farm.py b/samples/client/petstore/python-prior/petstore_api/model/animal_farm.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/animal_farm.py rename to samples/client/petstore/python-prior/petstore_api/model/animal_farm.py diff --git a/samples/client/petstore/python/petstore_api/model/api_response.py b/samples/client/petstore/python-prior/petstore_api/model/api_response.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/api_response.py rename to samples/client/petstore/python-prior/petstore_api/model/api_response.py diff --git a/samples/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py b/samples/client/petstore/python-prior/petstore_api/model/array_of_array_of_number_only.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py rename to samples/client/petstore/python-prior/petstore_api/model/array_of_array_of_number_only.py diff --git a/samples/client/petstore/python/petstore_api/model/array_of_number_only.py b/samples/client/petstore/python-prior/petstore_api/model/array_of_number_only.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/array_of_number_only.py rename to samples/client/petstore/python-prior/petstore_api/model/array_of_number_only.py diff --git a/samples/client/petstore/python/petstore_api/model/array_test.py b/samples/client/petstore/python-prior/petstore_api/model/array_test.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/array_test.py rename to samples/client/petstore/python-prior/petstore_api/model/array_test.py diff --git a/samples/client/petstore/python/petstore_api/model/capitalization.py b/samples/client/petstore/python-prior/petstore_api/model/capitalization.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/capitalization.py rename to samples/client/petstore/python-prior/petstore_api/model/capitalization.py diff --git a/samples/client/petstore/python/petstore_api/model/cat.py b/samples/client/petstore/python-prior/petstore_api/model/cat.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/cat.py rename to samples/client/petstore/python-prior/petstore_api/model/cat.py diff --git a/samples/client/petstore/python/petstore_api/model/cat_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/cat_all_of.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/cat_all_of.py rename to samples/client/petstore/python-prior/petstore_api/model/cat_all_of.py diff --git a/samples/client/petstore/python/petstore_api/model/category.py b/samples/client/petstore/python-prior/petstore_api/model/category.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/category.py rename to samples/client/petstore/python-prior/petstore_api/model/category.py diff --git a/samples/client/petstore/python/petstore_api/model/child.py b/samples/client/petstore/python-prior/petstore_api/model/child.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/child.py rename to samples/client/petstore/python-prior/petstore_api/model/child.py diff --git a/samples/client/petstore/python/petstore_api/model/child_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/child_all_of.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/child_all_of.py rename to samples/client/petstore/python-prior/petstore_api/model/child_all_of.py diff --git a/samples/client/petstore/python/petstore_api/model/child_cat.py b/samples/client/petstore/python-prior/petstore_api/model/child_cat.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/child_cat.py rename to samples/client/petstore/python-prior/petstore_api/model/child_cat.py diff --git a/samples/client/petstore/python/petstore_api/model/child_cat_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/child_cat_all_of.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/child_cat_all_of.py rename to samples/client/petstore/python-prior/petstore_api/model/child_cat_all_of.py diff --git a/samples/client/petstore/python/petstore_api/model/child_dog.py b/samples/client/petstore/python-prior/petstore_api/model/child_dog.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/child_dog.py rename to samples/client/petstore/python-prior/petstore_api/model/child_dog.py diff --git a/samples/client/petstore/python/petstore_api/model/child_dog_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/child_dog_all_of.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/child_dog_all_of.py rename to samples/client/petstore/python-prior/petstore_api/model/child_dog_all_of.py diff --git a/samples/client/petstore/python/petstore_api/model/child_lizard.py b/samples/client/petstore/python-prior/petstore_api/model/child_lizard.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/child_lizard.py rename to samples/client/petstore/python-prior/petstore_api/model/child_lizard.py diff --git a/samples/client/petstore/python/petstore_api/model/child_lizard_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/child_lizard_all_of.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/child_lizard_all_of.py rename to samples/client/petstore/python-prior/petstore_api/model/child_lizard_all_of.py diff --git a/samples/client/petstore/python/petstore_api/model/class_model.py b/samples/client/petstore/python-prior/petstore_api/model/class_model.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/class_model.py rename to samples/client/petstore/python-prior/petstore_api/model/class_model.py diff --git a/samples/client/petstore/python/petstore_api/model/client.py b/samples/client/petstore/python-prior/petstore_api/model/client.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/client.py rename to samples/client/petstore/python-prior/petstore_api/model/client.py diff --git a/samples/client/petstore/python/petstore_api/model/dog.py b/samples/client/petstore/python-prior/petstore_api/model/dog.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/dog.py rename to samples/client/petstore/python-prior/petstore_api/model/dog.py diff --git a/samples/client/petstore/python/petstore_api/model/dog_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/dog_all_of.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/dog_all_of.py rename to samples/client/petstore/python-prior/petstore_api/model/dog_all_of.py diff --git a/samples/client/petstore/python/petstore_api/model/enum_arrays.py b/samples/client/petstore/python-prior/petstore_api/model/enum_arrays.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/enum_arrays.py rename to samples/client/petstore/python-prior/petstore_api/model/enum_arrays.py diff --git a/samples/client/petstore/python/petstore_api/model/enum_class.py b/samples/client/petstore/python-prior/petstore_api/model/enum_class.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/enum_class.py rename to samples/client/petstore/python-prior/petstore_api/model/enum_class.py diff --git a/samples/client/petstore/python/petstore_api/model/enum_test.py b/samples/client/petstore/python-prior/petstore_api/model/enum_test.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/enum_test.py rename to samples/client/petstore/python-prior/petstore_api/model/enum_test.py diff --git a/samples/client/petstore/python/petstore_api/model/file.py b/samples/client/petstore/python-prior/petstore_api/model/file.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/file.py rename to samples/client/petstore/python-prior/petstore_api/model/file.py diff --git a/samples/client/petstore/python/petstore_api/model/file_schema_test_class.py b/samples/client/petstore/python-prior/petstore_api/model/file_schema_test_class.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/file_schema_test_class.py rename to samples/client/petstore/python-prior/petstore_api/model/file_schema_test_class.py diff --git a/samples/client/petstore/python/petstore_api/model/format_test.py b/samples/client/petstore/python-prior/petstore_api/model/format_test.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/format_test.py rename to samples/client/petstore/python-prior/petstore_api/model/format_test.py diff --git a/samples/client/petstore/python/petstore_api/model/grandparent.py b/samples/client/petstore/python-prior/petstore_api/model/grandparent.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/grandparent.py rename to samples/client/petstore/python-prior/petstore_api/model/grandparent.py diff --git a/samples/client/petstore/python/petstore_api/model/grandparent_animal.py b/samples/client/petstore/python-prior/petstore_api/model/grandparent_animal.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/grandparent_animal.py rename to samples/client/petstore/python-prior/petstore_api/model/grandparent_animal.py diff --git a/samples/client/petstore/python/petstore_api/model/has_only_read_only.py b/samples/client/petstore/python-prior/petstore_api/model/has_only_read_only.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/has_only_read_only.py rename to samples/client/petstore/python-prior/petstore_api/model/has_only_read_only.py diff --git a/samples/client/petstore/python/petstore_api/model/list.py b/samples/client/petstore/python-prior/petstore_api/model/list.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/list.py rename to samples/client/petstore/python-prior/petstore_api/model/list.py diff --git a/samples/client/petstore/python/petstore_api/model/map_test.py b/samples/client/petstore/python-prior/petstore_api/model/map_test.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/map_test.py rename to samples/client/petstore/python-prior/petstore_api/model/map_test.py diff --git a/samples/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-prior/petstore_api/model/mixed_properties_and_additional_properties_class.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py rename to samples/client/petstore/python-prior/petstore_api/model/mixed_properties_and_additional_properties_class.py diff --git a/samples/client/petstore/python/petstore_api/model/model200_response.py b/samples/client/petstore/python-prior/petstore_api/model/model200_response.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/model200_response.py rename to samples/client/petstore/python-prior/petstore_api/model/model200_response.py diff --git a/samples/client/petstore/python/petstore_api/model/model_200_response.py b/samples/client/petstore/python-prior/petstore_api/model/model_200_response.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/model_200_response.py rename to samples/client/petstore/python-prior/petstore_api/model/model_200_response.py diff --git a/samples/client/petstore/python/petstore_api/model/model_return.py b/samples/client/petstore/python-prior/petstore_api/model/model_return.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/model_return.py rename to samples/client/petstore/python-prior/petstore_api/model/model_return.py diff --git a/samples/client/petstore/python/petstore_api/model/name.py b/samples/client/petstore/python-prior/petstore_api/model/name.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/name.py rename to samples/client/petstore/python-prior/petstore_api/model/name.py diff --git a/samples/client/petstore/python/petstore_api/model/number_only.py b/samples/client/petstore/python-prior/petstore_api/model/number_only.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/number_only.py rename to samples/client/petstore/python-prior/petstore_api/model/number_only.py diff --git a/samples/client/petstore/python/petstore_api/model/number_with_validations.py b/samples/client/petstore/python-prior/petstore_api/model/number_with_validations.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/number_with_validations.py rename to samples/client/petstore/python-prior/petstore_api/model/number_with_validations.py diff --git a/samples/client/petstore/python/petstore_api/model/object_model_with_ref_props.py b/samples/client/petstore/python-prior/petstore_api/model/object_model_with_ref_props.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/object_model_with_ref_props.py rename to samples/client/petstore/python-prior/petstore_api/model/object_model_with_ref_props.py diff --git a/samples/client/petstore/python/petstore_api/model/order.py b/samples/client/petstore/python-prior/petstore_api/model/order.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/order.py rename to samples/client/petstore/python-prior/petstore_api/model/order.py diff --git a/samples/client/petstore/python/petstore_api/model/parent.py b/samples/client/petstore/python-prior/petstore_api/model/parent.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/parent.py rename to samples/client/petstore/python-prior/petstore_api/model/parent.py diff --git a/samples/client/petstore/python/petstore_api/model/parent_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/parent_all_of.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/parent_all_of.py rename to samples/client/petstore/python-prior/petstore_api/model/parent_all_of.py diff --git a/samples/client/petstore/python/petstore_api/model/parent_pet.py b/samples/client/petstore/python-prior/petstore_api/model/parent_pet.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/parent_pet.py rename to samples/client/petstore/python-prior/petstore_api/model/parent_pet.py diff --git a/samples/client/petstore/python/petstore_api/model/pet.py b/samples/client/petstore/python-prior/petstore_api/model/pet.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/pet.py rename to samples/client/petstore/python-prior/petstore_api/model/pet.py diff --git a/samples/client/petstore/python/petstore_api/model/player.py b/samples/client/petstore/python-prior/petstore_api/model/player.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/player.py rename to samples/client/petstore/python-prior/petstore_api/model/player.py diff --git a/samples/client/petstore/python/petstore_api/model/polygon.py b/samples/client/petstore/python-prior/petstore_api/model/polygon.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/polygon.py rename to samples/client/petstore/python-prior/petstore_api/model/polygon.py diff --git a/samples/client/petstore/python/petstore_api/model/polygon_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/polygon_all_of.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/polygon_all_of.py rename to samples/client/petstore/python-prior/petstore_api/model/polygon_all_of.py diff --git a/samples/client/petstore/python/petstore_api/model/read_only_first.py b/samples/client/petstore/python-prior/petstore_api/model/read_only_first.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/read_only_first.py rename to samples/client/petstore/python-prior/petstore_api/model/read_only_first.py diff --git a/samples/client/petstore/python/petstore_api/model/shape.py b/samples/client/petstore/python-prior/petstore_api/model/shape.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/shape.py rename to samples/client/petstore/python-prior/petstore_api/model/shape.py diff --git a/samples/client/petstore/python/petstore_api/model/special_model_name.py b/samples/client/petstore/python-prior/petstore_api/model/special_model_name.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/special_model_name.py rename to samples/client/petstore/python-prior/petstore_api/model/special_model_name.py diff --git a/samples/client/petstore/python/petstore_api/model/square.py b/samples/client/petstore/python-prior/petstore_api/model/square.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/square.py rename to samples/client/petstore/python-prior/petstore_api/model/square.py diff --git a/samples/client/petstore/python/petstore_api/model/square_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/square_all_of.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/square_all_of.py rename to samples/client/petstore/python-prior/petstore_api/model/square_all_of.py diff --git a/samples/client/petstore/python/petstore_api/model/string_boolean_map.py b/samples/client/petstore/python-prior/petstore_api/model/string_boolean_map.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/string_boolean_map.py rename to samples/client/petstore/python-prior/petstore_api/model/string_boolean_map.py diff --git a/samples/client/petstore/python/petstore_api/model/string_enum.py b/samples/client/petstore/python-prior/petstore_api/model/string_enum.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/string_enum.py rename to samples/client/petstore/python-prior/petstore_api/model/string_enum.py diff --git a/samples/client/petstore/python/petstore_api/model/tag.py b/samples/client/petstore/python-prior/petstore_api/model/tag.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/tag.py rename to samples/client/petstore/python-prior/petstore_api/model/tag.py diff --git a/samples/client/petstore/python/petstore_api/model/triangle.py b/samples/client/petstore/python-prior/petstore_api/model/triangle.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/triangle.py rename to samples/client/petstore/python-prior/petstore_api/model/triangle.py diff --git a/samples/client/petstore/python/petstore_api/model/triangle_all_of.py b/samples/client/petstore/python-prior/petstore_api/model/triangle_all_of.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/triangle_all_of.py rename to samples/client/petstore/python-prior/petstore_api/model/triangle_all_of.py diff --git a/samples/client/petstore/python/petstore_api/model/type_holder_default.py b/samples/client/petstore/python-prior/petstore_api/model/type_holder_default.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/type_holder_default.py rename to samples/client/petstore/python-prior/petstore_api/model/type_holder_default.py diff --git a/samples/client/petstore/python/petstore_api/model/type_holder_example.py b/samples/client/petstore/python-prior/petstore_api/model/type_holder_example.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/type_holder_example.py rename to samples/client/petstore/python-prior/petstore_api/model/type_holder_example.py diff --git a/samples/client/petstore/python/petstore_api/model/user.py b/samples/client/petstore/python-prior/petstore_api/model/user.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/user.py rename to samples/client/petstore/python-prior/petstore_api/model/user.py diff --git a/samples/client/petstore/python/petstore_api/model/xml_item.py b/samples/client/petstore/python-prior/petstore_api/model/xml_item.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model/xml_item.py rename to samples/client/petstore/python-prior/petstore_api/model/xml_item.py diff --git a/samples/client/petstore/python/petstore_api/model_utils.py b/samples/client/petstore/python-prior/petstore_api/model_utils.py similarity index 100% rename from samples/client/petstore/python/petstore_api/model_utils.py rename to samples/client/petstore/python-prior/petstore_api/model_utils.py diff --git a/samples/client/petstore/python/petstore_api/models/__init__.py b/samples/client/petstore/python-prior/petstore_api/models/__init__.py similarity index 100% rename from samples/client/petstore/python/petstore_api/models/__init__.py rename to samples/client/petstore/python-prior/petstore_api/models/__init__.py diff --git a/samples/client/petstore/python/petstore_api/rest.py b/samples/client/petstore/python-prior/petstore_api/rest.py similarity index 100% rename from samples/client/petstore/python/petstore_api/rest.py rename to samples/client/petstore/python-prior/petstore_api/rest.py diff --git a/samples/client/petstore/python/pom.xml b/samples/client/petstore/python-prior/pom.xml similarity index 100% rename from samples/client/petstore/python/pom.xml rename to samples/client/petstore/python-prior/pom.xml diff --git a/samples/client/petstore/python/requirements.txt b/samples/client/petstore/python-prior/requirements.txt similarity index 100% rename from samples/client/petstore/python/requirements.txt rename to samples/client/petstore/python-prior/requirements.txt diff --git a/samples/client/petstore/python/setup.cfg b/samples/client/petstore/python-prior/setup.cfg similarity index 100% rename from samples/client/petstore/python/setup.cfg rename to samples/client/petstore/python-prior/setup.cfg diff --git a/samples/client/petstore/python/setup.py b/samples/client/petstore/python-prior/setup.py similarity index 100% rename from samples/client/petstore/python/setup.py rename to samples/client/petstore/python-prior/setup.py diff --git a/samples/client/petstore/python/test-requirements.txt b/samples/client/petstore/python-prior/test-requirements.txt similarity index 100% rename from samples/client/petstore/python/test-requirements.txt rename to samples/client/petstore/python-prior/test-requirements.txt diff --git a/samples/client/petstore/python/test/__init__.py b/samples/client/petstore/python-prior/test/__init__.py similarity index 100% rename from samples/client/petstore/python/test/__init__.py rename to samples/client/petstore/python-prior/test/__init__.py diff --git a/samples/client/petstore/python/test/test_additional_properties_any_type.py b/samples/client/petstore/python-prior/test/test_additional_properties_any_type.py similarity index 100% rename from samples/client/petstore/python/test/test_additional_properties_any_type.py rename to samples/client/petstore/python-prior/test/test_additional_properties_any_type.py diff --git a/samples/client/petstore/python/test/test_additional_properties_array.py b/samples/client/petstore/python-prior/test/test_additional_properties_array.py similarity index 100% rename from samples/client/petstore/python/test/test_additional_properties_array.py rename to samples/client/petstore/python-prior/test/test_additional_properties_array.py diff --git a/samples/client/petstore/python/test/test_additional_properties_boolean.py b/samples/client/petstore/python-prior/test/test_additional_properties_boolean.py similarity index 100% rename from samples/client/petstore/python/test/test_additional_properties_boolean.py rename to samples/client/petstore/python-prior/test/test_additional_properties_boolean.py diff --git a/samples/client/petstore/python/test/test_additional_properties_class.py b/samples/client/petstore/python-prior/test/test_additional_properties_class.py similarity index 100% rename from samples/client/petstore/python/test/test_additional_properties_class.py rename to samples/client/petstore/python-prior/test/test_additional_properties_class.py diff --git a/samples/client/petstore/python/test/test_additional_properties_integer.py b/samples/client/petstore/python-prior/test/test_additional_properties_integer.py similarity index 100% rename from samples/client/petstore/python/test/test_additional_properties_integer.py rename to samples/client/petstore/python-prior/test/test_additional_properties_integer.py diff --git a/samples/client/petstore/python/test/test_additional_properties_number.py b/samples/client/petstore/python-prior/test/test_additional_properties_number.py similarity index 100% rename from samples/client/petstore/python/test/test_additional_properties_number.py rename to samples/client/petstore/python-prior/test/test_additional_properties_number.py diff --git a/samples/client/petstore/python/test/test_additional_properties_object.py b/samples/client/petstore/python-prior/test/test_additional_properties_object.py similarity index 100% rename from samples/client/petstore/python/test/test_additional_properties_object.py rename to samples/client/petstore/python-prior/test/test_additional_properties_object.py diff --git a/samples/client/petstore/python/test/test_additional_properties_string.py b/samples/client/petstore/python-prior/test/test_additional_properties_string.py similarity index 100% rename from samples/client/petstore/python/test/test_additional_properties_string.py rename to samples/client/petstore/python-prior/test/test_additional_properties_string.py diff --git a/samples/client/petstore/python/test/test_animal.py b/samples/client/petstore/python-prior/test/test_animal.py similarity index 100% rename from samples/client/petstore/python/test/test_animal.py rename to samples/client/petstore/python-prior/test/test_animal.py diff --git a/samples/client/petstore/python/test/test_animal_farm.py b/samples/client/petstore/python-prior/test/test_animal_farm.py similarity index 100% rename from samples/client/petstore/python/test/test_animal_farm.py rename to samples/client/petstore/python-prior/test/test_animal_farm.py diff --git a/samples/client/petstore/python/test/test_another_fake_api.py b/samples/client/petstore/python-prior/test/test_another_fake_api.py similarity index 100% rename from samples/client/petstore/python/test/test_another_fake_api.py rename to samples/client/petstore/python-prior/test/test_another_fake_api.py diff --git a/samples/client/petstore/python/test/test_api_response.py b/samples/client/petstore/python-prior/test/test_api_response.py similarity index 100% rename from samples/client/petstore/python/test/test_api_response.py rename to samples/client/petstore/python-prior/test/test_api_response.py diff --git a/samples/client/petstore/python/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python-prior/test/test_array_of_array_of_number_only.py similarity index 100% rename from samples/client/petstore/python/test/test_array_of_array_of_number_only.py rename to samples/client/petstore/python-prior/test/test_array_of_array_of_number_only.py diff --git a/samples/client/petstore/python/test/test_array_of_number_only.py b/samples/client/petstore/python-prior/test/test_array_of_number_only.py similarity index 100% rename from samples/client/petstore/python/test/test_array_of_number_only.py rename to samples/client/petstore/python-prior/test/test_array_of_number_only.py diff --git a/samples/client/petstore/python/test/test_array_test.py b/samples/client/petstore/python-prior/test/test_array_test.py similarity index 100% rename from samples/client/petstore/python/test/test_array_test.py rename to samples/client/petstore/python-prior/test/test_array_test.py diff --git a/samples/client/petstore/python/test/test_capitalization.py b/samples/client/petstore/python-prior/test/test_capitalization.py similarity index 100% rename from samples/client/petstore/python/test/test_capitalization.py rename to samples/client/petstore/python-prior/test/test_capitalization.py diff --git a/samples/client/petstore/python/test/test_cat.py b/samples/client/petstore/python-prior/test/test_cat.py similarity index 100% rename from samples/client/petstore/python/test/test_cat.py rename to samples/client/petstore/python-prior/test/test_cat.py diff --git a/samples/client/petstore/python/test/test_cat_all_of.py b/samples/client/petstore/python-prior/test/test_cat_all_of.py similarity index 100% rename from samples/client/petstore/python/test/test_cat_all_of.py rename to samples/client/petstore/python-prior/test/test_cat_all_of.py diff --git a/samples/client/petstore/python/test/test_category.py b/samples/client/petstore/python-prior/test/test_category.py similarity index 100% rename from samples/client/petstore/python/test/test_category.py rename to samples/client/petstore/python-prior/test/test_category.py diff --git a/samples/client/petstore/python/test/test_child.py b/samples/client/petstore/python-prior/test/test_child.py similarity index 100% rename from samples/client/petstore/python/test/test_child.py rename to samples/client/petstore/python-prior/test/test_child.py diff --git a/samples/client/petstore/python/test/test_child_all_of.py b/samples/client/petstore/python-prior/test/test_child_all_of.py similarity index 100% rename from samples/client/petstore/python/test/test_child_all_of.py rename to samples/client/petstore/python-prior/test/test_child_all_of.py diff --git a/samples/client/petstore/python/test/test_child_cat.py b/samples/client/petstore/python-prior/test/test_child_cat.py similarity index 100% rename from samples/client/petstore/python/test/test_child_cat.py rename to samples/client/petstore/python-prior/test/test_child_cat.py diff --git a/samples/client/petstore/python/test/test_child_cat_all_of.py b/samples/client/petstore/python-prior/test/test_child_cat_all_of.py similarity index 100% rename from samples/client/petstore/python/test/test_child_cat_all_of.py rename to samples/client/petstore/python-prior/test/test_child_cat_all_of.py diff --git a/samples/client/petstore/python/test/test_child_dog.py b/samples/client/petstore/python-prior/test/test_child_dog.py similarity index 100% rename from samples/client/petstore/python/test/test_child_dog.py rename to samples/client/petstore/python-prior/test/test_child_dog.py diff --git a/samples/client/petstore/python/test/test_child_dog_all_of.py b/samples/client/petstore/python-prior/test/test_child_dog_all_of.py similarity index 100% rename from samples/client/petstore/python/test/test_child_dog_all_of.py rename to samples/client/petstore/python-prior/test/test_child_dog_all_of.py diff --git a/samples/client/petstore/python/test/test_child_lizard.py b/samples/client/petstore/python-prior/test/test_child_lizard.py similarity index 100% rename from samples/client/petstore/python/test/test_child_lizard.py rename to samples/client/petstore/python-prior/test/test_child_lizard.py diff --git a/samples/client/petstore/python/test/test_child_lizard_all_of.py b/samples/client/petstore/python-prior/test/test_child_lizard_all_of.py similarity index 100% rename from samples/client/petstore/python/test/test_child_lizard_all_of.py rename to samples/client/petstore/python-prior/test/test_child_lizard_all_of.py diff --git a/samples/client/petstore/python/test/test_class_model.py b/samples/client/petstore/python-prior/test/test_class_model.py similarity index 100% rename from samples/client/petstore/python/test/test_class_model.py rename to samples/client/petstore/python-prior/test/test_class_model.py diff --git a/samples/client/petstore/python/test/test_client.py b/samples/client/petstore/python-prior/test/test_client.py similarity index 100% rename from samples/client/petstore/python/test/test_client.py rename to samples/client/petstore/python-prior/test/test_client.py diff --git a/samples/client/petstore/python/test/test_dog.py b/samples/client/petstore/python-prior/test/test_dog.py similarity index 100% rename from samples/client/petstore/python/test/test_dog.py rename to samples/client/petstore/python-prior/test/test_dog.py diff --git a/samples/client/petstore/python/test/test_dog_all_of.py b/samples/client/petstore/python-prior/test/test_dog_all_of.py similarity index 100% rename from samples/client/petstore/python/test/test_dog_all_of.py rename to samples/client/petstore/python-prior/test/test_dog_all_of.py diff --git a/samples/client/petstore/python/test/test_enum_arrays.py b/samples/client/petstore/python-prior/test/test_enum_arrays.py similarity index 100% rename from samples/client/petstore/python/test/test_enum_arrays.py rename to samples/client/petstore/python-prior/test/test_enum_arrays.py diff --git a/samples/client/petstore/python/test/test_enum_class.py b/samples/client/petstore/python-prior/test/test_enum_class.py similarity index 100% rename from samples/client/petstore/python/test/test_enum_class.py rename to samples/client/petstore/python-prior/test/test_enum_class.py diff --git a/samples/client/petstore/python/test/test_enum_test.py b/samples/client/petstore/python-prior/test/test_enum_test.py similarity index 100% rename from samples/client/petstore/python/test/test_enum_test.py rename to samples/client/petstore/python-prior/test/test_enum_test.py diff --git a/samples/client/petstore/python/test/test_fake_api.py b/samples/client/petstore/python-prior/test/test_fake_api.py similarity index 100% rename from samples/client/petstore/python/test/test_fake_api.py rename to samples/client/petstore/python-prior/test/test_fake_api.py diff --git a/samples/client/petstore/python/test/test_fake_classname_tags123_api.py b/samples/client/petstore/python-prior/test/test_fake_classname_tags123_api.py similarity index 100% rename from samples/client/petstore/python/test/test_fake_classname_tags123_api.py rename to samples/client/petstore/python-prior/test/test_fake_classname_tags123_api.py diff --git a/samples/client/petstore/python/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python-prior/test/test_fake_classname_tags_123_api.py similarity index 100% rename from samples/client/petstore/python/test/test_fake_classname_tags_123_api.py rename to samples/client/petstore/python-prior/test/test_fake_classname_tags_123_api.py diff --git a/samples/client/petstore/python/test/test_file.py b/samples/client/petstore/python-prior/test/test_file.py similarity index 100% rename from samples/client/petstore/python/test/test_file.py rename to samples/client/petstore/python-prior/test/test_file.py diff --git a/samples/client/petstore/python/test/test_file_schema_test_class.py b/samples/client/petstore/python-prior/test/test_file_schema_test_class.py similarity index 100% rename from samples/client/petstore/python/test/test_file_schema_test_class.py rename to samples/client/petstore/python-prior/test/test_file_schema_test_class.py diff --git a/samples/client/petstore/python/test/test_format_test.py b/samples/client/petstore/python-prior/test/test_format_test.py similarity index 100% rename from samples/client/petstore/python/test/test_format_test.py rename to samples/client/petstore/python-prior/test/test_format_test.py diff --git a/samples/client/petstore/python/test/test_grandparent.py b/samples/client/petstore/python-prior/test/test_grandparent.py similarity index 100% rename from samples/client/petstore/python/test/test_grandparent.py rename to samples/client/petstore/python-prior/test/test_grandparent.py diff --git a/samples/client/petstore/python/test/test_grandparent_animal.py b/samples/client/petstore/python-prior/test/test_grandparent_animal.py similarity index 100% rename from samples/client/petstore/python/test/test_grandparent_animal.py rename to samples/client/petstore/python-prior/test/test_grandparent_animal.py diff --git a/samples/client/petstore/python/test/test_has_only_read_only.py b/samples/client/petstore/python-prior/test/test_has_only_read_only.py similarity index 100% rename from samples/client/petstore/python/test/test_has_only_read_only.py rename to samples/client/petstore/python-prior/test/test_has_only_read_only.py diff --git a/samples/client/petstore/python/test/test_list.py b/samples/client/petstore/python-prior/test/test_list.py similarity index 100% rename from samples/client/petstore/python/test/test_list.py rename to samples/client/petstore/python-prior/test/test_list.py diff --git a/samples/client/petstore/python/test/test_map_test.py b/samples/client/petstore/python-prior/test/test_map_test.py similarity index 100% rename from samples/client/petstore/python/test/test_map_test.py rename to samples/client/petstore/python-prior/test/test_map_test.py diff --git a/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-prior/test/test_mixed_properties_and_additional_properties_class.py similarity index 100% rename from samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py rename to samples/client/petstore/python-prior/test/test_mixed_properties_and_additional_properties_class.py diff --git a/samples/client/petstore/python/test/test_model200_response.py b/samples/client/petstore/python-prior/test/test_model200_response.py similarity index 100% rename from samples/client/petstore/python/test/test_model200_response.py rename to samples/client/petstore/python-prior/test/test_model200_response.py diff --git a/samples/client/petstore/python/test/test_model_200_response.py b/samples/client/petstore/python-prior/test/test_model_200_response.py similarity index 100% rename from samples/client/petstore/python/test/test_model_200_response.py rename to samples/client/petstore/python-prior/test/test_model_200_response.py diff --git a/samples/client/petstore/python/test/test_model_return.py b/samples/client/petstore/python-prior/test/test_model_return.py similarity index 100% rename from samples/client/petstore/python/test/test_model_return.py rename to samples/client/petstore/python-prior/test/test_model_return.py diff --git a/samples/client/petstore/python/test/test_name.py b/samples/client/petstore/python-prior/test/test_name.py similarity index 100% rename from samples/client/petstore/python/test/test_name.py rename to samples/client/petstore/python-prior/test/test_name.py diff --git a/samples/client/petstore/python/test/test_number_only.py b/samples/client/petstore/python-prior/test/test_number_only.py similarity index 100% rename from samples/client/petstore/python/test/test_number_only.py rename to samples/client/petstore/python-prior/test/test_number_only.py diff --git a/samples/client/petstore/python/test/test_number_with_validations.py b/samples/client/petstore/python-prior/test/test_number_with_validations.py similarity index 100% rename from samples/client/petstore/python/test/test_number_with_validations.py rename to samples/client/petstore/python-prior/test/test_number_with_validations.py diff --git a/samples/client/petstore/python/test/test_object_model_with_ref_props.py b/samples/client/petstore/python-prior/test/test_object_model_with_ref_props.py similarity index 100% rename from samples/client/petstore/python/test/test_object_model_with_ref_props.py rename to samples/client/petstore/python-prior/test/test_object_model_with_ref_props.py diff --git a/samples/client/petstore/python/test/test_order.py b/samples/client/petstore/python-prior/test/test_order.py similarity index 100% rename from samples/client/petstore/python/test/test_order.py rename to samples/client/petstore/python-prior/test/test_order.py diff --git a/samples/client/petstore/python/test/test_parent.py b/samples/client/petstore/python-prior/test/test_parent.py similarity index 100% rename from samples/client/petstore/python/test/test_parent.py rename to samples/client/petstore/python-prior/test/test_parent.py diff --git a/samples/client/petstore/python/test/test_parent_all_of.py b/samples/client/petstore/python-prior/test/test_parent_all_of.py similarity index 100% rename from samples/client/petstore/python/test/test_parent_all_of.py rename to samples/client/petstore/python-prior/test/test_parent_all_of.py diff --git a/samples/client/petstore/python/test/test_parent_pet.py b/samples/client/petstore/python-prior/test/test_parent_pet.py similarity index 100% rename from samples/client/petstore/python/test/test_parent_pet.py rename to samples/client/petstore/python-prior/test/test_parent_pet.py diff --git a/samples/client/petstore/python/test/test_pet.py b/samples/client/petstore/python-prior/test/test_pet.py similarity index 100% rename from samples/client/petstore/python/test/test_pet.py rename to samples/client/petstore/python-prior/test/test_pet.py diff --git a/samples/client/petstore/python/test/test_pet_api.py b/samples/client/petstore/python-prior/test/test_pet_api.py similarity index 100% rename from samples/client/petstore/python/test/test_pet_api.py rename to samples/client/petstore/python-prior/test/test_pet_api.py diff --git a/samples/client/petstore/python/test/test_player.py b/samples/client/petstore/python-prior/test/test_player.py similarity index 100% rename from samples/client/petstore/python/test/test_player.py rename to samples/client/petstore/python-prior/test/test_player.py diff --git a/samples/client/petstore/python/test/test_polygon.py b/samples/client/petstore/python-prior/test/test_polygon.py similarity index 100% rename from samples/client/petstore/python/test/test_polygon.py rename to samples/client/petstore/python-prior/test/test_polygon.py diff --git a/samples/client/petstore/python/test/test_polygon_all_of.py b/samples/client/petstore/python-prior/test/test_polygon_all_of.py similarity index 100% rename from samples/client/petstore/python/test/test_polygon_all_of.py rename to samples/client/petstore/python-prior/test/test_polygon_all_of.py diff --git a/samples/client/petstore/python/test/test_read_only_first.py b/samples/client/petstore/python-prior/test/test_read_only_first.py similarity index 100% rename from samples/client/petstore/python/test/test_read_only_first.py rename to samples/client/petstore/python-prior/test/test_read_only_first.py diff --git a/samples/client/petstore/python/test/test_shape.py b/samples/client/petstore/python-prior/test/test_shape.py similarity index 100% rename from samples/client/petstore/python/test/test_shape.py rename to samples/client/petstore/python-prior/test/test_shape.py diff --git a/samples/client/petstore/python/test/test_special_model_name.py b/samples/client/petstore/python-prior/test/test_special_model_name.py similarity index 100% rename from samples/client/petstore/python/test/test_special_model_name.py rename to samples/client/petstore/python-prior/test/test_special_model_name.py diff --git a/samples/client/petstore/python/test/test_square.py b/samples/client/petstore/python-prior/test/test_square.py similarity index 100% rename from samples/client/petstore/python/test/test_square.py rename to samples/client/petstore/python-prior/test/test_square.py diff --git a/samples/client/petstore/python/test/test_square_all_of.py b/samples/client/petstore/python-prior/test/test_square_all_of.py similarity index 100% rename from samples/client/petstore/python/test/test_square_all_of.py rename to samples/client/petstore/python-prior/test/test_square_all_of.py diff --git a/samples/client/petstore/python/test/test_store_api.py b/samples/client/petstore/python-prior/test/test_store_api.py similarity index 100% rename from samples/client/petstore/python/test/test_store_api.py rename to samples/client/petstore/python-prior/test/test_store_api.py diff --git a/samples/client/petstore/python/test/test_string_boolean_map.py b/samples/client/petstore/python-prior/test/test_string_boolean_map.py similarity index 100% rename from samples/client/petstore/python/test/test_string_boolean_map.py rename to samples/client/petstore/python-prior/test/test_string_boolean_map.py diff --git a/samples/client/petstore/python/test/test_string_enum.py b/samples/client/petstore/python-prior/test/test_string_enum.py similarity index 100% rename from samples/client/petstore/python/test/test_string_enum.py rename to samples/client/petstore/python-prior/test/test_string_enum.py diff --git a/samples/client/petstore/python/test/test_tag.py b/samples/client/petstore/python-prior/test/test_tag.py similarity index 100% rename from samples/client/petstore/python/test/test_tag.py rename to samples/client/petstore/python-prior/test/test_tag.py diff --git a/samples/client/petstore/python/test/test_triangle.py b/samples/client/petstore/python-prior/test/test_triangle.py similarity index 100% rename from samples/client/petstore/python/test/test_triangle.py rename to samples/client/petstore/python-prior/test/test_triangle.py diff --git a/samples/client/petstore/python/test/test_triangle_all_of.py b/samples/client/petstore/python-prior/test/test_triangle_all_of.py similarity index 100% rename from samples/client/petstore/python/test/test_triangle_all_of.py rename to samples/client/petstore/python-prior/test/test_triangle_all_of.py diff --git a/samples/client/petstore/python/test/test_type_holder_default.py b/samples/client/petstore/python-prior/test/test_type_holder_default.py similarity index 100% rename from samples/client/petstore/python/test/test_type_holder_default.py rename to samples/client/petstore/python-prior/test/test_type_holder_default.py diff --git a/samples/client/petstore/python/test/test_type_holder_example.py b/samples/client/petstore/python-prior/test/test_type_holder_example.py similarity index 100% rename from samples/client/petstore/python/test/test_type_holder_example.py rename to samples/client/petstore/python-prior/test/test_type_holder_example.py diff --git a/samples/client/petstore/python/test/test_user.py b/samples/client/petstore/python-prior/test/test_user.py similarity index 100% rename from samples/client/petstore/python/test/test_user.py rename to samples/client/petstore/python-prior/test/test_user.py diff --git a/samples/client/petstore/python/test/test_user_api.py b/samples/client/petstore/python-prior/test/test_user_api.py similarity index 100% rename from samples/client/petstore/python/test/test_user_api.py rename to samples/client/petstore/python-prior/test/test_user_api.py diff --git a/samples/client/petstore/python/test/test_xml_item.py b/samples/client/petstore/python-prior/test/test_xml_item.py similarity index 100% rename from samples/client/petstore/python/test/test_xml_item.py rename to samples/client/petstore/python-prior/test/test_xml_item.py diff --git a/samples/client/petstore/python/test_python.sh b/samples/client/petstore/python-prior/test_python.sh similarity index 100% rename from samples/client/petstore/python/test_python.sh rename to samples/client/petstore/python-prior/test_python.sh diff --git a/samples/client/petstore/python/testfiles/1px_pic1.png b/samples/client/petstore/python-prior/testfiles/1px_pic1.png similarity index 100% rename from samples/client/petstore/python/testfiles/1px_pic1.png rename to samples/client/petstore/python-prior/testfiles/1px_pic1.png diff --git a/samples/client/petstore/python/testfiles/1px_pic2.png b/samples/client/petstore/python-prior/testfiles/1px_pic2.png similarity index 100% rename from samples/client/petstore/python/testfiles/1px_pic2.png rename to samples/client/petstore/python-prior/testfiles/1px_pic2.png diff --git a/samples/client/petstore/python/testfiles/foo.png b/samples/client/petstore/python-prior/testfiles/foo.png similarity index 100% rename from samples/client/petstore/python/testfiles/foo.png rename to samples/client/petstore/python-prior/testfiles/foo.png diff --git a/samples/client/petstore/python/tests/__init__.py b/samples/client/petstore/python-prior/tests/__init__.py similarity index 100% rename from samples/client/petstore/python/tests/__init__.py rename to samples/client/petstore/python-prior/tests/__init__.py diff --git a/samples/client/petstore/python/tests/test_api_client.py b/samples/client/petstore/python-prior/tests/test_api_client.py similarity index 100% rename from samples/client/petstore/python/tests/test_api_client.py rename to samples/client/petstore/python-prior/tests/test_api_client.py diff --git a/samples/client/petstore/python/tests/test_api_exception.py b/samples/client/petstore/python-prior/tests/test_api_exception.py similarity index 100% rename from samples/client/petstore/python/tests/test_api_exception.py rename to samples/client/petstore/python-prior/tests/test_api_exception.py diff --git a/samples/client/petstore/python/tests/test_deserialization.py b/samples/client/petstore/python-prior/tests/test_deserialization.py similarity index 100% rename from samples/client/petstore/python/tests/test_deserialization.py rename to samples/client/petstore/python-prior/tests/test_deserialization.py diff --git a/samples/client/petstore/python/tests/test_pet_api.py b/samples/client/petstore/python-prior/tests/test_pet_api.py similarity index 100% rename from samples/client/petstore/python/tests/test_pet_api.py rename to samples/client/petstore/python-prior/tests/test_pet_api.py diff --git a/samples/client/petstore/python/tests/test_serialization.py b/samples/client/petstore/python-prior/tests/test_serialization.py similarity index 100% rename from samples/client/petstore/python/tests/test_serialization.py rename to samples/client/petstore/python-prior/tests/test_serialization.py diff --git a/samples/client/petstore/python/tests/test_store_api.py b/samples/client/petstore/python-prior/tests/test_store_api.py similarity index 100% rename from samples/client/petstore/python/tests/test_store_api.py rename to samples/client/petstore/python-prior/tests/test_store_api.py diff --git a/samples/client/petstore/python/tests/util.py b/samples/client/petstore/python-prior/tests/util.py similarity index 100% rename from samples/client/petstore/python/tests/util.py rename to samples/client/petstore/python-prior/tests/util.py diff --git a/samples/client/petstore/python/tox.ini b/samples/client/petstore/python-prior/tox.ini similarity index 100% rename from samples/client/petstore/python/tox.ini rename to samples/client/petstore/python-prior/tox.ini diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.gitignore b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.gitignore similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.gitignore rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.gitignore diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.gitlab-ci.yml b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.gitlab-ci.yml similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.gitlab-ci.yml rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.gitlab-ci.yml diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator-ignore b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator-ignore rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.openapi-generator-ignore diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/FILES b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/FILES similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/FILES rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/FILES diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.travis.yml b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.travis.yml similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.travis.yml rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/.travis.yml diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/Makefile b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/Makefile similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/Makefile rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/Makefile diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/README.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/README.md similarity index 99% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/README.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/README.md index 4b34d32b616d..eb14e3a2d74f 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/README.md +++ b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/README.md @@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: - API version: 1.0.0 - Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.PythonClientCodegen +- Build package: org.openapitools.codegen.languages.PythonPriorClientCodegen ## Requirements. diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/dev-requirements.txt b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/dev-requirements.txt similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/dev-requirements.txt rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/dev-requirements.txt diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesAnyType.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesAnyType.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesAnyType.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesArray.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesArray.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesArray.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesArray.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesBoolean.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesBoolean.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesBoolean.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesClass.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesClass.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesClass.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesInteger.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesInteger.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesInteger.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesNumber.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesNumber.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesNumber.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesObject.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesObject.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesObject.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesObject.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesString.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesString.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesString.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AdditionalPropertiesString.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Animal.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Animal.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Animal.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Animal.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AnimalFarm.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AnimalFarm.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AnimalFarm.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AnimalFarm.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AnotherFakeApi.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AnotherFakeApi.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/AnotherFakeApi.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/AnotherFakeApi.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ApiResponse.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ApiResponse.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ApiResponse.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ApiResponse.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfArrayOfNumberOnly.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfArrayOfNumberOnly.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfArrayOfNumberOnly.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfNumberOnly.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfNumberOnly.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfNumberOnly.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ArrayOfNumberOnly.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ArrayTest.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ArrayTest.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ArrayTest.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ArrayTest.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Capitalization.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Capitalization.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Capitalization.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Capitalization.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Cat.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Cat.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Cat.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Cat.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/CatAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/CatAllOf.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/CatAllOf.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/CatAllOf.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Category.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Category.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Category.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Category.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Child.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Child.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Child.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Child.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildAllOf.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildAllOf.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildAllOf.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildCat.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildCat.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildCat.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildCat.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildCatAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildCatAllOf.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildCatAllOf.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildCatAllOf.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildDog.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildDog.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildDog.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildDog.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildDogAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildDogAllOf.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildDogAllOf.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildDogAllOf.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizard.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizard.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizard.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizard.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizardAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizardAllOf.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizardAllOf.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ChildLizardAllOf.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ClassModel.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ClassModel.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ClassModel.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ClassModel.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Client.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Client.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Client.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Client.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Dog.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Dog.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Dog.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Dog.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/DogAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/DogAllOf.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/DogAllOf.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/DogAllOf.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/EnumArrays.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/EnumArrays.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/EnumArrays.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/EnumArrays.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/EnumClass.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/EnumClass.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/EnumClass.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/EnumClass.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/EnumTest.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/EnumTest.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/EnumTest.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/EnumTest.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FakeApi.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FakeApi.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FakeApi.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FakeApi.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FakeClassnameTags123Api.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FakeClassnameTags123Api.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FakeClassnameTags123Api.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/File.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/File.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/File.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/File.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FileSchemaTestClass.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FileSchemaTestClass.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FileSchemaTestClass.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FileSchemaTestClass.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FormatTest.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FormatTest.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/FormatTest.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/FormatTest.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Grandparent.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Grandparent.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Grandparent.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Grandparent.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/GrandparentAnimal.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/GrandparentAnimal.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/GrandparentAnimal.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/GrandparentAnimal.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/HasOnlyReadOnly.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/HasOnlyReadOnly.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/HasOnlyReadOnly.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/HasOnlyReadOnly.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/List.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/List.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/List.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/List.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/MapTest.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/MapTest.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/MapTest.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/MapTest.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/MixedPropertiesAndAdditionalPropertiesClass.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/MixedPropertiesAndAdditionalPropertiesClass.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/MixedPropertiesAndAdditionalPropertiesClass.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Model200Response.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Model200Response.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Model200Response.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Model200Response.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ModelReturn.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ModelReturn.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ModelReturn.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ModelReturn.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Model_200Response.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Model_200Response.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Model_200Response.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Model_200Response.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Model_Return.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Model_Return.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Model_Return.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Model_Return.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Name.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Name.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Name.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Name.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/NumberOnly.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/NumberOnly.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/NumberOnly.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/NumberOnly.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/NumberWithValidations.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/NumberWithValidations.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/NumberWithValidations.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/NumberWithValidations.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ObjectModelWithRefProps.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ObjectModelWithRefProps.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ObjectModelWithRefProps.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ObjectModelWithRefProps.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Order.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Order.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Order.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Order.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Parent.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Parent.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Parent.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Parent.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ParentAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ParentAllOf.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ParentAllOf.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ParentAllOf.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ParentPet.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ParentPet.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ParentPet.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ParentPet.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Pet.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Pet.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Pet.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Pet.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/PetApi.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/PetApi.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/PetApi.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/PetApi.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Player.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Player.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Player.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Player.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Polygon.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Polygon.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Polygon.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Polygon.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/PolygonAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/PolygonAllOf.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/PolygonAllOf.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/PolygonAllOf.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ReadOnlyFirst.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ReadOnlyFirst.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/ReadOnlyFirst.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/ReadOnlyFirst.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Shape.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Shape.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Shape.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Shape.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/SpecialModelName.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/SpecialModelName.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/SpecialModelName.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/SpecialModelName.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Square.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Square.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Square.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Square.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/SquareAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/SquareAllOf.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/SquareAllOf.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/SquareAllOf.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/StoreApi.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/StoreApi.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/StoreApi.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/StoreApi.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/StringBooleanMap.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/StringBooleanMap.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/StringBooleanMap.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/StringBooleanMap.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/StringEnum.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/StringEnum.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/StringEnum.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/StringEnum.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Tag.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Tag.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Tag.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Tag.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Triangle.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Triangle.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/Triangle.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/Triangle.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/TriangleAllOf.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/TriangleAllOf.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/TriangleAllOf.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/TriangleAllOf.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderDefault.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderDefault.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderDefault.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderDefault.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderExample.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderExample.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderExample.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/TypeHolderExample.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/User.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/User.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/User.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/User.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/UserApi.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/UserApi.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/UserApi.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/UserApi.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/XmlItem.md b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/XmlItem.md similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/docs/XmlItem.md rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/docs/XmlItem.md diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/git_push.sh b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/git_push.sh similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/git_push.sh rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/git_push.sh diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/__init__.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/__init__.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/__init__.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/__init__.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/__init__.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/__init__.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/__init__.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/__init__.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/apis/__init__.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/apis/__init__.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/apis/__init__.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/apis/__init__.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/configuration.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/configuration.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/configuration.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/configuration.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/exceptions.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/exceptions.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/exceptions.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/exceptions.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/__init__.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/__init__.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/__init__.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/__init__.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_any_type.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_any_type.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_any_type.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_any_type.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_array.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_array.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_array.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_array.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_boolean.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_boolean.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_boolean.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_boolean.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_class.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_class.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_class.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_class.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_integer.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_integer.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_integer.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_integer.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_number.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_number.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_number.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_number.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_object.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_object.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_object.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_object.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_string.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_string.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_string.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_string.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal_farm.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal_farm.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal_farm.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal_farm.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/api_response.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/api_response.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/api_response.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/api_response.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_array_of_number_only.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_array_of_number_only.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_array_of_number_only.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_array_of_number_only.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_number_only.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_number_only.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_number_only.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_number_only.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_test.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_test.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_test.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_test.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/capitalization.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/capitalization.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/capitalization.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/capitalization.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/category.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/category.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/category.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/category.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/class_model.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/class_model.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/class_model.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/class_model.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/client.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/client.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/client.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/client.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_arrays.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_arrays.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_arrays.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_arrays.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_class.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_class.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_class.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_class.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_test.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_test.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_test.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_test.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file_schema_test_class.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file_schema_test_class.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file_schema_test_class.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file_schema_test_class.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/format_test.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/format_test.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/format_test.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/format_test.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent_animal.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent_animal.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent_animal.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent_animal.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/has_only_read_only.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/has_only_read_only.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/has_only_read_only.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/has_only_read_only.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/list.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/list.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/list.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/list.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/map_test.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/map_test.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/map_test.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/map_test.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/mixed_properties_and_additional_properties_class.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/mixed_properties_and_additional_properties_class.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/mixed_properties_and_additional_properties_class.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model200_response.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model200_response.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model200_response.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model200_response.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_200_response.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_200_response.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_200_response.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_200_response.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_return.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_return.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_return.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_return.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/name.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/name.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/name.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/name.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_only.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_only.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_only.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_only.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_with_validations.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_with_validations.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_with_validations.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_with_validations.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/object_model_with_ref_props.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/object_model_with_ref_props.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/object_model_with_ref_props.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/object_model_with_ref_props.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/order.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/order.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/order.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/order.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_pet.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_pet.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_pet.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_pet.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/pet.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/pet.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/pet.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/pet.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/player.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/player.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/player.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/player.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/polygon.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/polygon.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/polygon.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/polygon.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/polygon_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/polygon_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/polygon_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/polygon_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/read_only_first.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/read_only_first.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/read_only_first.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/read_only_first.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/shape.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/shape.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/shape.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/shape.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/special_model_name.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/special_model_name.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/special_model_name.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/special_model_name.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/square.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/square.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/square.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/square.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/square_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/square_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/square_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/square_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_boolean_map.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_boolean_map.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_boolean_map.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_boolean_map.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_enum.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_enum.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_enum.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_enum.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/tag.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/tag.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/tag.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/tag.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/triangle.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/triangle.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/triangle.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/triangle.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/triangle_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/triangle_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/triangle_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/triangle_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_default.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_default.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_default.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_default.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_example.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_example.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_example.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_example.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/user.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/user.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/user.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/user.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/xml_item.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/xml_item.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/xml_item.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/xml_item.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/models/__init__.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/models/__init__.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/models/__init__.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/models/__init__.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/rest.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/rest.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/rest.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/petstore_api/rest.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/pom.xml b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/pom.xml similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/pom.xml rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/pom.xml diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/requirements.txt b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/requirements.txt similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/requirements.txt rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/requirements.txt diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/setup.cfg b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/setup.cfg similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/setup.cfg rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/setup.cfg diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/setup.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/setup.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/setup.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/setup.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test-requirements.txt b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test-requirements.txt similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test-requirements.txt rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test-requirements.txt diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/__init__.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/__init__.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/__init__.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/__init__.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_any_type.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_any_type.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_any_type.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_any_type.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_array.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_array.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_array.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_array.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_boolean.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_boolean.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_boolean.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_boolean.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_class.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_class.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_class.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_class.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_integer.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_integer.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_integer.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_integer.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_number.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_number.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_number.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_number.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_object.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_object.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_object.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_object.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_string.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_string.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_string.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_additional_properties_string.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_animal.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_animal.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_animal.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_animal.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_animal_farm.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_animal_farm.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_animal_farm.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_animal_farm.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_another_fake_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_another_fake_api.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_another_fake_api.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_another_fake_api.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_api_response.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_api_response.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_api_response.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_api_response.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_array_of_number_only.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_array_of_number_only.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_array_of_number_only.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_number_only.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_number_only.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_number_only.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_array_of_number_only.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_array_test.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_array_test.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_array_test.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_array_test.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_capitalization.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_capitalization.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_capitalization.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_capitalization.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_cat.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_cat.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_cat.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_cat.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_cat_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_cat_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_cat_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_cat_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_category.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_category.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_category.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_category.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_cat_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_dog_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_child_lizard_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_class_model.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_class_model.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_class_model.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_class_model.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_client.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_client.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_client.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_client.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_dog.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_dog.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_dog.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_dog.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_dog_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_dog_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_dog_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_dog_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_enum_arrays.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_enum_arrays.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_enum_arrays.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_enum_arrays.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_enum_class.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_enum_class.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_enum_class.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_enum_class.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_enum_test.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_enum_test.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_enum_test.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_enum_test.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags123_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags123_api.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags123_api.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags123_api.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags_123_api.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags_123_api.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_fake_classname_tags_123_api.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_file.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_file.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_file.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_file.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_file_schema_test_class.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_file_schema_test_class.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_file_schema_test_class.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_file_schema_test_class.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_format_test.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_format_test.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_format_test.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_format_test.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent_animal.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent_animal.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent_animal.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_grandparent_animal.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_has_only_read_only.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_has_only_read_only.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_has_only_read_only.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_has_only_read_only.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_list.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_list.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_list.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_list.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_map_test.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_map_test.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_map_test.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_map_test.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_mixed_properties_and_additional_properties_class.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_mixed_properties_and_additional_properties_class.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_mixed_properties_and_additional_properties_class.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_model200_response.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_model200_response.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_model200_response.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_model200_response.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_model_200_response.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_model_200_response.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_model_200_response.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_model_200_response.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_model_return.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_model_return.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_model_return.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_model_return.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_name.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_name.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_name.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_name.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_number_only.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_number_only.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_number_only.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_number_only.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_number_with_validations.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_number_with_validations.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_number_with_validations.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_number_with_validations.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_object_model_with_ref_props.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_object_model_with_ref_props.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_object_model_with_ref_props.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_object_model_with_ref_props.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_order.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_order.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_order.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_order.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_parent.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_parent.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_parent.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_parent.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_parent_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_parent_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_parent_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_parent_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_parent_pet.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_parent_pet.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_parent_pet.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_parent_pet.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_pet.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_pet.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_pet.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_pet.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_pet_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_pet_api.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_pet_api.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_pet_api.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_player.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_player.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_player.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_player.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_polygon.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_polygon.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_polygon.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_polygon.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_polygon_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_polygon_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_polygon_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_polygon_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_read_only_first.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_read_only_first.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_read_only_first.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_read_only_first.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_shape.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_shape.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_shape.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_shape.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_special_model_name.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_special_model_name.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_special_model_name.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_special_model_name.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_square.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_square.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_square.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_square.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_square_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_square_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_square_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_square_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_store_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_store_api.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_store_api.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_store_api.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_string_boolean_map.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_string_boolean_map.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_string_boolean_map.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_string_boolean_map.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_string_enum.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_string_enum.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_string_enum.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_string_enum.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_tag.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_tag.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_tag.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_tag.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_triangle.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_triangle.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_triangle.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_triangle.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_triangle_all_of.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_triangle_all_of.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_triangle_all_of.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_triangle_all_of.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_default.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_default.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_default.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_default.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_example.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_example.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_example.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_type_holder_example.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_user.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_user.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_user.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_user.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_user_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_user_api.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_user_api.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_user_api.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_xml_item.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_xml_item.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_xml_item.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test/test_xml_item.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test_python.sh b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test_python.sh similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test_python.sh rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/test_python.sh diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic1.png b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic1.png similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic1.png rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic1.png diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic2.png b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic2.png similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic2.png rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/testfiles/1px_pic2.png diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/testfiles/foo.png b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/testfiles/foo.png similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/testfiles/foo.png rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/testfiles/foo.png diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/__init__.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/__init__.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/__init__.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/__init__.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_api_client.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_api_client.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_api_client.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_api_client.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_api_exception.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_api_exception.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_api_exception.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_api_exception.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_deserialization.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_deserialization.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_deserialization.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_deserialization.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_pet_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_pet_api.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_pet_api.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_pet_api.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_serialization.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_serialization.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_serialization.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_serialization.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_store_api.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_store_api.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/test_store_api.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/test_store_api.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/util.py b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/util.py similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tests/util.py rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tests/util.py diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tox.ini b/samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tox.ini similarity index 100% rename from samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/tox.ini rename to samples/client/petstore/python-prior_disallowAdditionalPropertiesIfNotPresent/tox.ini diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/.gitignore b/samples/openapi3/client/3_0_3_unit_test/python/.gitignore similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/.gitignore rename to samples/openapi3/client/3_0_3_unit_test/python/.gitignore diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/.gitlab-ci.yml b/samples/openapi3/client/3_0_3_unit_test/python/.gitlab-ci.yml similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/.gitlab-ci.yml rename to samples/openapi3/client/3_0_3_unit_test/python/.gitlab-ci.yml diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/.openapi-generator-ignore b/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator-ignore similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/.openapi-generator-ignore rename to samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator-ignore diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/.openapi-generator/FILES b/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator/FILES similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/.openapi-generator/FILES rename to samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator/FILES diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/.openapi-generator/VERSION b/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator/VERSION similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/.openapi-generator/VERSION rename to samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator/VERSION diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/.travis.yml b/samples/openapi3/client/3_0_3_unit_test/python/.travis.yml similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/.travis.yml rename to samples/openapi3/client/3_0_3_unit_test/python/.travis.yml diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/Makefile b/samples/openapi3/client/3_0_3_unit_test/python/Makefile similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/Makefile rename to samples/openapi3/client/3_0_3_unit_test/python/Makefile diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/README.md b/samples/openapi3/client/3_0_3_unit_test/python/README.md similarity index 99% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/README.md rename to samples/openapi3/client/3_0_3_unit_test/python/README.md index 8d602e0e07ed..87d4c1355383 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python-experimental/README.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/README.md @@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: - API version: 0.0.1 - Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.PythonExperimentalClientCodegen +- Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/dev-requirements.txt b/samples/openapi3/client/3_0_3_unit_test/python/dev-requirements.txt similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/dev-requirements.txt rename to samples/openapi3/client/3_0_3_unit_test/python/dev-requirements.txt diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/AdditionalPropertiesApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AdditionalPropertiesApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/AdditionalPropertiesApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AdditionalPropertiesApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/AllOfApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AllOfApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/AllOfApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AllOfApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/AnyOfApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AnyOfApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/AnyOfApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/AnyOfApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/ContentTypeJsonApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ContentTypeJsonApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/ContentTypeJsonApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ContentTypeJsonApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/DefaultApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/DefaultApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/DefaultApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/DefaultApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/EnumApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/EnumApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/EnumApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/EnumApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/FormatApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/FormatApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/FormatApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/FormatApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/ItemsApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ItemsApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/ItemsApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ItemsApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/MaxItemsApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxItemsApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/MaxItemsApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxItemsApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/MaxLengthApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxLengthApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/MaxLengthApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxLengthApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/MaxPropertiesApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxPropertiesApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/MaxPropertiesApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaxPropertiesApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/MaximumApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaximumApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/MaximumApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MaximumApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/MinItemsApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinItemsApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/MinItemsApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinItemsApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/MinLengthApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinLengthApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/MinLengthApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinLengthApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/MinPropertiesApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinPropertiesApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/MinPropertiesApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinPropertiesApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/MinimumApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinimumApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/MinimumApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MinimumApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/ModelNotApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ModelNotApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/ModelNotApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ModelNotApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/MultipleOfApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MultipleOfApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/MultipleOfApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/MultipleOfApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/OneOfApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OneOfApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/OneOfApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OneOfApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/OperationRequestBodyApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OperationRequestBodyApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/OperationRequestBodyApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/OperationRequestBodyApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/PathPostApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PathPostApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/PathPostApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PathPostApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/PatternApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PatternApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/PatternApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PatternApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/PropertiesApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PropertiesApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/PropertiesApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/PropertiesApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/RefApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RefApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/RefApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RefApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/RequiredApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RequiredApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/RequiredApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/RequiredApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/ResponseContentContentTypeSchemaApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ResponseContentContentTypeSchemaApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/ResponseContentContentTypeSchemaApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/ResponseContentContentTypeSchemaApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/TypeApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/TypeApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/TypeApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/TypeApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/UniqueItemsApi.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/UniqueItemsApi.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/apis/tags/UniqueItemsApi.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/apis/tags/UniqueItemsApi.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AdditionalpropertiesAreAllowedByDefault.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesAreAllowedByDefault.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AdditionalpropertiesAreAllowedByDefault.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesAreAllowedByDefault.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AdditionalpropertiesCanExistByItself.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesCanExistByItself.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AdditionalpropertiesCanExistByItself.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesCanExistByItself.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AdditionalpropertiesShouldNotLookInApplicators.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesShouldNotLookInApplicators.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AdditionalpropertiesShouldNotLookInApplicators.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/AdditionalpropertiesShouldNotLookInApplicators.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/Allof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Allof.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/Allof.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/Allof.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AllofCombinedWithAnyofOneof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofCombinedWithAnyofOneof.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AllofCombinedWithAnyofOneof.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofCombinedWithAnyofOneof.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AllofSimpleTypes.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofSimpleTypes.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AllofSimpleTypes.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofSimpleTypes.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AllofWithBaseSchema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithBaseSchema.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AllofWithBaseSchema.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithBaseSchema.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AllofWithOneEmptySchema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithOneEmptySchema.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AllofWithOneEmptySchema.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithOneEmptySchema.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AllofWithTheFirstEmptySchema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithTheFirstEmptySchema.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AllofWithTheFirstEmptySchema.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithTheFirstEmptySchema.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AllofWithTheLastEmptySchema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithTheLastEmptySchema.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AllofWithTheLastEmptySchema.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithTheLastEmptySchema.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AllofWithTwoEmptySchemas.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithTwoEmptySchemas.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AllofWithTwoEmptySchemas.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/AllofWithTwoEmptySchemas.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/Anyof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Anyof.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/Anyof.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/Anyof.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AnyofComplexTypes.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AnyofComplexTypes.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AnyofComplexTypes.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/AnyofComplexTypes.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AnyofWithBaseSchema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AnyofWithBaseSchema.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AnyofWithBaseSchema.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/AnyofWithBaseSchema.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AnyofWithOneEmptySchema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/AnyofWithOneEmptySchema.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/AnyofWithOneEmptySchema.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/AnyofWithOneEmptySchema.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/ArrayTypeMatchesArrays.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ArrayTypeMatchesArrays.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/ArrayTypeMatchesArrays.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/ArrayTypeMatchesArrays.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/BooleanTypeMatchesBooleans.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/BooleanTypeMatchesBooleans.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/BooleanTypeMatchesBooleans.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/BooleanTypeMatchesBooleans.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/ByInt.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ByInt.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/ByInt.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/ByInt.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/ByNumber.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ByNumber.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/ByNumber.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/ByNumber.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/BySmallNumber.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/BySmallNumber.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/BySmallNumber.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/BySmallNumber.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/DateTimeFormat.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/DateTimeFormat.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/DateTimeFormat.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/DateTimeFormat.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/EmailFormat.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EmailFormat.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/EmailFormat.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/EmailFormat.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/EnumWith0DoesNotMatchFalse.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWith0DoesNotMatchFalse.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/EnumWith0DoesNotMatchFalse.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWith0DoesNotMatchFalse.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/EnumWith1DoesNotMatchTrue.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWith1DoesNotMatchTrue.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/EnumWith1DoesNotMatchTrue.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWith1DoesNotMatchTrue.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/EnumWithEscapedCharacters.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWithEscapedCharacters.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/EnumWithEscapedCharacters.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWithEscapedCharacters.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/EnumWithFalseDoesNotMatch0.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWithFalseDoesNotMatch0.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/EnumWithFalseDoesNotMatch0.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWithFalseDoesNotMatch0.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/EnumWithTrueDoesNotMatch1.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWithTrueDoesNotMatch1.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/EnumWithTrueDoesNotMatch1.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumWithTrueDoesNotMatch1.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/EnumsInProperties.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumsInProperties.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/EnumsInProperties.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/EnumsInProperties.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/ForbiddenProperty.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ForbiddenProperty.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/ForbiddenProperty.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/ForbiddenProperty.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/HostnameFormat.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/HostnameFormat.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/HostnameFormat.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/HostnameFormat.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/IntegerTypeMatchesIntegers.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/IntegerTypeMatchesIntegers.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/IntegerTypeMatchesIntegers.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/IntegerTypeMatchesIntegers.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/InvalidStringValueForDefault.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/InvalidStringValueForDefault.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/InvalidStringValueForDefault.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/InvalidStringValueForDefault.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/Ipv4Format.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Ipv4Format.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/Ipv4Format.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/Ipv4Format.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/Ipv6Format.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Ipv6Format.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/Ipv6Format.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/Ipv6Format.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/JsonPointerFormat.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/JsonPointerFormat.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/JsonPointerFormat.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/JsonPointerFormat.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MaximumValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaximumValidation.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MaximumValidation.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaximumValidation.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MaximumValidationWithUnsignedInteger.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaximumValidationWithUnsignedInteger.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MaximumValidationWithUnsignedInteger.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaximumValidationWithUnsignedInteger.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MaxitemsValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaxitemsValidation.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MaxitemsValidation.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaxitemsValidation.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MaxlengthValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaxlengthValidation.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MaxlengthValidation.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaxlengthValidation.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/Maxproperties0MeansTheObjectIsEmpty.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Maxproperties0MeansTheObjectIsEmpty.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/Maxproperties0MeansTheObjectIsEmpty.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/Maxproperties0MeansTheObjectIsEmpty.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MaxpropertiesValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaxpropertiesValidation.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MaxpropertiesValidation.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/MaxpropertiesValidation.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MinimumValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinimumValidation.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MinimumValidation.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinimumValidation.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MinimumValidationWithSignedInteger.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinimumValidationWithSignedInteger.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MinimumValidationWithSignedInteger.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinimumValidationWithSignedInteger.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MinitemsValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinitemsValidation.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MinitemsValidation.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinitemsValidation.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MinlengthValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinlengthValidation.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MinlengthValidation.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinlengthValidation.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MinpropertiesValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinpropertiesValidation.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/MinpropertiesValidation.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/MinpropertiesValidation.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/ModelNot.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ModelNot.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/ModelNot.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/ModelNot.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/NestedAllofToCheckValidationSemantics.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedAllofToCheckValidationSemantics.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/NestedAllofToCheckValidationSemantics.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedAllofToCheckValidationSemantics.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/NestedAnyofToCheckValidationSemantics.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedAnyofToCheckValidationSemantics.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/NestedAnyofToCheckValidationSemantics.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedAnyofToCheckValidationSemantics.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/NestedItems.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedItems.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/NestedItems.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedItems.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/NestedOneofToCheckValidationSemantics.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedOneofToCheckValidationSemantics.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/NestedOneofToCheckValidationSemantics.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/NestedOneofToCheckValidationSemantics.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/NotMoreComplexSchema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NotMoreComplexSchema.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/NotMoreComplexSchema.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/NotMoreComplexSchema.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/NulCharactersInStrings.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NulCharactersInStrings.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/NulCharactersInStrings.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/NulCharactersInStrings.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/NullTypeMatchesOnlyTheNullObject.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NullTypeMatchesOnlyTheNullObject.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/NullTypeMatchesOnlyTheNullObject.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/NullTypeMatchesOnlyTheNullObject.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/NumberTypeMatchesNumbers.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/NumberTypeMatchesNumbers.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/NumberTypeMatchesNumbers.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/NumberTypeMatchesNumbers.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/ObjectPropertiesValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/ObjectPropertiesValidation.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/ObjectPropertiesValidation.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/ObjectPropertiesValidation.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/Oneof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/Oneof.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/Oneof.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/Oneof.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/OneofComplexTypes.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofComplexTypes.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/OneofComplexTypes.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofComplexTypes.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/OneofWithBaseSchema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofWithBaseSchema.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/OneofWithBaseSchema.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofWithBaseSchema.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/OneofWithEmptySchema.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofWithEmptySchema.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/OneofWithEmptySchema.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofWithEmptySchema.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/OneofWithRequired.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofWithRequired.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/OneofWithRequired.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/OneofWithRequired.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/PatternIsNotAnchored.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/PatternIsNotAnchored.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/PatternIsNotAnchored.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/PatternIsNotAnchored.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/PatternValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/PatternValidation.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/PatternValidation.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/PatternValidation.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/PropertiesWithEscapedCharacters.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/PropertiesWithEscapedCharacters.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/PropertiesWithEscapedCharacters.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/PropertiesWithEscapedCharacters.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/PropertyNamedRefThatIsNotAReference.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/PropertyNamedRefThatIsNotAReference.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/PropertyNamedRefThatIsNotAReference.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/PropertyNamedRefThatIsNotAReference.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RefInAdditionalproperties.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInAdditionalproperties.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RefInAdditionalproperties.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInAdditionalproperties.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RefInAllof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInAllof.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RefInAllof.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInAllof.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RefInAnyof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInAnyof.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RefInAnyof.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInAnyof.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RefInItems.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInItems.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RefInItems.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInItems.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RefInNot.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInNot.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RefInNot.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInNot.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RefInOneof.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInOneof.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RefInOneof.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInOneof.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RefInProperty.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInProperty.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RefInProperty.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/RefInProperty.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RequiredDefaultValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredDefaultValidation.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RequiredDefaultValidation.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredDefaultValidation.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RequiredValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredValidation.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RequiredValidation.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredValidation.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RequiredWithEmptyArray.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredWithEmptyArray.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RequiredWithEmptyArray.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredWithEmptyArray.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RequiredWithEscapedCharacters.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredWithEscapedCharacters.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/RequiredWithEscapedCharacters.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/RequiredWithEscapedCharacters.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/SimpleEnumValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/SimpleEnumValidation.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/SimpleEnumValidation.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/SimpleEnumValidation.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/StringTypeMatchesStrings.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/StringTypeMatchesStrings.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/StringTypeMatchesStrings.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/StringTypeMatchesStrings.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/UniqueitemsFalseValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UniqueitemsFalseValidation.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/UniqueitemsFalseValidation.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/UniqueitemsFalseValidation.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/UniqueitemsValidation.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UniqueitemsValidation.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/UniqueitemsValidation.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/UniqueitemsValidation.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/UriFormat.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UriFormat.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/UriFormat.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/UriFormat.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/UriReferenceFormat.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UriReferenceFormat.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/UriReferenceFormat.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/UriReferenceFormat.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/UriTemplateFormat.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/models/UriTemplateFormat.md similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/docs/models/UriTemplateFormat.md rename to samples/openapi3/client/3_0_3_unit_test/python/docs/models/UriTemplateFormat.md diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/git_push.sh b/samples/openapi3/client/3_0_3_unit_test/python/git_push.sh similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/git_push.sh rename to samples/openapi3/client/3_0_3_unit_test/python/git_push.sh diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/pom.xml b/samples/openapi3/client/3_0_3_unit_test/python/pom.xml similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/pom.xml rename to samples/openapi3/client/3_0_3_unit_test/python/pom.xml diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/requirements.txt b/samples/openapi3/client/3_0_3_unit_test/python/requirements.txt similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/requirements.txt rename to samples/openapi3/client/3_0_3_unit_test/python/requirements.txt diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/setup.cfg b/samples/openapi3/client/3_0_3_unit_test/python/setup.cfg similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/setup.cfg rename to samples/openapi3/client/3_0_3_unit_test/python/setup.cfg diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/setup.py b/samples/openapi3/client/3_0_3_unit_test/python/setup.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/setup.py rename to samples/openapi3/client/3_0_3_unit_test/python/setup.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test-requirements.txt b/samples/openapi3/client/3_0_3_unit_test/python/test-requirements.txt similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test-requirements.txt rename to samples/openapi3/client/3_0_3_unit_test/python/test-requirements.txt diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_additionalproperties_allows_a_schema_which_should_validate.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_allows_a_schema_which_should_validate.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_additionalproperties_allows_a_schema_which_should_validate.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_allows_a_schema_which_should_validate.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_additionalproperties_are_allowed_by_default.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_are_allowed_by_default.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_additionalproperties_are_allowed_by_default.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_are_allowed_by_default.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_additionalproperties_can_exist_by_itself.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_can_exist_by_itself.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_additionalproperties_can_exist_by_itself.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_can_exist_by_itself.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_additionalproperties_should_not_look_in_applicators.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_should_not_look_in_applicators.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_additionalproperties_should_not_look_in_applicators.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_additionalproperties_should_not_look_in_applicators.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_allof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_allof.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_allof_combined_with_anyof_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_combined_with_anyof_oneof.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_allof_combined_with_anyof_oneof.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_combined_with_anyof_oneof.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_allof_simple_types.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_simple_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_allof_simple_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_simple_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_allof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_base_schema.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_allof_with_base_schema.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_base_schema.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_allof_with_one_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_one_empty_schema.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_allof_with_one_empty_schema.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_one_empty_schema.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_allof_with_the_first_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_the_first_empty_schema.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_allof_with_the_first_empty_schema.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_the_first_empty_schema.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_allof_with_the_last_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_the_last_empty_schema.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_allof_with_the_last_empty_schema.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_the_last_empty_schema.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_allof_with_two_empty_schemas.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_two_empty_schemas.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_allof_with_two_empty_schemas.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_allof_with_two_empty_schemas.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_anyof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_anyof.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_anyof_complex_types.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof_complex_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_anyof_complex_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof_complex_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_anyof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof_with_base_schema.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_anyof_with_base_schema.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof_with_base_schema.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_anyof_with_one_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof_with_one_empty_schema.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_anyof_with_one_empty_schema.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_anyof_with_one_empty_schema.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_array_type_matches_arrays.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_array_type_matches_arrays.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_array_type_matches_arrays.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_array_type_matches_arrays.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_boolean_type_matches_booleans.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_boolean_type_matches_booleans.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_boolean_type_matches_booleans.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_boolean_type_matches_booleans.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_by_int.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_by_int.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_by_int.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_by_int.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_by_number.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_by_number.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_by_number.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_by_number.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_by_small_number.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_by_small_number.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_by_small_number.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_by_small_number.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_date_time_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_date_time_format.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_date_time_format.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_date_time_format.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_email_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_email_format.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_email_format.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_email_format.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_enum_with0_does_not_match_false.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with0_does_not_match_false.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_enum_with0_does_not_match_false.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with0_does_not_match_false.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_enum_with1_does_not_match_true.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with1_does_not_match_true.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_enum_with1_does_not_match_true.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with1_does_not_match_true.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_enum_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with_escaped_characters.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_enum_with_escaped_characters.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with_escaped_characters.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_enum_with_false_does_not_match0.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with_false_does_not_match0.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_enum_with_false_does_not_match0.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with_false_does_not_match0.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_enum_with_true_does_not_match1.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with_true_does_not_match1.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_enum_with_true_does_not_match1.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enum_with_true_does_not_match1.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_enums_in_properties.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enums_in_properties.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_enums_in_properties.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_enums_in_properties.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_forbidden_property.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_forbidden_property.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_forbidden_property.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_forbidden_property.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_hostname_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_hostname_format.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_hostname_format.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_hostname_format.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_integer_type_matches_integers.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_integer_type_matches_integers.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_integer_type_matches_integers.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_integer_type_matches_integers.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_invalid_instance_should_not_raise_error_when_float_division_inf.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_invalid_instance_should_not_raise_error_when_float_division_inf.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_invalid_instance_should_not_raise_error_when_float_division_inf.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_invalid_instance_should_not_raise_error_when_float_division_inf.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_invalid_string_value_for_default.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_invalid_string_value_for_default.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_invalid_string_value_for_default.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_invalid_string_value_for_default.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_ipv4_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ipv4_format.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_ipv4_format.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ipv4_format.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_ipv6_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ipv6_format.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_ipv6_format.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ipv6_format.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_json_pointer_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_json_pointer_format.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_json_pointer_format.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_json_pointer_format.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_maximum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maximum_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_maximum_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maximum_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_maximum_validation_with_unsigned_integer.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maximum_validation_with_unsigned_integer.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_maximum_validation_with_unsigned_integer.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maximum_validation_with_unsigned_integer.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_maxitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxitems_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_maxitems_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxitems_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_maxlength_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxlength_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_maxlength_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxlength_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_maxproperties0_means_the_object_is_empty.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxproperties0_means_the_object_is_empty.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_maxproperties0_means_the_object_is_empty.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxproperties0_means_the_object_is_empty.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_maxproperties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxproperties_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_maxproperties_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_maxproperties_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_minimum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minimum_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_minimum_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minimum_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_minimum_validation_with_signed_integer.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minimum_validation_with_signed_integer.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_minimum_validation_with_signed_integer.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minimum_validation_with_signed_integer.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_minitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minitems_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_minitems_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minitems_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_minlength_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minlength_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_minlength_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minlength_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_minproperties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minproperties_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_minproperties_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_minproperties_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_model_not.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_model_not.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_model_not.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_model_not.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_nested_allof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_allof_to_check_validation_semantics.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_nested_allof_to_check_validation_semantics.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_allof_to_check_validation_semantics.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_nested_anyof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_anyof_to_check_validation_semantics.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_nested_anyof_to_check_validation_semantics.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_anyof_to_check_validation_semantics.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_nested_items.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_items.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_nested_items.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_items.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_nested_oneof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_oneof_to_check_validation_semantics.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_nested_oneof_to_check_validation_semantics.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nested_oneof_to_check_validation_semantics.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_not_more_complex_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_not_more_complex_schema.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_not_more_complex_schema.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_not_more_complex_schema.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_nul_characters_in_strings.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nul_characters_in_strings.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_nul_characters_in_strings.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_nul_characters_in_strings.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_null_type_matches_only_the_null_object.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_null_type_matches_only_the_null_object.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_null_type_matches_only_the_null_object.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_null_type_matches_only_the_null_object.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_number_type_matches_numbers.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_number_type_matches_numbers.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_number_type_matches_numbers.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_number_type_matches_numbers.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_object_properties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_object_properties_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_object_properties_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_object_properties_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_oneof.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_oneof_complex_types.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_complex_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_oneof_complex_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_complex_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_oneof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_with_base_schema.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_oneof_with_base_schema.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_with_base_schema.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_oneof_with_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_with_empty_schema.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_oneof_with_empty_schema.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_with_empty_schema.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_oneof_with_required.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_with_required.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_oneof_with_required.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_oneof_with_required.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_pattern_is_not_anchored.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_pattern_is_not_anchored.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_pattern_is_not_anchored.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_pattern_is_not_anchored.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_pattern_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_pattern_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_pattern_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_pattern_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_properties_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_properties_with_escaped_characters.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_properties_with_escaped_characters.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_properties_with_escaped_characters.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_property_named_ref_that_is_not_a_reference.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_property_named_ref_that_is_not_a_reference.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_property_named_ref_that_is_not_a_reference.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_property_named_ref_that_is_not_a_reference.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_ref_in_additionalproperties.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_additionalproperties.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_ref_in_additionalproperties.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_additionalproperties.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_ref_in_allof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_allof.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_ref_in_allof.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_allof.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_ref_in_anyof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_anyof.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_ref_in_anyof.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_anyof.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_ref_in_items.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_items.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_ref_in_items.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_items.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_ref_in_not.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_not.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_ref_in_not.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_not.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_ref_in_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_oneof.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_ref_in_oneof.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_oneof.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_ref_in_property.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_property.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_ref_in_property.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_ref_in_property.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_required_default_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_default_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_required_default_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_default_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_required_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_required_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_required_with_empty_array.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_with_empty_array.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_required_with_empty_array.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_with_empty_array.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_required_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_with_escaped_characters.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_required_with_escaped_characters.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_required_with_escaped_characters.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_simple_enum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_simple_enum_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_simple_enum_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_simple_enum_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_string_type_matches_strings.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_string_type_matches_strings.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_string_type_matches_strings.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_string_type_matches_strings.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_the_default_keyword_does_not_do_anything_if_the_property_is_missing.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_the_default_keyword_does_not_do_anything_if_the_property_is_missing.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_the_default_keyword_does_not_do_anything_if_the_property_is_missing.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_the_default_keyword_does_not_do_anything_if_the_property_is_missing.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_uniqueitems_false_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uniqueitems_false_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_uniqueitems_false_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uniqueitems_false_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_uniqueitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uniqueitems_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_uniqueitems_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uniqueitems_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_uri_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uri_format.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_uri_format.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uri_format.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_uri_reference_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uri_reference_format.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_uri_reference_format.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uri_reference_format.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_uri_template_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uri_template_format.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_models/test_uri_template_format.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_models/test_uri_template_format.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_simple_types_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_simple_types_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_simple_types_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_simple_types_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_anyof_complex_types_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_anyof_complex_types_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_anyof_complex_types_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_anyof_complex_types_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_anyof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_anyof_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_anyof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_anyof_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_by_int_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_by_int_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_by_int_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_by_int_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_by_number_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_by_number_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_by_number_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_by_number_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_by_small_number_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_by_small_number_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_by_small_number_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_by_small_number_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_date_time_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_date_time_format_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_date_time_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_date_time_format_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_email_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_email_format_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_email_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_email_format_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enums_in_properties_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enums_in_properties_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enums_in_properties_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_enums_in_properties_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_forbidden_property_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_forbidden_property_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_forbidden_property_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_forbidden_property_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_hostname_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_hostname_format_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_hostname_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_hostname_format_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ipv4_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ipv4_format_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ipv4_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ipv4_format_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ipv6_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ipv6_format_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ipv6_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ipv6_format_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_json_pointer_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_json_pointer_format_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_json_pointer_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_json_pointer_format_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maximum_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maximum_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maximum_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maximum_validation_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maxitems_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maxitems_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maxitems_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maxitems_validation_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maxlength_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maxlength_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maxlength_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maxlength_validation_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maxproperties_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maxproperties_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maxproperties_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_maxproperties_validation_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minimum_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minimum_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minimum_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minimum_validation_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minitems_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minitems_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minitems_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minitems_validation_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minlength_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minlength_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minlength_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minlength_validation_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minproperties_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minproperties_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minproperties_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_minproperties_validation_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nested_items_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nested_items_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nested_items_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nested_items_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_not_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_not_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_not_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_not_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_object_properties_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_object_properties_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_object_properties_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_object_properties_validation_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_complex_types_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_complex_types_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_complex_types_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_complex_types_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_with_required_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_with_required_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_with_required_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_oneof_with_required_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_pattern_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_pattern_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_pattern_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_pattern_validation_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_allof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_allof_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_allof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_allof_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_anyof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_anyof_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_anyof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_anyof_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_items_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_items_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_items_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_items_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_not_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_not_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_not_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_not_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_oneof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_oneof_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_oneof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_oneof_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_property_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_property_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_property_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_ref_in_property_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_required_default_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_required_default_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_required_default_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_required_default_validation_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_required_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_required_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_required_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_required_validation_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_required_with_empty_array_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_required_with_empty_array_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_required_with_empty_array_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_required_with_empty_array_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_simple_enum_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_simple_enum_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_simple_enum_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_simple_enum_validation_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uri_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uri_format_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uri_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uri_format_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uri_reference_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uri_reference_format_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uri_reference_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uri_reference_format_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uri_template_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uri_template_format_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uri_template_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_request_body_post_uri_template_format_request_body/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_not_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_not_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_not_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_not_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/test_post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/test_post.py rename to samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/test_post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/test_python.sh b/samples/openapi3/client/3_0_3_unit_test/python/test_python.sh similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/test_python.sh rename to samples/openapi3/client/3_0_3_unit_test/python/test_python.sh diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/tox.ini b/samples/openapi3/client/3_0_3_unit_test/python/tox.ini similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/tox.ini rename to samples/openapi3/client/3_0_3_unit_test/python/tox.ini diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api_client.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/api_client.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/api_client.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/api_client.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/path_to_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/path_to_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/path_to_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/path_to_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_allof_combined_with_anyof_oneof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_combined_with_anyof_oneof_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_allof_combined_with_anyof_oneof_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_combined_with_anyof_oneof_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_allof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_allof_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_allof_simple_types_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_simple_types_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_allof_simple_types_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_simple_types_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_allof_with_base_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_base_schema_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_allof_with_base_schema_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_base_schema_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_allof_with_one_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_one_empty_schema_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_allof_with_one_empty_schema_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_one_empty_schema_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_allof_with_the_first_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_the_first_empty_schema_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_allof_with_the_first_empty_schema_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_the_first_empty_schema_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_allof_with_the_last_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_the_last_empty_schema_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_allof_with_the_last_empty_schema_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_the_last_empty_schema_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_allof_with_two_empty_schemas_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_two_empty_schemas_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_allof_with_two_empty_schemas_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_allof_with_two_empty_schemas_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_anyof_complex_types_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_complex_types_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_anyof_complex_types_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_complex_types_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_anyof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_anyof_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_anyof_with_base_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_with_base_schema_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_anyof_with_base_schema_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_with_base_schema_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_anyof_with_one_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_with_one_empty_schema_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_anyof_with_one_empty_schema_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_anyof_with_one_empty_schema_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_array_type_matches_arrays_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_array_type_matches_arrays_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_array_type_matches_arrays_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_array_type_matches_arrays_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_boolean_type_matches_booleans_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_boolean_type_matches_booleans_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_boolean_type_matches_booleans_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_boolean_type_matches_booleans_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_by_int_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_by_int_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_by_int_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_by_int_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_by_number_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_by_number_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_by_number_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_by_number_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_by_small_number_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_by_small_number_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_by_small_number_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_by_small_number_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_date_time_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_date_time_format_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_date_time_format_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_date_time_format_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_email_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_email_format_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_email_format_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_email_format_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_enum_with0_does_not_match_false_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with0_does_not_match_false_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_enum_with0_does_not_match_false_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with0_does_not_match_false_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_enum_with1_does_not_match_true_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with1_does_not_match_true_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_enum_with1_does_not_match_true_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with1_does_not_match_true_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_enum_with_escaped_characters_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with_escaped_characters_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_enum_with_escaped_characters_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with_escaped_characters_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_enum_with_false_does_not_match0_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with_false_does_not_match0_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_enum_with_false_does_not_match0_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with_false_does_not_match0_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_enum_with_true_does_not_match1_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with_true_does_not_match1_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_enum_with_true_does_not_match1_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enum_with_true_does_not_match1_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_enums_in_properties_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enums_in_properties_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_enums_in_properties_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_enums_in_properties_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_forbidden_property_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_forbidden_property_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_forbidden_property_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_forbidden_property_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_hostname_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_hostname_format_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_hostname_format_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_hostname_format_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_integer_type_matches_integers_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_integer_type_matches_integers_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_integer_type_matches_integers_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_integer_type_matches_integers_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_invalid_string_value_for_default_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_invalid_string_value_for_default_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_invalid_string_value_for_default_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_invalid_string_value_for_default_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_ipv4_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ipv4_format_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_ipv4_format_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ipv4_format_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_ipv6_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ipv6_format_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_ipv6_format_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ipv6_format_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_json_pointer_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_json_pointer_format_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_json_pointer_format_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_json_pointer_format_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_maximum_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maximum_validation_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_maximum_validation_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maximum_validation_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_maxitems_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxitems_validation_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_maxitems_validation_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxitems_validation_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_maxlength_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxlength_validation_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_maxlength_validation_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxlength_validation_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_maxproperties_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxproperties_validation_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_maxproperties_validation_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_maxproperties_validation_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_minimum_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minimum_validation_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_minimum_validation_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minimum_validation_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_minimum_validation_with_signed_integer_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minimum_validation_with_signed_integer_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_minimum_validation_with_signed_integer_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minimum_validation_with_signed_integer_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_minitems_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minitems_validation_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_minitems_validation_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minitems_validation_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_minlength_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minlength_validation_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_minlength_validation_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minlength_validation_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_minproperties_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minproperties_validation_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_minproperties_validation_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_minproperties_validation_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_nested_items_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_items_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_nested_items_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_items_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_not_more_complex_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_not_more_complex_schema_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_not_more_complex_schema_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_not_more_complex_schema_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_not_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_not_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_not_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_not_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_nul_characters_in_strings_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nul_characters_in_strings_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_nul_characters_in_strings_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_nul_characters_in_strings_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_null_type_matches_only_the_null_object_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_null_type_matches_only_the_null_object_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_null_type_matches_only_the_null_object_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_null_type_matches_only_the_null_object_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_number_type_matches_numbers_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_number_type_matches_numbers_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_number_type_matches_numbers_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_number_type_matches_numbers_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_object_properties_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_object_properties_validation_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_object_properties_validation_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_object_properties_validation_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_object_type_matches_objects_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_object_type_matches_objects_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_object_type_matches_objects_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_object_type_matches_objects_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_oneof_complex_types_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_complex_types_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_oneof_complex_types_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_complex_types_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_oneof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_oneof_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_oneof_with_base_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_with_base_schema_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_oneof_with_base_schema_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_with_base_schema_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_oneof_with_empty_schema_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_with_empty_schema_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_oneof_with_empty_schema_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_with_empty_schema_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_oneof_with_required_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_with_required_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_oneof_with_required_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_oneof_with_required_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_pattern_is_not_anchored_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_pattern_is_not_anchored_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_pattern_is_not_anchored_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_pattern_is_not_anchored_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_pattern_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_pattern_validation_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_pattern_validation_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_pattern_validation_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_properties_with_escaped_characters_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_properties_with_escaped_characters_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_properties_with_escaped_characters_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_properties_with_escaped_characters_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_ref_in_additionalproperties_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_additionalproperties_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_ref_in_additionalproperties_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_additionalproperties_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_ref_in_allof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_allof_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_ref_in_allof_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_allof_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_ref_in_anyof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_anyof_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_ref_in_anyof_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_anyof_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_ref_in_items_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_items_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_ref_in_items_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_items_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_ref_in_not_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_not_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_ref_in_not_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_not_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_ref_in_oneof_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_oneof_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_ref_in_oneof_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_oneof_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_ref_in_property_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_property_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_ref_in_property_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_ref_in_property_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_required_default_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_default_validation_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_required_default_validation_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_default_validation_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_required_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_validation_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_required_validation_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_validation_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_required_with_empty_array_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_with_empty_array_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_required_with_empty_array_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_with_empty_array_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_required_with_escaped_characters_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_with_escaped_characters_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_required_with_escaped_characters_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_required_with_escaped_characters_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_simple_enum_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_simple_enum_validation_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_simple_enum_validation_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_simple_enum_validation_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_string_type_matches_strings_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_string_type_matches_strings_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_string_type_matches_strings_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_string_type_matches_strings_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_uniqueitems_false_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uniqueitems_false_validation_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_uniqueitems_false_validation_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uniqueitems_false_validation_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_uniqueitems_validation_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uniqueitems_validation_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_uniqueitems_validation_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uniqueitems_validation_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_uri_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uri_format_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_uri_format_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uri_format_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_uri_reference_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uri_reference_format_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_uri_reference_format_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uri_reference_format_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_uri_template_format_request_body.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uri_template_format_request_body.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/request_body_post_uri_template_format_request_body.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/request_body_post_uri_template_format_request_body.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_allof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_allof_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_allof_simple_types_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_simple_types_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_allof_simple_types_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_simple_types_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_allof_with_base_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_base_schema_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_allof_with_base_schema_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_base_schema_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_anyof_complex_types_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_complex_types_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_anyof_complex_types_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_complex_types_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_anyof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_anyof_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_by_int_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_by_int_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_by_int_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_by_int_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_by_number_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_by_number_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_by_number_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_by_number_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_by_small_number_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_by_small_number_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_by_small_number_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_by_small_number_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_date_time_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_date_time_format_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_date_time_format_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_date_time_format_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_email_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_email_format_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_email_format_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_email_format_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_enums_in_properties_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enums_in_properties_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_enums_in_properties_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_enums_in_properties_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_forbidden_property_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_forbidden_property_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_forbidden_property_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_forbidden_property_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_hostname_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_hostname_format_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_hostname_format_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_hostname_format_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_ipv4_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ipv4_format_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_ipv4_format_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ipv4_format_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_ipv6_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ipv6_format_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_ipv6_format_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ipv6_format_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_json_pointer_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_json_pointer_format_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_json_pointer_format_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_json_pointer_format_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_maximum_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maximum_validation_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_maximum_validation_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maximum_validation_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_maxitems_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxitems_validation_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_maxitems_validation_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxitems_validation_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_maxlength_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxlength_validation_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_maxlength_validation_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxlength_validation_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_maxproperties_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxproperties_validation_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_maxproperties_validation_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_maxproperties_validation_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_minimum_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minimum_validation_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_minimum_validation_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minimum_validation_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_minitems_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minitems_validation_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_minitems_validation_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minitems_validation_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_minlength_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minlength_validation_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_minlength_validation_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minlength_validation_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_minproperties_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minproperties_validation_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_minproperties_validation_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_minproperties_validation_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_nested_items_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_items_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_nested_items_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_items_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_not_more_complex_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_not_more_complex_schema_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_not_more_complex_schema_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_not_more_complex_schema_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_not_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_not_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_not_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_not_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_object_properties_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_object_properties_validation_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_object_properties_validation_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_object_properties_validation_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_object_type_matches_objects_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_object_type_matches_objects_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_object_type_matches_objects_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_object_type_matches_objects_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_oneof_complex_types_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_complex_types_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_oneof_complex_types_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_complex_types_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_oneof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_oneof_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_oneof_with_required_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_with_required_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_oneof_with_required_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_oneof_with_required_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_pattern_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_pattern_validation_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_pattern_validation_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_pattern_validation_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_ref_in_allof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_allof_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_ref_in_allof_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_allof_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_ref_in_anyof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_anyof_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_ref_in_anyof_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_anyof_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_ref_in_items_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_items_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_ref_in_items_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_items_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_ref_in_not_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_not_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_ref_in_not_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_not_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_ref_in_oneof_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_oneof_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_ref_in_oneof_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_oneof_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_ref_in_property_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_property_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_ref_in_property_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_ref_in_property_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_required_default_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_default_validation_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_required_default_validation_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_default_validation_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_required_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_validation_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_required_validation_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_validation_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_required_with_empty_array_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_with_empty_array_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_required_with_empty_array_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_with_empty_array_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_simple_enum_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_simple_enum_validation_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_simple_enum_validation_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_simple_enum_validation_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_string_type_matches_strings_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_string_type_matches_strings_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_string_type_matches_strings_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_string_type_matches_strings_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_uniqueitems_validation_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uniqueitems_validation_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_uniqueitems_validation_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uniqueitems_validation_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_uri_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uri_format_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_uri_format_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uri_format_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_uri_reference_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uri_reference_format_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_uri_reference_format_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uri_reference_format_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_uri_template_format_response_body_for_content_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uri_template_format_response_body_for_content_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/paths/response_body_post_uri_template_format_response_body_for_content_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/paths/response_body_post_uri_template_format_response_body_for_content_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tag_to_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tag_to_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tag_to_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tag_to_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/additional_properties_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/additional_properties_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/additional_properties_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/additional_properties_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/all_of_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/all_of_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/all_of_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/all_of_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/any_of_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/any_of_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/any_of_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/any_of_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/content_type_json_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/content_type_json_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/content_type_json_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/content_type_json_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/default_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/default_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/default_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/default_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/enum_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/enum_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/enum_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/enum_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/format_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/format_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/format_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/format_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/items_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/items_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/items_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/items_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/max_items_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/max_items_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/max_items_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/max_items_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/max_length_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/max_length_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/max_length_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/max_length_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/max_properties_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/max_properties_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/max_properties_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/max_properties_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/maximum_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/maximum_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/maximum_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/maximum_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/min_items_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/min_items_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/min_items_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/min_items_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/min_length_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/min_length_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/min_length_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/min_length_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/min_properties_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/min_properties_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/min_properties_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/min_properties_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/minimum_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/minimum_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/minimum_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/minimum_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/model_not_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/model_not_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/model_not_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/model_not_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/multiple_of_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/multiple_of_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/multiple_of_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/multiple_of_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/one_of_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/one_of_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/one_of_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/one_of_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/operation_request_body_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/operation_request_body_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/operation_request_body_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/operation_request_body_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/path_post_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/path_post_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/path_post_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/path_post_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/pattern_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/pattern_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/pattern_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/pattern_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/properties_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/properties_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/properties_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/properties_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/ref_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/ref_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/ref_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/ref_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/required_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/required_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/required_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/required_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/response_content_content_type_schema_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/response_content_content_type_schema_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/response_content_content_type_schema_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/response_content_content_type_schema_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/type_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/type_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/type_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/type_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/unique_items_api.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/unique_items_api.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/apis/tags/unique_items_api.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/apis/tags/unique_items_api.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/configuration.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/configuration.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/configuration.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/configuration.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/exceptions.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/exceptions.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/exceptions.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/exceptions.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_allows_a_schema_which_should_validate.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_are_allowed_by_default.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_are_allowed_by_default.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_are_allowed_by_default.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_are_allowed_by_default.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_are_allowed_by_default.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_are_allowed_by_default.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_are_allowed_by_default.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_are_allowed_by_default.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_can_exist_by_itself.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_can_exist_by_itself.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_can_exist_by_itself.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_can_exist_by_itself.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_can_exist_by_itself.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_can_exist_by_itself.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_can_exist_by_itself.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_can_exist_by_itself.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_should_not_look_in_applicators.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_should_not_look_in_applicators.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_should_not_look_in_applicators.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_should_not_look_in_applicators.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_should_not_look_in_applicators.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_should_not_look_in_applicators.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/additionalproperties_should_not_look_in_applicators.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/additionalproperties_should_not_look_in_applicators.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_combined_with_anyof_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_combined_with_anyof_oneof.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_combined_with_anyof_oneof.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_combined_with_anyof_oneof.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_combined_with_anyof_oneof.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_combined_with_anyof_oneof.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_combined_with_anyof_oneof.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_combined_with_anyof_oneof.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_simple_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_simple_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_simple_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_simple_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_simple_types.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_simple_types.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_simple_types.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_simple_types.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_base_schema.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_base_schema.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_base_schema.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_base_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_base_schema.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_base_schema.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_base_schema.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_one_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_one_empty_schema.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_one_empty_schema.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_one_empty_schema.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_one_empty_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_one_empty_schema.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_one_empty_schema.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_one_empty_schema.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_first_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_first_empty_schema.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_first_empty_schema.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_first_empty_schema.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_first_empty_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_first_empty_schema.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_first_empty_schema.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_first_empty_schema.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_last_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_last_empty_schema.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_last_empty_schema.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_last_empty_schema.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_last_empty_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_last_empty_schema.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_the_last_empty_schema.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_the_last_empty_schema.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_two_empty_schemas.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_two_empty_schemas.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_two_empty_schemas.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_two_empty_schemas.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_two_empty_schemas.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_two_empty_schemas.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/allof_with_two_empty_schemas.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/allof_with_two_empty_schemas.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_complex_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_complex_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_complex_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_complex_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_complex_types.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_complex_types.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_complex_types.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_complex_types.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_base_schema.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_base_schema.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_base_schema.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_base_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_base_schema.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_base_schema.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_base_schema.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_one_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_one_empty_schema.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_one_empty_schema.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_one_empty_schema.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_one_empty_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_one_empty_schema.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/anyof_with_one_empty_schema.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/anyof_with_one_empty_schema.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/array_type_matches_arrays.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/array_type_matches_arrays.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/array_type_matches_arrays.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/array_type_matches_arrays.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/array_type_matches_arrays.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/array_type_matches_arrays.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/array_type_matches_arrays.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/array_type_matches_arrays.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/boolean_type_matches_booleans.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/boolean_type_matches_booleans.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/boolean_type_matches_booleans.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/boolean_type_matches_booleans.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/boolean_type_matches_booleans.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/boolean_type_matches_booleans.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/boolean_type_matches_booleans.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/boolean_type_matches_booleans.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_int.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_int.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_int.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_int.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_int.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_int.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_int.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_int.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_number.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_number.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_number.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_number.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_number.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_number.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_number.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_number.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_small_number.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_small_number.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_small_number.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_small_number.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_small_number.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_small_number.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/by_small_number.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/by_small_number.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/date_time_format.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/date_time_format.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/date_time_format.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/date_time_format.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/date_time_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/date_time_format.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/date_time_format.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/date_time_format.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/email_format.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/email_format.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/email_format.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/email_format.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/email_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/email_format.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/email_format.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/email_format.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with0_does_not_match_false.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with0_does_not_match_false.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with0_does_not_match_false.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with0_does_not_match_false.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with0_does_not_match_false.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with0_does_not_match_false.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with0_does_not_match_false.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with0_does_not_match_false.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with1_does_not_match_true.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with1_does_not_match_true.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with1_does_not_match_true.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with1_does_not_match_true.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with1_does_not_match_true.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with1_does_not_match_true.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with1_does_not_match_true.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with1_does_not_match_true.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_escaped_characters.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_escaped_characters.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_escaped_characters.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_escaped_characters.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_escaped_characters.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_escaped_characters.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_escaped_characters.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_false_does_not_match0.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_false_does_not_match0.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_false_does_not_match0.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_false_does_not_match0.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_false_does_not_match0.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_false_does_not_match0.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_false_does_not_match0.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_false_does_not_match0.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_true_does_not_match1.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_true_does_not_match1.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_true_does_not_match1.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_true_does_not_match1.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_true_does_not_match1.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_true_does_not_match1.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enum_with_true_does_not_match1.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enum_with_true_does_not_match1.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enums_in_properties.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enums_in_properties.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enums_in_properties.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enums_in_properties.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enums_in_properties.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enums_in_properties.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/enums_in_properties.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/enums_in_properties.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/forbidden_property.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/forbidden_property.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/forbidden_property.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/forbidden_property.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/forbidden_property.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/forbidden_property.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/forbidden_property.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/forbidden_property.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/hostname_format.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/hostname_format.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/hostname_format.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/hostname_format.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/hostname_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/hostname_format.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/hostname_format.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/hostname_format.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/integer_type_matches_integers.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/integer_type_matches_integers.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/integer_type_matches_integers.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/integer_type_matches_integers.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/integer_type_matches_integers.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/integer_type_matches_integers.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/integer_type_matches_integers.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/integer_type_matches_integers.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_instance_should_not_raise_error_when_float_division_inf.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_string_value_for_default.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_string_value_for_default.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_string_value_for_default.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_string_value_for_default.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_string_value_for_default.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_string_value_for_default.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/invalid_string_value_for_default.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/invalid_string_value_for_default.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv4_format.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv4_format.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv4_format.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv4_format.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv4_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv4_format.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv4_format.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv4_format.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv6_format.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv6_format.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv6_format.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv6_format.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv6_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv6_format.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ipv6_format.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ipv6_format.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/json_pointer_format.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/json_pointer_format.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/json_pointer_format.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/json_pointer_format.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/json_pointer_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/json_pointer_format.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/json_pointer_format.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/json_pointer_format.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation_with_unsigned_integer.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation_with_unsigned_integer.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation_with_unsigned_integer.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation_with_unsigned_integer.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation_with_unsigned_integer.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation_with_unsigned_integer.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maximum_validation_with_unsigned_integer.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maximum_validation_with_unsigned_integer.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxitems_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxitems_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxitems_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxitems_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxitems_validation.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxitems_validation.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxitems_validation.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxlength_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxlength_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxlength_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxlength_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxlength_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxlength_validation.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxlength_validation.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxlength_validation.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties0_means_the_object_is_empty.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties0_means_the_object_is_empty.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties0_means_the_object_is_empty.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties0_means_the_object_is_empty.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties0_means_the_object_is_empty.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties0_means_the_object_is_empty.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties0_means_the_object_is_empty.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties0_means_the_object_is_empty.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties_validation.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/maxproperties_validation.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/maxproperties_validation.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation_with_signed_integer.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation_with_signed_integer.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation_with_signed_integer.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation_with_signed_integer.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation_with_signed_integer.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation_with_signed_integer.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minimum_validation_with_signed_integer.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minimum_validation_with_signed_integer.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minitems_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minitems_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minitems_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minitems_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minitems_validation.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minitems_validation.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minitems_validation.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minlength_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minlength_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minlength_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minlength_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minlength_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minlength_validation.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minlength_validation.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minlength_validation.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minproperties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minproperties_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minproperties_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minproperties_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minproperties_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minproperties_validation.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/minproperties_validation.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/minproperties_validation.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/model_not.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/model_not.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/model_not.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/model_not.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/model_not.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/model_not.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/model_not.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/model_not.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_allof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_allof_to_check_validation_semantics.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_allof_to_check_validation_semantics.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_allof_to_check_validation_semantics.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_allof_to_check_validation_semantics.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_allof_to_check_validation_semantics.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_allof_to_check_validation_semantics.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_allof_to_check_validation_semantics.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_anyof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_anyof_to_check_validation_semantics.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_anyof_to_check_validation_semantics.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_anyof_to_check_validation_semantics.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_anyof_to_check_validation_semantics.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_anyof_to_check_validation_semantics.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_anyof_to_check_validation_semantics.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_anyof_to_check_validation_semantics.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_items.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_items.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_items.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_items.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_items.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_items.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_items.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_items.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_oneof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_oneof_to_check_validation_semantics.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_oneof_to_check_validation_semantics.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_oneof_to_check_validation_semantics.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_oneof_to_check_validation_semantics.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_oneof_to_check_validation_semantics.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nested_oneof_to_check_validation_semantics.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nested_oneof_to_check_validation_semantics.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/not_more_complex_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/not_more_complex_schema.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/not_more_complex_schema.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/not_more_complex_schema.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/not_more_complex_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/not_more_complex_schema.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/not_more_complex_schema.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/not_more_complex_schema.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nul_characters_in_strings.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nul_characters_in_strings.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nul_characters_in_strings.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nul_characters_in_strings.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nul_characters_in_strings.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nul_characters_in_strings.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/nul_characters_in_strings.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/nul_characters_in_strings.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/null_type_matches_only_the_null_object.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/null_type_matches_only_the_null_object.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/null_type_matches_only_the_null_object.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/null_type_matches_only_the_null_object.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/null_type_matches_only_the_null_object.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/null_type_matches_only_the_null_object.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/null_type_matches_only_the_null_object.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/null_type_matches_only_the_null_object.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/number_type_matches_numbers.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/number_type_matches_numbers.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/number_type_matches_numbers.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/number_type_matches_numbers.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/number_type_matches_numbers.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/number_type_matches_numbers.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/number_type_matches_numbers.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/number_type_matches_numbers.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/object_properties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/object_properties_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/object_properties_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/object_properties_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/object_properties_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/object_properties_validation.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/object_properties_validation.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/object_properties_validation.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_complex_types.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_complex_types.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_complex_types.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_complex_types.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_complex_types.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_complex_types.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_complex_types.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_complex_types.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_base_schema.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_base_schema.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_base_schema.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_base_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_base_schema.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_base_schema.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_base_schema.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_empty_schema.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_empty_schema.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_empty_schema.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_empty_schema.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_empty_schema.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_empty_schema.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_empty_schema.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_required.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_required.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_required.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_required.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_required.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_required.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/oneof_with_required.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/oneof_with_required.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_is_not_anchored.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_is_not_anchored.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_is_not_anchored.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_is_not_anchored.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_is_not_anchored.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_is_not_anchored.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_is_not_anchored.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_is_not_anchored.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_validation.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/pattern_validation.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/pattern_validation.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/properties_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/properties_with_escaped_characters.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/properties_with_escaped_characters.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/properties_with_escaped_characters.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/properties_with_escaped_characters.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/properties_with_escaped_characters.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/properties_with_escaped_characters.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/properties_with_escaped_characters.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/property_named_ref_that_is_not_a_reference.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/property_named_ref_that_is_not_a_reference.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/property_named_ref_that_is_not_a_reference.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/property_named_ref_that_is_not_a_reference.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/property_named_ref_that_is_not_a_reference.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/property_named_ref_that_is_not_a_reference.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/property_named_ref_that_is_not_a_reference.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/property_named_ref_that_is_not_a_reference.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_additionalproperties.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_additionalproperties.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_additionalproperties.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_additionalproperties.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_additionalproperties.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_additionalproperties.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_additionalproperties.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_additionalproperties.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_allof.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_allof.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_allof.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_allof.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_allof.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_allof.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_allof.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_allof.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_anyof.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_anyof.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_anyof.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_anyof.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_anyof.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_anyof.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_anyof.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_anyof.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_items.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_items.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_items.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_items.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_items.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_items.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_items.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_items.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_not.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_not.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_not.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_not.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_not.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_not.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_not.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_not.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_oneof.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_oneof.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_oneof.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_oneof.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_oneof.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_oneof.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_oneof.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_property.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_property.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_property.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_property.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_property.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_property.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/ref_in_property.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/ref_in_property.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_default_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_default_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_default_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_default_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_default_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_default_validation.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_default_validation.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_default_validation.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_validation.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_validation.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_validation.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_empty_array.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_empty_array.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_empty_array.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_empty_array.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_empty_array.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_empty_array.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_empty_array.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_empty_array.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_escaped_characters.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_escaped_characters.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_escaped_characters.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_escaped_characters.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_escaped_characters.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/required_with_escaped_characters.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/required_with_escaped_characters.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/simple_enum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/simple_enum_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/simple_enum_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/simple_enum_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/simple_enum_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/simple_enum_validation.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/simple_enum_validation.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/simple_enum_validation.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/string_type_matches_strings.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/string_type_matches_strings.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/string_type_matches_strings.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/string_type_matches_strings.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/string_type_matches_strings.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/string_type_matches_strings.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/string_type_matches_strings.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/string_type_matches_strings.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_false_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_false_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_false_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_false_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_false_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_false_validation.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_false_validation.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_false_validation.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_validation.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_validation.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_validation.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_validation.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_validation.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uniqueitems_validation.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uniqueitems_validation.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_format.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_format.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_format.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_format.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_format.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_format.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_format.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_reference_format.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_reference_format.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_reference_format.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_reference_format.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_reference_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_reference_format.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_reference_format.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_reference_format.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_template_format.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_template_format.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_template_format.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_template_format.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_template_format.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_template_format.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/model/uri_template_format.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/model/uri_template_format.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/models/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/models/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/models/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/models/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_simple_types_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_simple_types_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_int_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_int_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_int_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_int_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_int_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_int_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_number_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_number_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_number_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_number_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_number_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_number_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_small_number_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_small_number_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_small_number_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_small_number_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_small_number_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_by_small_number_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_date_time_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_date_time_format_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_date_time_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_date_time_format_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_date_time_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_date_time_format_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_email_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_email_format_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_email_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_email_format_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_email_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_email_format_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enums_in_properties_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enums_in_properties_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_forbidden_property_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_forbidden_property_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_hostname_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_hostname_format_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_hostname_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_hostname_format_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_hostname_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_hostname_format_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv4_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv4_format_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv6_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv6_format_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_json_pointer_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_json_pointer_format_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxitems_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxitems_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxlength_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxlength_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minitems_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minitems_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minlength_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minlength_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minproperties_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minproperties_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_items_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_items_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_items_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_items_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_items_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_items_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_not_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_properties_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_properties_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_required_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_required_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_allof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_allof_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_items_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_items_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_not_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_not_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_property_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_property_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_default_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_default_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_validation_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_validation_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_format_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_format_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_format_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_reference_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_reference_format_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_template_format_request_body/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_template_format_request_body/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/__init__.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/__init__.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/__init__.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.pyi similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.pyi rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.pyi diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/rest.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/rest.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/rest.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/rest.py diff --git a/samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/schemas.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/schemas.py similarity index 100% rename from samples/openapi3/client/3_0_3_unit_test/python-experimental/unit_test_api/schemas.py rename to samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/schemas.py diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/.gitignore b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.gitignore similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/.gitignore rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.gitignore diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/.gitlab-ci.yml b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.gitlab-ci.yml similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/.gitlab-ci.yml rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.gitlab-ci.yml diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator-ignore b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.openapi-generator-ignore similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator-ignore rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.openapi-generator-ignore diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/FILES b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.openapi-generator/FILES similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/FILES rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.openapi-generator/FILES diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.openapi-generator/VERSION similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.openapi-generator/VERSION diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/.travis.yml b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.travis.yml similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/.travis.yml rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/.travis.yml diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/README.md b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/README.md similarity index 98% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/README.md rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/README.md index cf8ca840349f..12a5abda0bbf 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/README.md +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/README.md @@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: - API version: 1.0.0 - Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.PythonClientCodegen +- Build package: org.openapitools.codegen.languages.PythonPriorClientCodegen ## Requirements. diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/docs/UsageApi.md b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/docs/UsageApi.md similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/docs/UsageApi.md rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/docs/UsageApi.md diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/git_push.sh b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/git_push.sh similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/git_push.sh rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/git_push.sh diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/requirements.txt b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/requirements.txt similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/requirements.txt rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/requirements.txt diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/setup.cfg b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/setup.cfg similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/setup.cfg rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/setup.cfg diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/setup.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/setup.py similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/setup.py rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/setup.py diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/test-requirements.txt b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/test-requirements.txt similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/test-requirements.txt rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/test-requirements.txt diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/test/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/test/__init__.py similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/test/__init__.py rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/test/__init__.py diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/test/test_usage_api.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/test/test_usage_api.py similarity index 98% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/test/test_usage_api.py rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/test/test_usage_api.py index db5d36ec6224..01ebfea96950 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/test/test_usage_api.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/test/test_usage_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ OpenAPI Extension x-auth-id-alias diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/tests/test_api_keys.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/tests/test_api_keys.py similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/tests/test_api_keys.py rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/tests/test_api_keys.py diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/tox.ini b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/tox.ini similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/tox.ini rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/tox.ini diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/__init__.py similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/__init__.py rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/__init__.py diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/api/__init__.py similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/__init__.py rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/api/__init__.py diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/api/usage_api.py similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/api/usage_api.py diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/api_client.py similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/api_client.py diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/apis/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/apis/__init__.py similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/apis/__init__.py rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/apis/__init__.py diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/configuration.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/configuration.py similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/configuration.py rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/configuration.py diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/exceptions.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/exceptions.py similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/exceptions.py rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/exceptions.py diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/model/__init__.py similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model/__init__.py rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/model/__init__.py diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model_utils.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/model_utils.py similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model_utils.py rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/model_utils.py diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/models/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/models/__init__.py similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/models/__init__.py rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/models/__init__.py diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/rest.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/rest.py similarity index 100% rename from samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/rest.py rename to samples/openapi3/client/extensions/x-auth-id-alias/python-prior/x_auth_id_alias/rest.py diff --git a/samples/openapi3/client/features/dynamic-servers/python/.gitignore b/samples/openapi3/client/features/dynamic-servers/python/.gitignore index 43995bd42fa2..a62e8aba43f8 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/.gitignore +++ b/samples/openapi3/client/features/dynamic-servers/python/.gitignore @@ -33,6 +33,7 @@ var/ # Installer logs pip-log.txt pip-delete-this-directory.txt +dev-requirements.txt.log # Unit test / coverage reports htmlcov/ diff --git a/samples/openapi3/client/features/dynamic-servers/python/.gitlab-ci.yml b/samples/openapi3/client/features/dynamic-servers/python/.gitlab-ci.yml index 5f3063bdcb05..3d7864a76721 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/.gitlab-ci.yml +++ b/samples/openapi3/client/features/dynamic-servers/python/.gitlab-ci.yml @@ -10,6 +10,9 @@ stages: - pip install -r test-requirements.txt - pytest --cov=dynamic_servers +test-3.5: + extends: .tests + image: python:3.5-alpine test-3.6: extends: .tests image: python:3.6-alpine @@ -19,6 +22,3 @@ test-3.7: test-3.8: extends: .tests image: python:3.8-alpine -test-3.9: - extends: .tests - image: python:3.9-alpine diff --git a/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/FILES b/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/FILES index e9b184541660..ae692977efef 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/FILES +++ b/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/FILES @@ -2,22 +2,22 @@ .gitlab-ci.yml .travis.yml README.md -docs/UsageApi.md +docs/apis/tags/UsageApi.md dynamic_servers/__init__.py -dynamic_servers/api/__init__.py -dynamic_servers/api/usage_api.py dynamic_servers/api_client.py dynamic_servers/apis/__init__.py +dynamic_servers/apis/tags/usage_api.py dynamic_servers/configuration.py dynamic_servers/exceptions.py dynamic_servers/model/__init__.py -dynamic_servers/model_utils.py dynamic_servers/models/__init__.py dynamic_servers/rest.py +dynamic_servers/schemas.py git_push.sh requirements.txt setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_models/__init__.py tox.ini diff --git a/samples/openapi3/client/features/dynamic-servers/python/.travis.yml b/samples/openapi3/client/features/dynamic-servers/python/.travis.yml index 33011d57a8f7..2ed01c997380 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/.travis.yml +++ b/samples/openapi3/client/features/dynamic-servers/python/.travis.yml @@ -1,10 +1,10 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: + - "3.5" - "3.6" - "3.7" - "3.8" - - "3.9" # command to install dependencies install: - "pip install -r requirements.txt" diff --git a/samples/openapi3/client/features/dynamic-servers/python/README.md b/samples/openapi3/client/features/dynamic-servers/python/README.md index f75ed4a6d011..414bf0bd1f04 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/README.md +++ b/samples/openapi3/client/features/dynamic-servers/python/README.md @@ -9,7 +9,98 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python >=3.6 +Python >=3.7 + +## Migration from other generators like python and python-legacy + +### Changes +1. This generator uses spec case for all (object) property names and parameter names. + - So if the spec has a property name like camelCase, it will use camelCase rather than camel_case + - So you will need to update how you input and read properties to use spec case +2. Endpoint parameters are stored in dictionaries to prevent collisions (explanation below) + - So you will need to update how you pass data in to endpoints +3. Endpoint responses now include the original response, the deserialized response body, and (todo)the deserialized headers + - So you will need to update your code to use response.body to access deserialized data +4. All validated data is instantiated in an instance that subclasses all validated Schema classes and Decimal/str/list/tuple/frozendict/NoneClass/BoolClass/bytes/io.FileIO + - This means that you can use isinstance to check if a payload validated against a schema class + - This means that no data will be of type None/True/False + - ingested None will subclass NoneClass + - ingested True will subclass BoolClass + - ingested False will subclass BoolClass + - So if you need to check is True/False/None, instead use instance.is_true_oapg()/.is_false_oapg()/.is_none_oapg() +5. All validated class instances are immutable except for ones based on io.File + - This is because if properties were changed after validation, that validation would no longer apply + - So no changing values or property values after a class has been instantiated +6. String + Number types with formats + - String type data is stored as a string and if you need to access types based on its format like date, + date-time, uuid, number etc then you will need to use accessor functions on the instance + - type string + format: See .as_date_oapg, .as_datetime_oapg, .as_decimal_oapg, .as_uuid_oapg + - type number + format: See .as_float_oapg, .as_int_oapg + - this was done because openapi/json-schema defines constraints. string data may be type string with no format + keyword in one schema, and include a format constraint in another schema + - So if you need to access a string format based type, use as_date_oapg/as_datetime_oapg/as_decimal_oapg/as_uuid_oapg + - So if you need to access a number format based type, use as_int_oapg/as_float_oapg +7. Property access on AnyType(type unset) or object(dict) schemas + - Only required keys with valid python names are properties like .someProp and have type hints + - All optional keys may not exist, so properties are not defined for them + - One can access optional values with dict_instance['optionalProp'] and KeyError will be raised if it does not exist + - Use get_item_oapg if you need a way to always get a value whether or not the key exists + - If the key does not exist, schemas.unset is returned from calling dict_instance.get_item_oapg('optionalProp') + - All required and optional keys have type hints for this method, and @typing.overload is used + - A type hint is also generated for additionalProperties accessed using this method + - So you will need to update you code to use some_instance['optionalProp'] to access optional property + and additionalProperty values +8. The location of the api classes has changed + - Api classes are located in your_package.apis.tags.some_api + - This change was made to eliminate redundant code generation + - Legacy generators generated the same endpoint twice if it had > 1 tag on it + - This generator defines an endpoint in one class, then inherits that class to generate + apis by tags and by paths + - This change reduces code and allows quicker run time if you use the path apis + - path apis are at your_package.apis.paths.some_path + - Those apis will only load their needed models, which is less to load than all of the resources needed in a tag api + - So you will need to update your import paths to the api classes + +### Why are Oapg and _oapg used in class and method names? +Classes can have arbitrarily named properties set on them +Endpoints can have arbitrary operationId method names set +For those reasons, I use the prefix Oapg and _oapg to greatly reduce the likelihood of collisions +on protected + public classes/methods. +oapg stands for OpenApi Python Generator. + +### Object property spec case +This was done because when payloads are ingested, they can be validated against N number of schemas. +If the input signature used a different property name then that has mutated the payload. +So SchemaA and SchemaB must both see the camelCase spec named variable. +Also it is possible to send in two properties, named camelCase and camel_case in the same payload. +That use case should be support so spec case is used. + +### Parameter spec case +Parameters can be included in different locations including: +- query +- path +- header +- cookie + +Any of those parameters could use the same parameter names, so if every parameter +was included as an endpoint parameter in a function signature, they would collide. +For that reason, each of those inputs have been separated out into separate typed dictionaries: +- query_params +- path_params +- header_params +- cookie_params + +So when updating your code, you will need to pass endpoint parameters in using those +dictionaries. + +### Endpoint responses +Endpoint responses have been enriched to now include more information. +Any response reom an endpoint will now include the following properties: +response: urllib3.HTTPResponse +body: typing.Union[Unset, Schema] +headers: typing.Union[Unset, TODO] +Note: response header deserialization has not yet been added + ## Installation & Usage ### pip install @@ -49,7 +140,7 @@ Please follow the [installation procedure](#installation--usage) and then run th import time import dynamic_servers from pprint import pprint -from dynamic_servers.api import usage_api +from dynamic_servers.apis import usage_api # 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 = dynamic_servers.Configuration( @@ -57,12 +148,11 @@ configuration = dynamic_servers.Configuration( ) - # Enter a context with an instance of the API client with dynamic_servers.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = usage_api.UsageApi(api_client) - + try: # Use custom server api_response = api_instance.custom_server() @@ -77,14 +167,12 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*UsageApi* | [**custom_server**](docs/UsageApi.md#custom_server) | **GET** /custom | Use custom server -*UsageApi* | [**default_server**](docs/UsageApi.md#default_server) | **GET** /default | Use default server - +*UsageApi* | [**custom_server**](docs/apis/tags/UsageApi.md#custom_server) | **get** /custom | Use custom server +*UsageApi* | [**default_server**](docs/apis/tags/UsageApi.md#default_server) | **get** /default | Use default server ## Documentation For Models - ## Documentation For Authorization All endpoints do not require authorization. @@ -93,17 +181,16 @@ Class | Method | HTTP request | Description - ## Notes for Large OpenAPI documents If the OpenAPI document is large, imports in dynamic_servers.apis and dynamic_servers.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: Solution 1: Use specific imports for apis and models like: -- `from dynamic_servers.api.default_api import DefaultApi` +- `from dynamic_servers.apis.default_api import DefaultApi` - `from dynamic_servers.model.pet import Pet` -Solution 2: +Solution 1: Before importing the package, adjust the maximum recursion limit as shown below: ``` import sys @@ -112,4 +199,3 @@ import dynamic_servers from dynamic_servers.apis import * from dynamic_servers.models import * ``` - diff --git a/samples/openapi3/client/features/dynamic-servers/python/docs/apis/tags/UsageApi.md b/samples/openapi3/client/features/dynamic-servers/python/docs/apis/tags/UsageApi.md new file mode 100644 index 000000000000..fd5794f87d6d --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/python/docs/apis/tags/UsageApi.md @@ -0,0 +1,136 @@ + +# dynamic_servers.apis.tags.usage_api.UsageApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**custom_server**](#custom_server) | **get** /custom | Use custom server +[**default_server**](#default_server) | **get** /default | Use default server + +# **custom_server** + +> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} custom_server() + +Use custom server + +Use custom server + +### Example + +```python +import dynamic_servers +from dynamic_servers.apis.tags import usage_api +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 = dynamic_servers.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# Enter a context with an instance of the API client +with dynamic_servers.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = usage_api.UsageApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # Use custom server + api_response = api_instance.custom_server() + pprint(api_response) + except dynamic_servers.ApiException as e: + print("Exception when calling UsageApi->custom_server: %s\n" % e) +``` +### Parameters +This endpoint does not need any parameter. + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#custom_server.ApiResponseFor200) | successful operation + +#### custom_server.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor200ResponseBodyApplicationJson + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, | frozendict.frozendict, | | + +### Authorization + +No authorization required + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **default_server** + +> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} default_server() + +Use default server + +Use default server + +### Example + +```python +import dynamic_servers +from dynamic_servers.apis.tags import usage_api +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 = dynamic_servers.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# Enter a context with an instance of the API client +with dynamic_servers.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = usage_api.UsageApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # Use default server + api_response = api_instance.default_server() + pprint(api_response) + except dynamic_servers.ApiException as e: + print("Exception when calling UsageApi->default_server: %s\n" % e) +``` +### Parameters +This endpoint does not need any parameter. + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#default_server.ApiResponseFor200) | successful operation + +#### default_server.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor200ResponseBodyApplicationJson + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, | frozendict.frozendict, | | + +### Authorization + +No authorization required + +[[Back to top]](#__pageTop) [[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/features/dynamic-servers/python/dynamic_servers/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/__init__.py index f12625bd4e52..887687d8b5b6 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/__init__.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/__init__.py @@ -1,3 +1,5 @@ +# coding: utf-8 + # flake8: noqa """ @@ -9,7 +11,6 @@ Generated by: https://openapi-generator.tech """ - __version__ = "1.0.0" # import ApiClient diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py index 6106c4b752f1..3bf3c5f6652f 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py @@ -1,3 +1,4 @@ +# coding: utf-8 """ OpenAPI Extension with dynamic servers @@ -7,39 +8,952 @@ Generated by: https://openapi-generator.tech """ - +from dataclasses import dataclass +from decimal import Decimal +import enum +import email import json +import os +import io import atexit -import mimetypes from multiprocessing.pool import ThreadPool -import io -import os import re +import tempfile import typing -from urllib.parse import quote -from urllib3.fields import RequestField +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict +from urllib.parse import urlparse, quote +from urllib3.fields import RequestField as RequestFieldBase +import frozendict from dynamic_servers import rest from dynamic_servers.configuration import Configuration -from dynamic_servers.exceptions import ApiTypeError, ApiValueError, ApiException -from dynamic_servers.model_utils import ( - ModelNormal, - ModelSimple, - ModelComposed, - check_allowed_values, - check_validations, +from dynamic_servers.exceptions import ApiTypeError, ApiValueError +from dynamic_servers.schemas import ( + NoneClass, + BoolClass, + Schema, + FileIO, + BinarySchema, date, datetime, - deserialize_file, - file_type, - model_to_dict, none_type, - validate_and_convert_types + Unset, + unset, ) -class ApiClient(object): +class RequestField(RequestFieldBase): + def __eq__(self, other): + if not isinstance(other, RequestField): + return False + return self.__dict__ == other.__dict__ + + +class JSONEncoder(json.JSONEncoder): + def default(self, obj): + if isinstance(obj, str): + return str(obj) + elif isinstance(obj, float): + return float(obj) + elif isinstance(obj, int): + return int(obj) + elif isinstance(obj, Decimal): + if obj.as_tuple().exponent >= 0: + return int(obj) + return float(obj) + elif isinstance(obj, NoneClass): + return None + elif isinstance(obj, BoolClass): + return bool(obj) + elif isinstance(obj, (dict, frozendict.frozendict)): + return {key: self.default(val) for key, val in obj.items()} + elif isinstance(obj, (list, tuple)): + return [self.default(item) for item in obj] + raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) + + +class ParameterInType(enum.Enum): + QUERY = 'query' + HEADER = 'header' + PATH = 'path' + COOKIE = 'cookie' + + +class ParameterStyle(enum.Enum): + MATRIX = 'matrix' + LABEL = 'label' + FORM = 'form' + SIMPLE = 'simple' + SPACE_DELIMITED = 'spaceDelimited' + PIPE_DELIMITED = 'pipeDelimited' + DEEP_OBJECT = 'deepObject' + + +class PrefixSeparatorIterator: + # A class to store prefixes and separators for rfc6570 expansions + + def __init__(self, prefix: str, separator: str): + self.prefix = prefix + self.separator = separator + self.first = True + if separator in {'.', '|', '%20'}: + item_separator = separator + else: + item_separator = ',' + self.item_separator = item_separator + + def __iter__(self): + return self + + def __next__(self): + if self.first: + self.first = False + return self.prefix + return self.separator + + +class ParameterSerializerBase: + @classmethod + def _get_default_explode(cls, style: ParameterStyle) -> bool: + return False + + @staticmethod + def __ref6570_item_value(in_data: typing.Any, percent_encode: bool): + """ + Get representation if str/float/int/None/items in list/ values in dict + None is returned if an item is undefined, use cases are value= + - None + - [] + - {} + - [None, None None] + - {'a': None, 'b': None} + """ + if type(in_data) in {str, float, int}: + if percent_encode: + return quote(str(in_data)) + return str(in_data) + elif isinstance(in_data, none_type): + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + elif isinstance(in_data, list) and not in_data: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + elif isinstance(in_data, dict) and not in_data: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + raise ApiValueError('Unable to generate a ref6570 item representation of {}'.format(in_data)) + + @staticmethod + def _to_dict(name: str, value: str): + return {name: value} + + @classmethod + def __ref6570_str_float_int_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_value = cls.__ref6570_item_value(in_data, percent_encode) + if item_value is None or (item_value == '' and prefix_separator_iterator.separator == ';'): + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals = '=' if named_parameter_expansion else '' + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value + + @classmethod + def __ref6570_list_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] + item_values = [v for v in item_values if v is not None] + if not item_values: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + + value_pair_equals + + prefix_separator_iterator.item_separator.join(item_values) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [var_name_piece + value_pair_equals + val for val in item_values] + ) + + @classmethod + def __ref6570_dict_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} + in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} + if not in_data_transformed: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + value_pair_equals + + prefix_separator_iterator.item_separator.join( + prefix_separator_iterator.item_separator.join( + item_pair + ) for item_pair in in_data_transformed.items() + ) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [key + '=' + val for key, val in in_data_transformed.items()] + ) + + @classmethod + def _ref6570_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator + ) -> str: + """ + Separator is for separate variables like dict with explode true, not for array item separation + """ + named_parameter_expansion = prefix_separator_iterator.separator in {'&', ';'} + var_name_piece = variable_name if named_parameter_expansion else '' + if type(in_data) in {str, float, int}: + return cls.__ref6570_str_float_int_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + elif isinstance(in_data, none_type): + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + elif isinstance(in_data, list): + return cls.__ref6570_list_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + elif isinstance(in_data, dict): + return cls.__ref6570_dict_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + # bool, bytes, etc + raise ApiValueError('Unable to generate a ref6570 representation of {}'.format(in_data)) + + +class StyleFormSerializer(ParameterSerializerBase): + @classmethod + def _get_default_explode(cls, style: ParameterStyle) -> bool: + if style is ParameterStyle.FORM: + return True + return super()._get_default_explode(style) + + def _serialize_form( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + name: str, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None + ) -> str: + if prefix_separator_iterator is None: + prefix_separator_iterator = PrefixSeparatorIterator('?', '&') + return self._ref6570_expansion( + variable_name=name, + in_data=in_data, + explode=explode, + percent_encode=percent_encode, + prefix_separator_iterator=prefix_separator_iterator + ) + + +class StyleSimpleSerializer(ParameterSerializerBase): + + def _serialize_simple( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + name: str, + explode: bool, + percent_encode: bool + ) -> str: + prefix_separator_iterator = PrefixSeparatorIterator('', ',') + return self._ref6570_expansion( + variable_name=name, + in_data=in_data, + explode=explode, + percent_encode=percent_encode, + prefix_separator_iterator=prefix_separator_iterator + ) + + +@dataclass +class ParameterBase: + name: str + in_type: ParameterInType + required: bool + style: typing.Optional[ParameterStyle] + explode: typing.Optional[bool] + allow_reserved: typing.Optional[bool] + schema: typing.Optional[typing.Type[Schema]] + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] + + __style_to_in_type = { + ParameterStyle.MATRIX: {ParameterInType.PATH}, + ParameterStyle.LABEL: {ParameterInType.PATH}, + ParameterStyle.FORM: {ParameterInType.QUERY, ParameterInType.COOKIE}, + ParameterStyle.SIMPLE: {ParameterInType.PATH, ParameterInType.HEADER}, + ParameterStyle.SPACE_DELIMITED: {ParameterInType.QUERY}, + ParameterStyle.PIPE_DELIMITED: {ParameterInType.QUERY}, + ParameterStyle.DEEP_OBJECT: {ParameterInType.QUERY}, + } + __in_type_to_default_style = { + ParameterInType.QUERY: ParameterStyle.FORM, + ParameterInType.PATH: ParameterStyle.SIMPLE, + ParameterInType.HEADER: ParameterStyle.SIMPLE, + ParameterInType.COOKIE: ParameterStyle.FORM, + } + __disallowed_header_names = {'Accept', 'Content-Type', 'Authorization'} + _json_encoder = JSONEncoder() + _json_content_type = 'application/json' + + @classmethod + def __verify_style_to_in_type(cls, style: typing.Optional[ParameterStyle], in_type: ParameterInType): + if style is None: + return + in_type_set = cls.__style_to_in_type[style] + if in_type not in in_type_set: + raise ValueError( + 'Invalid style and in_type combination. For style={} only in_type={} are allowed'.format( + style, in_type_set + ) + ) + + def __init__( + self, + name: str, + in_type: ParameterInType, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + if schema is None and content is None: + raise ValueError('Value missing; Pass in either schema or content') + if schema and content: + raise ValueError('Too many values provided. Both schema and content were provided. Only one may be input') + if name in self.__disallowed_header_names and in_type is ParameterInType.HEADER: + raise ValueError('Invalid name, name may not be one of {}'.format(self.__disallowed_header_names)) + self.__verify_style_to_in_type(style, in_type) + if content is None and style is None: + style = self.__in_type_to_default_style[in_type] + if content is not None and in_type in self.__in_type_to_default_style and len(content) != 1: + raise ValueError('Invalid content length, content length must equal 1') + self.in_type = in_type + self.name = name + self.required = required + self.style = style + self.explode = explode + self.allow_reserved = allow_reserved + self.schema = schema + self.content = content + + def _serialize_json( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> str: + return json.dumps(in_data) + + +class PathParameter(ParameterBase, StyleSimpleSerializer): + + def __init__( + self, + name: str, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + super().__init__( + name, + in_type=ParameterInType.PATH, + required=required, + style=style, + explode=explode, + allow_reserved=allow_reserved, + schema=schema, + content=content + ) + + def __serialize_label( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Dict[str, str]: + prefix_separator_iterator = PrefixSeparatorIterator('.', '.') + value = self._ref6570_expansion( + variable_name=self.name, + in_data=in_data, + explode=self.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return self._to_dict(self.name, value) + + def __serialize_matrix( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Dict[str, str]: + prefix_separator_iterator = PrefixSeparatorIterator(';', ';') + value = self._ref6570_expansion( + variable_name=self.name, + in_data=in_data, + explode=self.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return self._to_dict(self.name, value) + + def __serialize_simple( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + ) -> typing.Dict[str, str]: + value = self._serialize_simple( + in_data=in_data, + name=self.name, + explode=self.explode, + percent_encode=True + ) + return self._to_dict(self.name, value) + + def serialize( + self, + in_data: typing.Union[ + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> typing.Dict[str, str]: + if self.schema: + cast_in_data = self.schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + """ + simple -> path + path: + returns path_params: dict + label -> path + returns path_params + matrix -> path + returns path_params + """ + if self.style: + if self.style is ParameterStyle.SIMPLE: + return self.__serialize_simple(cast_in_data) + elif self.style is ParameterStyle.LABEL: + return self.__serialize_label(cast_in_data) + elif self.style is ParameterStyle.MATRIX: + return self.__serialize_matrix(cast_in_data) + # self.content will be length one + for content_type, schema in self.content.items(): + cast_in_data = schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + if content_type == self._json_content_type: + value = self._serialize_json(cast_in_data) + return self._to_dict(self.name, value) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class QueryParameter(ParameterBase, StyleFormSerializer): + + def __init__( + self, + name: str, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: typing.Optional[bool] = None, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + used_style = ParameterStyle.FORM if style is None and content is None and schema else style + used_explode = self._get_default_explode(used_style) if explode is None else explode + + super().__init__( + name, + in_type=ParameterInType.QUERY, + required=required, + style=used_style, + explode=used_explode, + allow_reserved=allow_reserved, + schema=schema, + content=content + ) + + def __serialize_space_delimited( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = self.get_prefix_separator_iterator() + value = self._ref6570_expansion( + variable_name=self.name, + in_data=in_data, + explode=self.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return self._to_dict(self.name, value) + + def __serialize_pipe_delimited( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = self.get_prefix_separator_iterator() + value = self._ref6570_expansion( + variable_name=self.name, + in_data=in_data, + explode=self.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return self._to_dict(self.name, value) + + def __serialize_form( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = self.get_prefix_separator_iterator() + value = self._serialize_form( + in_data, + name=self.name, + explode=self.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return self._to_dict(self.name, value) + + def get_prefix_separator_iterator(self) -> typing.Optional[PrefixSeparatorIterator]: + if not self.schema: + return None + if self.style is ParameterStyle.FORM: + return PrefixSeparatorIterator('?', '&') + elif self.style is ParameterStyle.SPACE_DELIMITED: + return PrefixSeparatorIterator('', '%20') + elif self.style is ParameterStyle.PIPE_DELIMITED: + return PrefixSeparatorIterator('', '|') + + def serialize( + self, + in_data: typing.Union[ + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None + ) -> typing.Dict[str, str]: + if self.schema: + cast_in_data = self.schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + """ + form -> query + query: + - GET/HEAD/DELETE: could use fields + - PUT/POST: must use urlencode to send parameters + returns fields: tuple + spaceDelimited -> query + returns fields + pipeDelimited -> query + returns fields + deepObject -> query, https://github.com/OAI/OpenAPI-Specification/issues/1706 + returns fields + """ + if self.style: + # TODO update query ones to omit setting values when [] {} or None is input + if self.style is ParameterStyle.FORM: + return self.__serialize_form(cast_in_data, prefix_separator_iterator) + elif self.style is ParameterStyle.SPACE_DELIMITED: + return self.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) + elif self.style is ParameterStyle.PIPE_DELIMITED: + return self.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) + # self.content will be length one + for content_type, schema in self.content.items(): + cast_in_data = schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + if content_type == self._json_content_type: + value = self._serialize_json(cast_in_data) + return self._to_dict(self.name, value) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class CookieParameter(ParameterBase, StyleFormSerializer): + + def __init__( + self, + name: str, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: typing.Optional[bool] = None, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + used_style = ParameterStyle.FORM if style is None and content is None and schema else style + used_explode = self._get_default_explode(used_style) if explode is None else explode + + super().__init__( + name, + in_type=ParameterInType.COOKIE, + required=required, + style=used_style, + explode=used_explode, + allow_reserved=allow_reserved, + schema=schema, + content=content + ) + + def serialize( + self, + in_data: typing.Union[ + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> typing.Dict[str, str]: + if self.schema: + cast_in_data = self.schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + """ + form -> cookie + returns fields: tuple + """ + if self.style: + """ + TODO add escaping of comma, space, equals + or turn encoding on + """ + value = self._serialize_form( + cast_in_data, + explode=self.explode, + name=self.name, + percent_encode=False, + prefix_separator_iterator=PrefixSeparatorIterator('', '&') + ) + return self._to_dict(self.name, value) + # self.content will be length one + for content_type, schema in self.content.items(): + cast_in_data = schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + if content_type == self._json_content_type: + value = self._serialize_json(cast_in_data) + return self._to_dict(self.name, value) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class HeaderParameter(ParameterBase, StyleSimpleSerializer): + def __init__( + self, + name: str, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + super().__init__( + name, + in_type=ParameterInType.HEADER, + required=required, + style=style, + explode=explode, + allow_reserved=allow_reserved, + schema=schema, + content=content + ) + + @staticmethod + def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHeaderDict: + data = tuple(t for t in in_data if t) + headers = HTTPHeaderDict() + if not data: + return headers + headers.extend(data) + return headers + + def serialize( + self, + in_data: typing.Union[ + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> HTTPHeaderDict: + if self.schema: + cast_in_data = self.schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + """ + simple -> header + headers: PoolManager needs a mapping, tuple is close + returns headers: dict + """ + if self.style: + value = self._serialize_simple(cast_in_data, self.name, self.explode, False) + return self.__to_headers(((self.name, value),)) + # self.content will be length one + for content_type, schema in self.content.items(): + cast_in_data = schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + if content_type == self._json_content_type: + value = self._serialize_json(cast_in_data) + return self.__to_headers(((self.name, value),)) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class Encoding: + def __init__( + self, + content_type: str, + headers: typing.Optional[typing.Dict[str, HeaderParameter]] = None, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: bool = False, + ): + self.content_type = content_type + self.headers = headers + self.style = style + self.explode = explode + self.allow_reserved = allow_reserved + + +@dataclass +class MediaType: + """ + Used to store request and response body schema information + encoding: + A map between a property name and its encoding information. + The key, being the property name, MUST exist in the schema as a property. + The encoding object SHALL only apply to requestBody objects when the media type is + multipart or application/x-www-form-urlencoded. + """ + schema: typing.Optional[typing.Type[Schema]] = None + encoding: typing.Optional[typing.Dict[str, Encoding]] = None + + +@dataclass +class ApiResponse: + response: urllib3.HTTPResponse + body: typing.Union[Unset, Schema] + headers: typing.Union[Unset, typing.List[HeaderParameter]] + + def __init__( + self, + response: urllib3.HTTPResponse, + body: typing.Union[Unset, typing.Type[Schema]], + headers: typing.Union[Unset, typing.List[HeaderParameter]] + ): + """ + pycharm needs this to prevent 'Unexpected argument' warnings + """ + self.response = response + self.body = body + self.headers = headers + + +@dataclass +class ApiResponseWithoutDeserialization(ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[Unset, typing.Type[Schema]] = unset + headers: typing.Union[Unset, typing.List[HeaderParameter]] = unset + + +class JSONDetector: + """ + Works for: + application/json + application/json; charset=UTF-8 + application/json-patch+json + application/geo+json + """ + __json_content_type_pattern = re.compile("application/[^+]*[+]?(json);?.*") + + @classmethod + def _content_type_is_json(cls, content_type: str) -> bool: + if cls.__json_content_type_pattern.match(content_type): + return True + return False + + +class OpenApiResponse(JSONDetector): + __filename_content_disposition_pattern = re.compile('filename="(.+?)"') + + def __init__( + self, + response_cls: typing.Type[ApiResponse] = ApiResponse, + content: typing.Optional[typing.Dict[str, MediaType]] = None, + headers: typing.Optional[typing.List[HeaderParameter]] = None, + ): + self.headers = headers + if content is not None and len(content) == 0: + raise ValueError('Invalid value for content, the content dict must have >= 1 entry') + self.content = content + self.response_cls = response_cls + + @staticmethod + def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: + # python must be >= 3.9 so we can pass in bytes into json.loads + return json.loads(response.data) + + @staticmethod + def __file_name_from_response_url(response_url: typing.Optional[str]) -> typing.Optional[str]: + if response_url is None: + return None + url_path = urlparse(response_url).path + if url_path: + path_basename = os.path.basename(url_path) + if path_basename: + _filename, ext = os.path.splitext(path_basename) + if ext: + return path_basename + return None + + @classmethod + def __file_name_from_content_disposition(cls, content_disposition: typing.Optional[str]) -> typing.Optional[str]: + if content_disposition is None: + return None + match = cls.__filename_content_disposition_pattern.search(content_disposition) + if not match: + return None + return match.group(1) + + def __deserialize_application_octet_stream( + self, response: urllib3.HTTPResponse + ) -> typing.Union[bytes, io.BufferedReader]: + """ + urllib3 use cases: + 1. when preload_content=True (stream=False) then supports_chunked_reads is False and bytes are returned + 2. when preload_content=False (stream=True) then supports_chunked_reads is True and + a file will be written and returned + """ + if response.supports_chunked_reads(): + file_name = ( + self.__file_name_from_content_disposition(response.headers.get('content-disposition')) + or self.__file_name_from_response_url(response.geturl()) + ) + + if file_name is None: + _fd, path = tempfile.mkstemp() + else: + path = os.path.join(tempfile.gettempdir(), file_name) + + with open(path, 'wb') as new_file: + chunk_size = 1024 + while True: + data = response.read(chunk_size) + if not data: + break + new_file.write(data) + # release_conn is needed for streaming connections only + response.release_conn() + new_file = open(path, 'rb') + return new_file + else: + return response.data + + @staticmethod + def __deserialize_multipart_form_data( + response: urllib3.HTTPResponse + ) -> typing.Dict[str, typing.Any]: + msg = email.message_from_bytes(response.data) + return { + part.get_param("name", header="Content-Disposition"): part.get_payload( + decode=True + ).decode(part.get_content_charset()) + if part.get_content_charset() + else part.get_payload() + for part in msg.get_payload() + } + + def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> ApiResponse: + content_type = response.getheader('content-type') + deserialized_body = unset + streamed = response.supports_chunked_reads() + + deserialized_headers = unset + if self.headers is not None: + # TODO add header deserialiation here + pass + + if self.content is not None: + if content_type not in self.content: + raise ApiValueError( + f"Invalid content_type returned. Content_type='{content_type}' was returned " + f"when only {str(set(self.content))} are defined for status_code={str(response.status)}" + ) + body_schema = self.content[content_type].schema + if body_schema is None: + # some specs do not define response content media type schemas + return self.response_cls( + response=response, + headers=deserialized_headers, + body=unset + ) + + if self._content_type_is_json(content_type): + body_data = self.__deserialize_json(response) + elif content_type == 'application/octet-stream': + body_data = self.__deserialize_application_octet_stream(response) + elif content_type.startswith('multipart/form-data'): + body_data = self.__deserialize_multipart_form_data(response) + content_type = 'multipart/form-data' + else: + raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) + deserialized_body = body_schema.from_openapi_data_oapg( + body_data, _configuration=configuration) + elif streamed: + response.release_conn() + + return self.response_cls( + response=response, + headers=deserialized_headers, + body=deserialized_body + ) + + +class ApiClient: """Generic API client for OpenAPI client library builds. OpenAPI generic API client. This client handles the client- @@ -63,10 +977,16 @@ class ApiClient(object): _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + def __init__( + self, + configuration: typing.Optional[Configuration] = None, + header_name: typing.Optional[str] = None, + header_value: typing.Optional[str] = None, + cookie: typing.Optional[str] = None, + pool_threads: int = 1 + ): if configuration is None: - configuration = Configuration.get_default_copy() + configuration = Configuration() self.configuration = configuration self.pool_threads = pool_threads @@ -118,298 +1038,83 @@ def __call_api( self, resource_path: str, method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + headers: typing.Optional[HTTPHeaderDict] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, auth_settings: typing.Optional[typing.List[str]] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): - - config = self.configuration + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + host: typing.Optional[str] = None, + ) -> urllib3.HTTPResponse: # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) + headers = headers or {} + headers.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) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # 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)) - if header_params['Content-Type'].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, - (dict)) - - # body - if body: - body = self.sanitize_for_serialization(body) + headers['Cookie'] = self.cookie # auth setting - self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body, - request_auths=_request_auths) + self.update_params_for_auth(headers, + auth_settings, resource_path, method, body) # request url - if _host is None: + if host is None: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead - url = _host + resource_path - - 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: - 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) - return return_data - - # deserialize response data - if response_type: - if response_type != (file_type,): - encoding = "utf-8" - 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) - if match: - encoding = match.group(1) - response_data.data = response_data.data.decode(encoding) - - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) - else: - return_data = None - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) - - def parameters_to_multipart(self, params, collection_types): - """Get parameters as list of tuples, formatting as json if value is collection_types - - :param params: Parameters as list of two-tuples - :param dict collection_types: Parameter collection types - :return: Parameters as list of tuple or urllib3.fields.RequestField - """ - new_params = [] - if collection_types is None: - collection_types = (dict) - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance( - v, collection_types): # v is instance of collection_type, formatting as application/json - v = json.dumps(v, ensure_ascii=False).encode("utf-8") - field = RequestField(k, v) - field.make_multipart(content_type="application/json; charset=utf-8") - new_params.append(field) - else: - new_params.append((k, v)) - return new_params - - @classmethod - def sanitize_for_serialization(cls, obj): - """Prepares data for transmission before it is sent with the rest client - 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. - If obj is io.IOBase, return the bytes - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if isinstance(obj, (ModelNormal, ModelComposed)): - return { - key: cls.sanitize_for_serialization(val) for key, - val in model_to_dict( - obj, - serialize=True).items()} - elif isinstance(obj, io.IOBase): - return cls.get_file_data_and_close_file(obj) - elif isinstance(obj, (str, int, float, none_type, bool)): - return obj - elif isinstance(obj, (datetime, date)): - return obj.isoformat() - elif isinstance(obj, ModelSimple): - return cls.sanitize_for_serialization(obj.value) - elif isinstance(obj, (list, tuple)): - return [cls.sanitize_for_serialization(item) for item in obj] - if isinstance(obj, dict): - return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} - raise ApiValueError( - 'Unable to prepare type {} for serialization'.format( - obj.__class__.__name__)) - - def deserialize(self, response, response_type, _check_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param _check_type: boolean, whether to check the types of the data - received from the server - :type _check_type: bool - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == (file_type,): - content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, - content_disposition=content_disposition) - - # fetch data from response object - try: - received_data = json.loads(response.data) - except ValueError: - received_data = response.data - - # store our data under the key of 'received_data' so users have some - # context if they are deserializing a string and the data type is wrong - deserialized_data = validate_and_convert_types( - received_data, - response_type, - ['received_data'], - True, - _check_type, - configuration=self.configuration + url = host + resource_path + + # perform request and return response + response = self.request( + method, + url, + headers=headers, + fields=fields, + body=body, + stream=stream, + timeout=timeout, ) - return deserialized_data + return response def call_api( self, resource_path: str, method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + headers: typing.Optional[HTTPHeaderDict] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, auth_settings: typing.Optional[typing.List[str]] = None, async_req: typing.Optional[bool] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + host: typing.Optional[str] = None, + ) -> urllib3.HTTPResponse: """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 + :param headers: Header parameters to be placed in the request header. :param body: Request body. - :param post_params dict: Request post form parameters, + :param fields: 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_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param files: key -> field name, value -> a list of open file - objects for `multipart/form-data`. - :type files: dict - :param async_req bool: execute 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 collection_formats: dict of collection formats for path, query, - header, and post parameters. - :type collection_formats: dict, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will + :param auth_settings: Auth Settings names for the request. + :param async_req: execute request asynchronously + :type async_req: bool, optional TODO remove, unused + :param stream: if True, 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 + data. Also when True, if the openapi spec describes a file download, + the data will be written to a local filesystme file and the BinarySchema + instance will also inherit from FileSchema and FileIO + Default is False. + :type stream: bool, optional + :param 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 _check_type: boolean describing if the data back from the server - should have its type checked. - :type _check_type: bool, optional - :param _request_auths: 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_auths: list, optional + :param host: api endpoint host :return: If async_req parameter is True, the request will be called asynchronously. @@ -417,82 +1122,90 @@ def call_api( 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_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _check_type, _request_auths=_request_auths) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _check_type, None, _request_auths)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): + return self.__call_api( + resource_path, + method, + headers, + body, + fields, + auth_settings, + stream, + timeout, + host, + ) + + return self.pool.apply_async( + self.__call_api, + ( + resource_path, + method, + headers, + body, + json, + fields, + auth_settings, + stream, + timeout, + host, + ) + ) + + def request( + self, + method: str, + url: str, + headers: typing.Optional[HTTPHeaderDict] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: """Makes the HTTP request using RESTClient.""" if method == "GET": return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, + stream=stream, + timeout=timeout, headers=headers) elif method == "HEAD": return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, + stream=stream, + timeout=timeout, headers=headers) elif method == "OPTIONS": return self.rest_client.OPTIONS(url, - query_params=query_params, headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, + fields=fields, + stream=stream, + timeout=timeout, body=body) elif method == "POST": return self.rest_client.POST(url, - query_params=query_params, headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, + fields=fields, + stream=stream, + timeout=timeout, body=body) elif method == "PUT": return self.rest_client.PUT(url, - query_params=query_params, headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, + fields=fields, + stream=stream, + timeout=timeout, body=body) elif method == "PATCH": return self.rest_client.PATCH(url, - query_params=query_params, headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, + fields=fields, + stream=stream, + timeout=timeout, body=body) elif method == "DELETE": return self.rest_client.DELETE(url, - query_params=query_params, headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, + stream=stream, + timeout=timeout, body=body) else: raise ApiValueError( @@ -500,397 +1213,277 @@ def request(self, method, url, query_params=None, headers=None, " `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 - - @staticmethod - def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: - file_data = file_instance.read() - file_instance.close() - return file_data - - def files_parameters(self, - files: typing.Optional[typing.Dict[str, - typing.List[io.IOBase]]] = None): - """Builds form parameters. - - :param files: None or a dict with key=param_name and - value is a list of open file objects - :return: List of tuples of form parameters with file data - """ - if files is None: - return [] - - params = [] - for param_name, file_instances in files.items(): - if file_instances is None: - # if the file field is nullable, skip None values - continue - for file_instance in file_instances: - if file_instance is None: - # if the file field is nullable, skip None values - continue - if file_instance.closed is True: - raise ApiValueError( - "Cannot read a closed file. The passed in file_type " - "for %s must be open." % param_name - ) - filename = os.path.basename(file_instance.name) - filedata = self.get_file_data_and_close_file(file_instance) - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([param_name, 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 - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types, method=None, body=None): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return None - - content_types = [x.lower() for x in content_types] - - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, request_auths=None): + def update_params_for_auth(self, headers, auth_settings, + resource_path, method, body): """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. :param resource_path: A string representation of the HTTP request resource path. :param method: A string representation of the HTTP request method. :param body: A object representing the body of the HTTP request. The object type is the return value of _encoder.default(). - :param request_auths: if set, the provided settings will - override the token in the configuration. """ if not auth_settings: return - if request_auths: - for auth_setting in request_auths: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting) - 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): - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['key'] + "=" + auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called - """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type', - '_content_type', - '_spec_property_naming', - '_request_auths' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (none_type, int), - '_preload_content': (bool,), - '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,), - '_spec_property_naming': (bool,), - '_content_type': (none_type, str), - '_request_auths': (none_type, list) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] + if not auth_setting: + continue + if auth_setting['in'] == 'cookie': + headers.add('Cookie', auth_setting['value']) + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers.add(auth_setting['key'], auth_setting['value']) + elif auth_setting['in'] == 'query': + """ TODO implement auth in query + need to pass in prefix_separator_iterator + and need to output resource_path with query params added + """ + raise ApiValueError("Auth in query not yet implemented") + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' ) - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param], - configuration=self.api_client.configuration - ) - if kwargs['_check_input_type'] is False: - return +class Api: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech - for key, value in kwargs.items(): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - kwargs['_spec_property_naming'], - kwargs['_check_input_type'], - configuration=self.api_client.configuration - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } + Do not edit the class manually. + """ - for param_name, param_value in kwargs.items(): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - params['file'][base_name] = [param_value] - elif (param_location == 'form' and - self.openapi_types[param_name] == ([file_type],)): - # param_value is already a list - params['file'][base_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format - - return params - - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: - - api_instance = UsageApi() - api_instance.custom_server # this is an instance of the class Endpoint - api_instance.custom_server() # this invokes api_instance.custom_server.__call__() - which then invokes the callable functions stored in that endpoint at - api_instance.custom_server.callable or self.callable in this class + def __init__(self, api_client: typing.Optional[ApiClient] = None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + @staticmethod + def _verify_typed_dict_inputs_oapg(cls: typing.Type[typing_extensions.TypedDict], data: typing.Dict[str, typing.Any]): """ - return self.callable(self, *args, **kwargs) + Ensures that: + - required keys are present + - additional properties are not input + - value stored under required keys do not have the value unset + Note: detailed value checking is done in schema classes + """ + missing_required_keys = [] + required_keys_with_unset_values = [] + for required_key in cls.__required_keys__: + if required_key not in data: + missing_required_keys.append(required_key) + continue + value = data[required_key] + if value is unset: + required_keys_with_unset_values.append(required_key) + if missing_required_keys: + raise ApiTypeError( + '{} missing {} required arguments: {}'.format( + cls.__name__, len(missing_required_keys), missing_required_keys + ) + ) + if required_keys_with_unset_values: + raise ApiValueError( + '{} contains invalid unset values for {} required keys: {}'.format( + cls.__name__, len(required_keys_with_unset_values), required_keys_with_unset_values + ) + ) - def call_with_http_info(self, **kwargs): + disallowed_additional_keys = [] + for key in data: + if key in cls.__required_keys__ or key in cls.__optional_keys__: + continue + disallowed_additional_keys.append(key) + if disallowed_additional_keys: + raise ApiTypeError( + '{} got {} unexpected keyword arguments: {}'.format( + cls.__name__, len(disallowed_additional_keys), disallowed_additional_keys + ) + ) + def _get_host_oapg( + self, + operation_id: str, + servers: typing.Tuple[typing.Dict[str, str], ...] = tuple(), + host_index: typing.Optional[int] = None + ) -> typing.Optional[str]: + configuration = self.api_client.configuration try: - index = self.api_client.configuration.server_operation_index.get( - self.settings['operation_id'], self.api_client.configuration.server_index - ) if kwargs['_host_index'] is None else kwargs['_host_index'] - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings['operation_id'], self.api_client.configuration.server_variables + if host_index is None: + index = configuration.server_operation_index.get( + operation_id, configuration.server_index + ) + else: + index = host_index + server_variables = configuration.server_operation_variables.get( + operation_id, configuration.server_variables ) - _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings['servers'] + host = configuration.get_host_from_settings( + index, variables=server_variables, servers=servers ) except IndexError: - if self.settings['servers']: + if servers: raise ApiValueError( "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in kwargs.items(): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) + len(servers) ) + host = None + return host - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) - self.__validate_inputs(kwargs) +class SerializedRequestBody(typing_extensions.TypedDict, total=False): + body: typing.Union[str, bytes] + fields: typing.Tuple[typing.Union[RequestField, typing.Tuple[str, str]], ...] - params = self.__gather_params(kwargs) - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) +class RequestBody(StyleFormSerializer, JSONDetector): + """ + A request body parameter + content: content_type to MediaType Schema info + """ + __json_encoder = JSONEncoder() - if kwargs.get('_content_type'): - params['header']['Content-Type'] = kwargs['_content_type'] + def __init__( + self, + content: typing.Dict[str, MediaType], + required: bool = False, + ): + self.required = required + if len(content) == 0: + raise ValueError('Invalid value for content, the content dict must have >= 1 entry') + self.content = content + + def __serialize_json( + self, + in_data: typing.Any + ) -> typing.Dict[str, bytes]: + in_data = self.__json_encoder.default(in_data) + json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( + "utf-8" + ) + return dict(body=json_str) + + @staticmethod + def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: + if isinstance(in_data, frozendict.frozendict): + raise ValueError('Unable to serialize type frozendict.frozendict to text/plain') + elif isinstance(in_data, tuple): + raise ValueError('Unable to serialize type tuple to text/plain') + elif isinstance(in_data, NoneClass): + raise ValueError('Unable to serialize type NoneClass to text/plain') + elif isinstance(in_data, BoolClass): + raise ValueError('Unable to serialize type BoolClass to text/plain') + return dict(body=str(in_data)) + + def __multipart_json_item(self, key: str, value: Schema) -> RequestField: + json_value = self.__json_encoder.default(value) + return RequestField(name=key, data=json.dumps(json_value), headers={'Content-Type': 'application/json'}) + + def __multipart_form_item(self, key: str, value: Schema) -> RequestField: + if isinstance(value, str): + return RequestField(name=key, data=str(value), headers={'Content-Type': 'text/plain'}) + elif isinstance(value, bytes): + return RequestField(name=key, data=value, headers={'Content-Type': 'application/octet-stream'}) + elif isinstance(value, FileIO): + request_field = RequestField( + name=key, + data=value.read(), + filename=os.path.basename(value.name), + headers={'Content-Type': 'application/octet-stream'} + ) + value.close() + return request_field + else: + return self.__multipart_json_item(key=key, value=value) + + def __serialize_multipart_form_data( + self, in_data: Schema + ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: + if not isinstance(in_data, frozendict.frozendict): + raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') + """ + In a multipart/form-data request body, each schema property, or each element of a schema array property, + takes a section in the payload with an internal header as defined by RFC7578. The serialization strategy + for each property of a multipart/form-data request body can be specified in an associated Encoding Object. + + When passing in multipart types, boundaries MAY be used to separate sections of the content being + transferred – thus, the following default Content-Types are defined for multipart: + + If the (object) property is a primitive, or an array of primitive values, the default Content-Type is text/plain + If the property is complex, or an array of complex values, the default Content-Type is application/json + Question: how is the array of primitives encoded? + If the property is a type: string with a contentEncoding, the default Content-Type is application/octet-stream + """ + fields = [] + for key, value in in_data.items(): + if isinstance(value, tuple): + if value: + # values use explode = True, so the code makes a RequestField for each item with name=key + for item in value: + request_field = self.__multipart_form_item(key=key, value=item) + fields.append(request_field) + else: + # send an empty array as json because exploding will not send it + request_field = self.__multipart_json_item(key=key, value=value) + fields.append(request_field) + else: + request_field = self.__multipart_form_item(key=key, value=value) + fields.append(request_field) + + return dict(fields=tuple(fields)) + + def __serialize_application_octet_stream(self, in_data: BinarySchema) -> typing.Dict[str, bytes]: + if isinstance(in_data, bytes): + return dict(body=in_data) + # FileIO type + result = dict(body=in_data.read()) + in_data.close() + return result + + def __serialize_application_x_www_form_data( + self, in_data: typing.Any + ) -> SerializedRequestBody: + """ + POST submission of form data in body + """ + if not isinstance(in_data, frozendict.frozendict): + raise ValueError( + f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') + cast_in_data = self.__json_encoder.default(in_data) + value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=False) + return dict(body=value) + + def serialize( + self, in_data: typing.Any, content_type: str + ) -> SerializedRequestBody: + """ + If a str is returned then the result will be assigned to data when making the request + If a tuple is returned then the result will be used as fields input in encode_multipart_formdata + Return a tuple of + + The key of the return dict is + - body for application/json + - encode_multipart and fields for multipart/form-data + """ + media_type = self.content[content_type] + if isinstance(in_data, media_type.schema): + cast_in_data = in_data + elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: + cast_in_data = media_type.schema(**in_data) else: - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - content_types_list = self.api_client.select_header_content_type( - content_type_headers_list, self.settings['http_method'], - params['body']) - if content_types_list: - params['header']['Content-Type'] = content_types_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - _request_auths=kwargs['_request_auths'], - collection_formats=params['collection_format']) + cast_in_data = media_type.schema(in_data) + # TODO check for and use encoding if it exists + # and content_type is multipart or application/x-www-form-urlencoded + if self._content_type_is_json(content_type): + return self.__serialize_json(cast_in_data) + elif content_type == 'text/plain': + return self.__serialize_text_plain(cast_in_data) + elif content_type == 'multipart/form-data': + return self.__serialize_multipart_form_data(cast_in_data) + elif content_type == 'application/x-www-form-urlencoded': + return self.__serialize_application_x_www_form_data(cast_in_data) + elif content_type == 'application/octet-stream': + return self.__serialize_application_octet_stream(cast_in_data) + raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/__init__.py index 21c779b74b34..7840f7726f6a 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/__init__.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/__init__.py @@ -1,17 +1,3 @@ - -# flake8: noqa - -# Import all APIs into this package. -# If you have many APIs here with many many models used in each API this may -# raise a `RecursionError`. -# In order to avoid this, import only the API that you directly need like: -# -# from dynamic_servers.api.usage_api import UsageApi -# -# or import this package, but before doing it, use: -# -# import sys -# sys.setrecursionlimit(n) - -# Import APIs into API package: -from dynamic_servers.api.usage_api import UsageApi +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints then import them from +# tags, paths, or path_to_api, or tag_to_api \ No newline at end of file diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/path_to_api.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/path_to_api.py new file mode 100644 index 000000000000..0ee69ff5afdd --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/path_to_api.py @@ -0,0 +1,20 @@ +import typing_extensions + +from dynamic_servers.paths import PathValues +from dynamic_servers.apis.paths.default import Default +from dynamic_servers.apis.paths.custom import Custom + +PathToApi = typing_extensions.TypedDict( + 'PathToApi', + { + PathValues.DEFAULT: Default, + PathValues.CUSTOM: Custom, + } +) + +path_to_api = PathToApi( + { + PathValues.DEFAULT: Default, + PathValues.CUSTOM: Custom, + } +) diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/paths/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/paths/__init__.py new file mode 100644 index 000000000000..eabedf0f6599 --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/paths/__init__.py @@ -0,0 +1,3 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from dynamic_servers.apis.path_to_api import path_to_api diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/paths/custom.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/paths/custom.py new file mode 100644 index 000000000000..3f82f1a0d47c --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/paths/custom.py @@ -0,0 +1,7 @@ +from dynamic_servers.paths.custom.get import ApiForget + + +class Custom( + ApiForget, +): + pass diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/paths/default.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/paths/default.py new file mode 100644 index 000000000000..22d4848e13d6 --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/paths/default.py @@ -0,0 +1,7 @@ +from dynamic_servers.paths.default.get import ApiForget + + +class Default( + ApiForget, +): + pass diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/tag_to_api.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/tag_to_api.py new file mode 100644 index 000000000000..fb38df5157fb --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/tag_to_api.py @@ -0,0 +1,17 @@ +import typing_extensions + +from dynamic_servers.apis.tags import TagValues +from dynamic_servers.apis.tags.usage_api import UsageApi + +TagToApi = typing_extensions.TypedDict( + 'TagToApi', + { + TagValues.USAGE: UsageApi, + } +) + +tag_to_api = TagToApi( + { + TagValues.USAGE: UsageApi, + } +) diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/tags/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/tags/__init__.py new file mode 100644 index 000000000000..2e44715917b7 --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/tags/__init__.py @@ -0,0 +1,9 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from dynamic_servers.apis.tag_to_api import tag_to_api + +import enum + + +class TagValues(str, enum.Enum): + USAGE = "usage" diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/tags/usage_api.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/tags/usage_api.py new file mode 100644 index 000000000000..0c8658ad88eb --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/apis/tags/usage_api.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Extension with dynamic servers + + This specification shows how to use dynamic servers. # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +from dynamic_servers.paths.custom.get import CustomServer +from dynamic_servers.paths.default.get import DefaultServer + + +class UsageApi( + CustomServer, + DefaultServer, +): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/configuration.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/configuration.py index 61b3561a8269..226e3f7a6ec5 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/configuration.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/configuration.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Extension with dynamic servers @@ -7,7 +9,6 @@ Generated by: https://openapi-generator.tech """ - import copy import logging import multiprocessing @@ -21,7 +22,8 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' + 'minLength', 'pattern', 'maxItems', 'minItems', + 'uniqueItems', 'maxProperties', 'minProperties', } class Configuration(object): @@ -73,8 +75,6 @@ class Configuration(object): :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 """ @@ -82,13 +82,11 @@ class Configuration(object): def __init__(self, host=None, api_key=None, api_key_prefix=None, - access_token=None, username=None, password=None, discard_unknown_keys=False, disabled_client_side_validations="", server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, ): """Constructor """ @@ -107,7 +105,6 @@ def __init__(self, host=None, """Temp file folder for downloading files """ # Authentication Settings - self.access_token = access_token self.api_key = {} if api_key: self.api_key = api_key @@ -155,7 +152,7 @@ def __init__(self, host=None, Set this to false to skip verifying SSL certificate when calling API from https server. """ - self.ssl_ca_cert = ssl_ca_cert + self.ssl_ca_cert = None """Set this to customize the certificate file to verify the peer. """ self.cert_file = None @@ -179,9 +176,6 @@ def __init__(self, host=None, self.proxy = None """Proxy URL """ - self.no_proxy = None - """bypass proxy for host in the no_proxy list. - """ self.proxy_headers = None """Proxy headers """ @@ -401,7 +395,7 @@ def get_host_settings(self): "qa-petstore", "dev-petstore" ] - }, + }, 'port': { 'description': "No description provided", 'default_value': "80", @@ -409,8 +403,8 @@ def get_host_settings(self): "80", "8080" ] + } } - } }, { 'url': "https://localhost:8080/{version}", @@ -424,8 +418,8 @@ def get_host_settings(self): "v2", "v3" ] + } } - } } ] diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/exceptions.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/exceptions.py index 0939031a8987..e6fc3856fc75 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/exceptions.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/exceptions.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Extension with dynamic servers @@ -97,12 +99,12 @@ def __init__(self, msg, path_to_item=None): 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() + def __init__(self, status=None, reason=None, api_response: 'dynamic_servers.api_client.ApiResponse' = None): + if api_response: + self.status = api_response.response.status + self.reason = api_response.response.reason + self.body = api_response.response.data + self.headers = api_response.response.getheaders() else: self.status = status self.reason = reason @@ -111,7 +113,7 @@ def __init__(self, status=None, reason=None, http_resp=None): def __str__(self): """Custom error messages for exception""" - error_message = "Status Code: {0}\n"\ + error_message = "({0})\n"\ "Reason: {1}\n".format(self.status, self.reason) if self.headers: error_message += "HTTP response headers: {0}\n".format( @@ -123,30 +125,6 @@ def __str__(self): 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 = "" diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/models/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/models/__init__.py index 7929e828583e..0cb2976e7c10 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/models/__init__.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/models/__init__.py @@ -1,3 +1,5 @@ +# coding: utf-8 + # flake8: noqa # import all models into this package diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/__init__.py new file mode 100644 index 000000000000..b2acdc1cdc46 --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/__init__.py @@ -0,0 +1,10 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from dynamic_servers.apis.path_to_api import path_to_api + +import enum + + +class PathValues(str, enum.Enum): + DEFAULT = "/default" + CUSTOM = "/custom" diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/custom/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/custom/__init__.py new file mode 100644 index 000000000000..fa96c95e7236 --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/custom/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from dynamic_servers.paths.custom import Api + +from dynamic_servers.paths import PathValues + +path = PathValues.CUSTOM \ No newline at end of file diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/custom/get.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/custom/get.py new file mode 100644 index 000000000000..3a8b7367d8e5 --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/custom/get.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from dynamic_servers import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from dynamic_servers import schemas # noqa: F401 + +from . import path + +_servers = ( + { + 'url': "https://{server}.swagger.io:{port}/v2", + 'description': "No description provided", + 'variables': { + 'server': { + 'description': "No description provided", + 'default_value': "custom-petstore", + 'enum_values': [ + "custom-petstore", + "custom-qa-petstore", + "custom-dev-petstore" + ] + }, + 'port': { + 'description': "No description provided", + 'default_value': "8080", + 'enum_values': [ + "80", + "8080" + ] + } + } + }, + { + 'url': "https://localhost:8081/{version}", + 'description': "The local custom server", + 'variables': { + 'version': { + 'description': "No description provided", + 'default_value': "v2", + 'enum_values': [ + "v1", + "v2", + "v3" + ] + } + } + }, + { + 'url': "https://third.example.com/{prefix}", + 'description': "The local custom server", + 'variables': { + 'prefix': { + 'description': "No description provided", + 'default_value': "custom", + } + } + }, +) +SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + + def _custom_server_oapg( + self: api_client.Api, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + host_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Use custom server + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path.value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + host = self._get_host_oapg('custom_server', _servers, host_index) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + host=host, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response + + +class CustomServer(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + def custom_server( + self: BaseApi, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + host_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + return self._custom_server_oapg( + accept_content_types=accept_content_types, + host_index=host_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + def get( + self: BaseApi, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + host_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + return self._custom_server_oapg( + accept_content_types=accept_content_types, + host_index=host_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/custom/get.pyi b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/custom/get.pyi new file mode 100644 index 000000000000..4522fe6e95cd --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/custom/get.pyi @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from dynamic_servers import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from dynamic_servers import schemas # noqa: F401 + +SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + + def _custom_server_oapg( + self: api_client.Api, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + host_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Use custom server + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path.value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + host = self._get_host_oapg('custom_server', _servers, host_index) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + host=host, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response + + +class CustomServer(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + def custom_server( + self: BaseApi, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + host_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + return self._custom_server_oapg( + accept_content_types=accept_content_types, + host_index=host_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + def get( + self: BaseApi, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + host_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + return self._custom_server_oapg( + accept_content_types=accept_content_types, + host_index=host_index, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/default/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/default/__init__.py new file mode 100644 index 000000000000..cb9e2d07e2f8 --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/default/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from dynamic_servers.paths.default import Api + +from dynamic_servers.paths import PathValues + +path = PathValues.DEFAULT \ No newline at end of file diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/default/get.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/default/get.py new file mode 100644 index 000000000000..8a4be028c470 --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/default/get.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from dynamic_servers import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from dynamic_servers import schemas # noqa: F401 + +from . import path + +SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + + def _default_server_oapg( + self: api_client.Api, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Use default server + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path.value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response + + +class DefaultServer(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + def default_server( + self: BaseApi, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + return self._default_server_oapg( + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + def get( + self: BaseApi, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + return self._default_server_oapg( + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/default/get.pyi b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/default/get.pyi new file mode 100644 index 000000000000..80aebb29e2d4 --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/default/get.pyi @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from dynamic_servers import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from dynamic_servers import schemas # noqa: F401 + +SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + + def _default_server_oapg( + self: api_client.Api, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Use default server + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path.value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response + + +class DefaultServer(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + def default_server( + self: BaseApi, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + return self._default_server_oapg( + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + def get( + self: BaseApi, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + return self._default_server_oapg( + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/rest.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/rest.py index 8e5886bb99e7..d1a0e37cb2f6 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/rest.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/rest.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Extension with dynamic servers @@ -7,41 +9,21 @@ Generated by: https://openapi-generator.tech """ - -import io -import json import logging -import re import ssl from urllib.parse import urlencode -from urllib.parse import urlparse -from urllib.request import proxy_bypass_environment +import typing + +import certifi import urllib3 -import ipaddress +from urllib3._collections import HTTPHeaderDict -from dynamic_servers.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError +from dynamic_servers.exceptions import ApiException, 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): @@ -57,6 +39,13 @@ def __init__(self, configuration, pools_size=4, maxsize=None): else: cert_reqs = ssl.CERT_NONE + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + addition_pool_args = {} if configuration.assert_hostname is not None: addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 @@ -74,13 +63,12 @@ def __init__(self, configuration, pools_size=4, maxsize=None): maxsize = 4 # https pool manager - if configuration.proxy and not should_bypass_proxies( - configuration.host, no_proxy=configuration.no_proxy or ''): + if configuration.proxy: self.pool_manager = urllib3.ProxyManager( num_pools=pools_size, maxsize=maxsize, cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, + ca_certs=ca_certs, cert_file=configuration.cert_file, key_file=configuration.key_file, proxy_url=configuration.proxy, @@ -92,79 +80,75 @@ def __init__(self, configuration, pools_size=4, maxsize=None): num_pools=pools_size, maxsize=maxsize, cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, + ca_certs=ca_certs, 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): + def request( + self, + method: str, + url: str, + headers: typing.Optional[HTTPHeaderDict] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, typing.Any], ...]] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: """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. + :param body: request body, for other types + :param fields: request parameters for + `application/x-www-form-urlencoded` + or `multipart/form-data` + :param stream: if True, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is False. + :param 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: + if fields and body: raise ApiValueError( - "body parameter cannot be used with post_params parameter." + "body parameter cannot be used with fields parameter." ) - post_params = post_params or {} + fields = fields or {} headers = headers or {} - 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]) + if timeout: + if isinstance(timeout, (int, float)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=timeout) + elif (isinstance(timeout, tuple) and + len(timeout) == 2): + timeout = urllib3.Timeout(connect=timeout[0], read=timeout[1]) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != 'DELETE') and ('Content-Type' not in headers): - headers['Content-Type'] = 'application/json' - if query_params: - url += '?' + urlencode(query_params) - if ('Content-Type' not in headers) or (re.search('json', - headers['Content-Type'], re.IGNORECASE)): - request_body = None - if body is not None: - request_body = json.dumps(body) + if 'Content-Type' not in headers and body is None: r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, + method, + url, + preload_content=not stream, timeout=timeout, - headers=headers) + headers=headers + ) elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 r = self.pool_manager.request( method, url, - fields=post_params, + fields=fields, encode_multipart=False, - preload_content=_preload_content, + preload_content=not stream, timeout=timeout, headers=headers) elif headers['Content-Type'] == 'multipart/form-data': @@ -174,9 +158,9 @@ def request(self, method, url, query_params=None, headers=None, del headers['Content-Type'] r = self.pool_manager.request( method, url, - fields=post_params, + fields=fields, encode_multipart=True, - preload_content=_preload_content, + preload_content=not stream, timeout=timeout, headers=headers) # Pass a `string` parameter directly in the body to support @@ -187,7 +171,7 @@ def request(self, method, url, query_params=None, headers=None, r = self.pool_manager.request( method, url, body=request_body, - preload_content=_preload_content, + preload_content=not stream, timeout=timeout, headers=headers) else: @@ -199,154 +183,71 @@ def request(self, method, url, query_params=None, headers=None, # For `GET`, `HEAD` else: r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, + preload_content=not stream, 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) - + if not stream: # 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(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): + def GET(self, url, headers=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: return self.request("GET", url, headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) + stream=stream, + timeout=timeout, + fields=fields) - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): + def HEAD(self, url, headers=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: return self.request("HEAD", url, headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) + stream=stream, + timeout=timeout, + fields=fields) - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): + def OPTIONS(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: 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(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def DELETE(self, url, headers=None, body=None, + stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: return self.request("DELETE", url, headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + stream=stream, + timeout=timeout, + body=body, fields=fields) - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): + def POST(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: 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(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def PUT(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: 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(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def PATCH(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: 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) - -# end of class RESTClientObject - - -def is_ipv4(target): - """ Test if IPv4 address or not - """ - try: - chk = ipaddress.IPv4Address(target) - return True - except ipaddress.AddressValueError: - return False - - -def in_ipv4net(target, net): - """ Test if target belongs to given IPv4 network - """ - try: - nw = ipaddress.IPv4Network(net) - ip = ipaddress.IPv4Address(target) - if ip in nw: - return True - return False - except ipaddress.AddressValueError: - return False - except ipaddress.NetmaskValueError: - return False - - -def should_bypass_proxies(url, no_proxy=None): - """ Yet another requests.should_bypass_proxies - Test if proxies should not be used for a particular url. - """ - - parsed = urlparse(url) - - # special cases - if parsed.hostname in [None, '']: - return True - - # special cases - if no_proxy in [None, '']: - return False - if no_proxy == '*': - return True - - no_proxy = no_proxy.lower().replace(' ', ''); - entries = ( - host for host in no_proxy.split(',') if host - ) - - if is_ipv4(parsed.hostname): - for item in entries: - if in_ipv4net(parsed.hostname, item): - return True - return proxy_bypass_environment(parsed.hostname, {'no': no_proxy}) + stream=stream, + timeout=timeout, + body=body, fields=fields) diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/schemas.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/schemas.py new file mode 100644 index 000000000000..488aee6068f8 --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/schemas.py @@ -0,0 +1,2459 @@ +# coding: utf-8 + +""" + OpenAPI Extension with dynamic servers + + This specification shows how to use dynamic servers. # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +from collections import defaultdict +from datetime import date, datetime, timedelta # noqa: F401 +import functools +import decimal +import io +import re +import types +import typing +import uuid + +from dateutil.parser.isoparser import isoparser, _takes_ascii +import frozendict + +from dynamic_servers.exceptions import ( + ApiTypeError, + ApiValueError, +) +from dynamic_servers.configuration import ( + Configuration, +) + + +class Unset(object): + """ + An instance of this class is set as the default value for object type(dict) properties that are optional + When a property has an unset value, that property will not be assigned in the dict + """ + pass + +unset = Unset() + +none_type = type(None) +file_type = io.IOBase + + +class FileIO(io.FileIO): + """ + A class for storing files + Note: this class is not immutable + """ + + def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader]): + if isinstance(arg, (io.FileIO, io.BufferedReader)): + if arg.closed: + raise ApiValueError('Invalid file state; file is closed and must be open') + arg.close() + inst = super(FileIO, cls).__new__(cls, arg.name) + super(FileIO, inst).__init__(arg.name) + return inst + raise ApiValueError('FileIO must be passed arg which contains the open file') + + def __init__(self, arg: typing.Union[io.FileIO, io.BufferedReader]): + pass + + +def update(d: dict, u: dict): + """ + Adds u to d + Where each dict is defaultdict(set) + """ + if not u: + return d + for k, v in u.items(): + if k not in d: + d[k] = v + else: + d[k] = d[k] | v + + +class ValidationMetadata(frozendict.frozendict): + """ + A class storing metadata that is needed to validate OpenApi Schema payloads + """ + def __new__( + cls, + path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), + from_server: bool = False, + configuration: typing.Optional[Configuration] = None, + seen_classes: typing.FrozenSet[typing.Type] = frozenset(), + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]] = frozendict.frozendict() + ): + """ + Args: + path_to_item: the path to the current data being instantiated. + For {'a': [1]} if the code is handling, 1, then the path is ('args[0]', 'a', 0) + This changes from location to location + from_server: whether or not this data came form the server + True when receiving server data + False when instantiating model with client side data not form the server + This does not change from location to location + configuration: the Configuration instance to use + This is needed because in Configuration: + - one can disable validation checking + This does not change from location to location + seen_classes: when deserializing data that matches multiple schemas, this is used to store + the schemas that have been traversed. This is used to stop processing when a cycle is seen. + This changes from location to location + validated_path_to_schemas: stores the already validated schema classes for a given path location + This does not change from location to location + """ + return super().__new__( + cls, + path_to_item=path_to_item, + from_server=from_server, + configuration=configuration, + seen_classes=seen_classes, + validated_path_to_schemas=validated_path_to_schemas + ) + + def validation_ran_earlier(self, cls: type) -> bool: + validated_schemas = self.validated_path_to_schemas.get(self.path_to_item, set()) + validation_ran_earlier = validated_schemas and cls in validated_schemas + if validation_ran_earlier: + return True + if cls in self.seen_classes: + return True + return False + + @property + def path_to_item(self) -> typing.Tuple[typing.Union[str, int], ...]: + return self.get('path_to_item') + + @property + def from_server(self) -> bool: + return self.get('from_server') + + @property + def configuration(self) -> typing.Optional[Configuration]: + return self.get('configuration') + + @property + def seen_classes(self) -> typing.FrozenSet[typing.Type]: + return self.get('seen_classes') + + @property + def validated_path_to_schemas(self) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Type]]: + return self.get('validated_path_to_schemas') + + +class Singleton: + """ + Enums and singletons are the same + The same instance is returned for a given key of (cls, arg) + """ + _instances = {} + + def __new__(cls, arg: typing.Any, **kwargs): + """ + cls base classes: BoolClass, NoneClass, str, decimal.Decimal + The 3rd key is used in the tuple below for a corner case where an enum contains integer 1 + However 1.0 can also be ingested into that enum schema because 1.0 == 1 and + Decimal('1.0') == Decimal('1') + But if we omitted the 3rd value in the key, then Decimal('1.0') would be stored as Decimal('1') + and json serializing that instance would be '1' rather than the expected '1.0' + Adding the 3rd value, the str of arg ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 + """ + key = (cls, arg, str(arg)) + if key not in cls._instances: + if isinstance(arg, (none_type, bool, BoolClass, NoneClass)): + inst = super().__new__(cls) + cls._instances[key] = inst + else: + cls._instances[key] = super().__new__(cls, arg) + return cls._instances[key] + + def __repr__(self): + if isinstance(self, NoneClass): + return f'<{self.__class__.__name__}: None>' + elif isinstance(self, BoolClass): + if bool(self): + return f'<{self.__class__.__name__}: True>' + return f'<{self.__class__.__name__}: False>' + return f'<{self.__class__.__name__}: {super().__repr__()}>' + + +class classproperty: + + def __init__(self, fget): + self.fget = fget + + def __get__(self, owner_self, owner_cls): + return self.fget(owner_cls) + + +class NoneClass(Singleton): + @classproperty + def NONE(cls): + return cls(None) + + def __bool__(self) -> bool: + return False + + +class BoolClass(Singleton): + @classproperty + def TRUE(cls): + return cls(True) + + @classproperty + def FALSE(cls): + return cls(False) + + @functools.lru_cache() + def __bool__(self) -> bool: + for key, instance in self._instances.items(): + if self is instance: + return bool(key[1]) + raise ValueError('Unable to find the boolean value of this instance') + + +class MetaOapgTyped: + exclusive_maximum: typing.Union[int, float] + inclusive_maximum: typing.Union[int, float] + exclusive_minimum: typing.Union[int, float] + inclusive_minimum: typing.Union[int, float] + max_items: int + min_items: int + discriminator: typing.Dict[str, typing.Dict[str, typing.Type['Schema']]] + + + class properties: + # to hold object properties + pass + + additional_properties: typing.Optional[typing.Type['Schema']] + max_properties: int + min_properties: int + all_of: typing.List[typing.Type['Schema']] + one_of: typing.List[typing.Type['Schema']] + any_of: typing.List[typing.Type['Schema']] + not_schema: typing.Type['Schema'] + max_length: int + min_length: int + items: typing.Type['Schema'] + + +class Schema: + """ + the base class of all swagger/openapi schemas/models + """ + __inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict.frozendict, FileIO, bytes, BoolClass, NoneClass} + _types: typing.Set[typing.Type] + MetaOapg = MetaOapgTyped + + @staticmethod + def __get_valid_classes_phrase(input_classes): + """Returns a string phrase describing what types are allowed""" + all_classes = list(input_classes) + all_classes = sorted(all_classes, key=lambda cls: cls.__name__) + all_class_names = [cls.__name__ for cls in all_classes] + if len(all_class_names) == 1: + return "is {0}".format(all_class_names[0]) + return "is one of [{0}]".format(", ".join(all_class_names)) + + @staticmethod + def _get_class_oapg(item_cls: typing.Union[types.FunctionType, staticmethod, typing.Type['Schema']]) -> typing.Type['Schema']: + if isinstance(item_cls, types.FunctionType): + # referenced schema + return item_cls() + elif isinstance(item_cls, staticmethod): + # referenced schema + return item_cls.__func__() + return item_cls + + @classmethod + def __type_error_message( + cls, var_value=None, var_name=None, valid_classes=None, key_type=None + ): + """ + Keyword Args: + var_value (any): the variable which has the type_error + var_name (str): the name of the variable which has the typ error + valid_classes (tuple): the accepted classes for current_item's + value + 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 tuple + """ + key_or_value = "value" + if key_type: + key_or_value = "key" + valid_classes_phrase = cls.__get_valid_classes_phrase(valid_classes) + msg = "Invalid type. Required {1} type {2} and " "passed type was {3}".format( + var_name, + key_or_value, + valid_classes_phrase, + type(var_value).__name__, + ) + return msg + + @classmethod + def __get_type_error(cls, var_value, path_to_item, valid_classes, key_type=False): + error_msg = cls.__type_error_message( + var_name=path_to_item[-1], + var_value=var_value, + valid_classes=valid_classes, + key_type=key_type, + ) + return ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=valid_classes, + key_type=key_type, + ) + + @classmethod + def _validate_oapg( + cls, + arg, + validation_metadata: ValidationMetadata, + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: + """ + Schema _validate_oapg + All keyword validation except for type checking was done in calling stack frames + If those validations passed, the validated classes are collected in path_to_schemas + + Returns: + path_to_schemas: a map of path to schemas + + Raises: + ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes + ApiTypeError: when the input type is not in the list of allowed spec types + """ + base_class = type(arg) + if base_class not in cls._types: + raise cls.__get_type_error( + arg, + validation_metadata.path_to_item, + cls._types, + key_type=False, + ) + + path_to_schemas = {validation_metadata.path_to_item: set()} + path_to_schemas[validation_metadata.path_to_item].add(cls) + path_to_schemas[validation_metadata.path_to_item].add(base_class) + return path_to_schemas + + @staticmethod + def _process_schema_classes_oapg( + schema_classes: typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]] + ): + """ + Processes and mutates schema_classes + If a SomeSchema is a subclass of DictSchema then remove DictSchema because it is already included + """ + if len(schema_classes) < 2: + return + if len(schema_classes) > 2 and UnsetAnyTypeSchema in schema_classes: + schema_classes.remove(UnsetAnyTypeSchema) + x_schema = schema_type_classes & schema_classes + if not x_schema: + return + x_schema = x_schema.pop() + if any(c is not x_schema and issubclass(c, x_schema) for c in schema_classes): + # needed to not have a mro error in get_new_class + schema_classes.remove(x_schema) + + @classmethod + def __get_new_cls( + cls, + arg, + validation_metadata: ValidationMetadata + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']]: + """ + Make a new dynamic class and return an instance of that class + We are making an instance of cls, but instead of making cls + make a new class, new_cls + which includes dynamic bases including cls + return an instance of that new class + + Dict property + List Item Assignment Use cases: + 1. value is NOT an instance of the required schema class + the value is validated by _validate_oapg + _validate_oapg returns a key value pair + where the key is the path to the item, and the value will be the required manufactured class + made out of the matching schemas + 2. value is an instance of the the correct schema type + the value is NOT validated by _validate_oapg, _validate_oapg only checks that the instance is of the correct schema type + for this value, _validate_oapg does NOT return an entry for it in _path_to_schemas + and in list/dict _get_items_oapg,_get_properties_oapg the value will be directly assigned + because value is of the correct type, and validation was run earlier when the instance was created + """ + _path_to_schemas = {} + if validation_metadata.validated_path_to_schemas: + update(_path_to_schemas, validation_metadata.validated_path_to_schemas) + if not validation_metadata.validation_ran_earlier(cls): + other_path_to_schemas = cls._validate_oapg(arg, validation_metadata=validation_metadata) + update(_path_to_schemas, other_path_to_schemas) + # loop through it make a new class for each entry + # do not modify the returned result because it is cached and we would be modifying the cached value + path_to_schemas = {} + for path, schema_classes in _path_to_schemas.items(): + """ + Use cases + 1. N number of schema classes + enum + type != bool/None, classes in path_to_schemas: tuple/frozendict.frozendict/str/Decimal/bytes/FileIo + needs Singleton added + 2. N number of schema classes + enum + type == bool/None, classes in path_to_schemas: BoolClass/NoneClass + Singleton already added + 3. N number of schema classes, classes in path_to_schemas: BoolClass/NoneClass/tuple/frozendict.frozendict/str/Decimal/bytes/FileIo + """ + cls._process_schema_classes_oapg(schema_classes) + enum_schema = any( + issubclass(this_cls, EnumBase) for this_cls in schema_classes) + inheritable_primitive_type = schema_classes.intersection(cls.__inheritable_primitive_types_set) + chosen_schema_classes = schema_classes - inheritable_primitive_type + suffix = tuple(inheritable_primitive_type) + if enum_schema and suffix[0] not in {NoneClass, BoolClass}: + suffix = (Singleton,) + suffix + + used_classes = tuple(sorted(chosen_schema_classes, key=lambda a_cls: a_cls.__name__)) + suffix + mfg_cls = get_new_class(class_name='DynamicSchema', bases=used_classes) + path_to_schemas[path] = mfg_cls + + return path_to_schemas + + @classmethod + def _get_new_instance_without_conversion_oapg( + cls, + arg: typing.Any, + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + # We have a Dynamic class and we are making an instance of it + if issubclass(cls, frozendict.frozendict) and issubclass(cls, DictBase): + properties = cls._get_properties_oapg(arg, path_to_item, path_to_schemas) + return super(Schema, cls).__new__(cls, properties) + elif issubclass(cls, tuple) and issubclass(cls, ListBase): + items = cls._get_items_oapg(arg, path_to_item, path_to_schemas) + return super(Schema, cls).__new__(cls, items) + """ + str = openapi str, date, and datetime + decimal.Decimal = openapi int and float + FileIO = openapi binary type and the user inputs a file + bytes = openapi binary type and the user inputs bytes + """ + return super(Schema, cls).__new__(cls, arg) + + @classmethod + def from_openapi_data_oapg( + cls, + arg: typing.Union[ + str, + date, + datetime, + int, + float, + decimal.Decimal, + bool, + None, + 'Schema', + dict, + frozendict.frozendict, + tuple, + list, + io.FileIO, + io.BufferedReader, + bytes + ], + _configuration: typing.Optional[Configuration] + ): + """ + Schema from_openapi_data_oapg + """ + from_server = True + validated_path_to_schemas = {} + arg = cast_to_allowed_types(arg, from_server, validated_path_to_schemas) + validation_metadata = ValidationMetadata( + from_server=from_server, configuration=_configuration, validated_path_to_schemas=validated_path_to_schemas) + path_to_schemas = cls.__get_new_cls(arg, validation_metadata) + new_cls = path_to_schemas[validation_metadata.path_to_item] + new_inst = new_cls._get_new_instance_without_conversion_oapg( + arg, + validation_metadata.path_to_item, + path_to_schemas + ) + return new_inst + + @staticmethod + def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: + input_dict = {} + if args and isinstance(args[0], (dict, frozendict.frozendict)): + input_dict.update(args[0]) + if kwargs: + input_dict.update(kwargs) + return frozendict.frozendict(input_dict) + + @staticmethod + def __remove_unsets(kwargs): + return {key: val for key, val in kwargs.items() if val is not unset} + + def __new__(cls, *args: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): + """ + Schema __new__ + + Args: + args (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value + kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): dict values + _configuration: contains the Configuration that enables json schema validation keywords + like minItems, minLength etc + + Note: double underscores are used here because pycharm thinks that these variables + are instance properties if they are named normally :( + """ + __kwargs = cls.__remove_unsets(kwargs) + if not args and not __kwargs: + raise TypeError( + 'No input given. args or kwargs must be given.' + ) + if not __kwargs and args and not isinstance(args[0], dict): + __arg = args[0] + else: + __arg = cls.__get_input_dict(*args, **__kwargs) + __from_server = False + __validated_path_to_schemas = {} + __arg = cast_to_allowed_types( + __arg, __from_server, __validated_path_to_schemas) + __validation_metadata = ValidationMetadata( + configuration=_configuration, from_server=__from_server, validated_path_to_schemas=__validated_path_to_schemas) + __path_to_schemas = cls.__get_new_cls(__arg, __validation_metadata) + __new_cls = __path_to_schemas[__validation_metadata.path_to_item] + return __new_cls._get_new_instance_without_conversion_oapg( + __arg, + __validation_metadata.path_to_item, + __path_to_schemas + ) + + def __init__( + self, + *args: typing.Union[ + dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], + _configuration: typing.Optional[Configuration] = None, + **kwargs: typing.Union[ + dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset + ] + ): + """ + this is needed to fix 'Unexpected argument' warning in pycharm + this code does nothing because all Schema instances are immutable + this means that all input data is passed into and used in new, and after the new instance is made + no new attributes are assigned and init is not used + """ + pass + +""" +import itertools +data_types = ('None', 'FrozenDict', 'Tuple', 'Str', 'Decimal', 'Bool') +type_to_cls = { + 'None': 'NoneClass', + 'FrozenDict': 'frozendict.frozendict', + 'Tuple': 'tuple', + 'Str': 'str', + 'Decimal': 'decimal.Decimal', + 'Bool': 'BoolClass' +} +cls_tuples = [v for v in itertools.combinations(data_types, 5)] +typed_classes = [f"class {''.join(cls_tuple)}Mixin({', '.join(type_to_cls[typ] for typ in cls_tuple)}):\n pass" for cls_tuple in cls_tuples] +for cls in typed_classes: + print(cls) +object_classes = [f"{''.join(cls_tuple)}Mixin = object" for cls_tuple in cls_tuples] +for cls in object_classes: + print(cls) +""" +if typing.TYPE_CHECKING: + # qty 1 + NoneMixin = NoneClass + FrozenDictMixin = frozendict.frozendict + TupleMixin = tuple + StrMixin = str + DecimalMixin = decimal.Decimal + BoolMixin = BoolClass + BytesMixin = bytes + FileMixin = FileIO + # qty 2 + class BinaryMixin(bytes, FileIO): + pass + class NoneFrozenDictMixin(NoneClass, frozendict.frozendict): + pass + class NoneTupleMixin(NoneClass, tuple): + pass + class NoneStrMixin(NoneClass, str): + pass + class NoneDecimalMixin(NoneClass, decimal.Decimal): + pass + class NoneBoolMixin(NoneClass, BoolClass): + pass + class FrozenDictTupleMixin(frozendict.frozendict, tuple): + pass + class FrozenDictStrMixin(frozendict.frozendict, str): + pass + class FrozenDictDecimalMixin(frozendict.frozendict, decimal.Decimal): + pass + class FrozenDictBoolMixin(frozendict.frozendict, BoolClass): + pass + class TupleStrMixin(tuple, str): + pass + class TupleDecimalMixin(tuple, decimal.Decimal): + pass + class TupleBoolMixin(tuple, BoolClass): + pass + class StrDecimalMixin(str, decimal.Decimal): + pass + class StrBoolMixin(str, BoolClass): + pass + class DecimalBoolMixin(decimal.Decimal, BoolClass): + pass + # qty 3 + class NoneFrozenDictTupleMixin(NoneClass, frozendict.frozendict, tuple): + pass + class NoneFrozenDictStrMixin(NoneClass, frozendict.frozendict, str): + pass + class NoneFrozenDictDecimalMixin(NoneClass, frozendict.frozendict, decimal.Decimal): + pass + class NoneFrozenDictBoolMixin(NoneClass, frozendict.frozendict, BoolClass): + pass + class NoneTupleStrMixin(NoneClass, tuple, str): + pass + class NoneTupleDecimalMixin(NoneClass, tuple, decimal.Decimal): + pass + class NoneTupleBoolMixin(NoneClass, tuple, BoolClass): + pass + class NoneStrDecimalMixin(NoneClass, str, decimal.Decimal): + pass + class NoneStrBoolMixin(NoneClass, str, BoolClass): + pass + class NoneDecimalBoolMixin(NoneClass, decimal.Decimal, BoolClass): + pass + class FrozenDictTupleStrMixin(frozendict.frozendict, tuple, str): + pass + class FrozenDictTupleDecimalMixin(frozendict.frozendict, tuple, decimal.Decimal): + pass + class FrozenDictTupleBoolMixin(frozendict.frozendict, tuple, BoolClass): + pass + class FrozenDictStrDecimalMixin(frozendict.frozendict, str, decimal.Decimal): + pass + class FrozenDictStrBoolMixin(frozendict.frozendict, str, BoolClass): + pass + class FrozenDictDecimalBoolMixin(frozendict.frozendict, decimal.Decimal, BoolClass): + pass + class TupleStrDecimalMixin(tuple, str, decimal.Decimal): + pass + class TupleStrBoolMixin(tuple, str, BoolClass): + pass + class TupleDecimalBoolMixin(tuple, decimal.Decimal, BoolClass): + pass + class StrDecimalBoolMixin(str, decimal.Decimal, BoolClass): + pass + # qty 4 + class NoneFrozenDictTupleStrMixin(NoneClass, frozendict.frozendict, tuple, str): + pass + class NoneFrozenDictTupleDecimalMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal): + pass + class NoneFrozenDictTupleBoolMixin(NoneClass, frozendict.frozendict, tuple, BoolClass): + pass + class NoneFrozenDictStrDecimalMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal): + pass + class NoneFrozenDictStrBoolMixin(NoneClass, frozendict.frozendict, str, BoolClass): + pass + class NoneFrozenDictDecimalBoolMixin(NoneClass, frozendict.frozendict, decimal.Decimal, BoolClass): + pass + class NoneTupleStrDecimalMixin(NoneClass, tuple, str, decimal.Decimal): + pass + class NoneTupleStrBoolMixin(NoneClass, tuple, str, BoolClass): + pass + class NoneTupleDecimalBoolMixin(NoneClass, tuple, decimal.Decimal, BoolClass): + pass + class NoneStrDecimalBoolMixin(NoneClass, str, decimal.Decimal, BoolClass): + pass + class FrozenDictTupleStrDecimalMixin(frozendict.frozendict, tuple, str, decimal.Decimal): + pass + class FrozenDictTupleStrBoolMixin(frozendict.frozendict, tuple, str, BoolClass): + pass + class FrozenDictTupleDecimalBoolMixin(frozendict.frozendict, tuple, decimal.Decimal, BoolClass): + pass + class FrozenDictStrDecimalBoolMixin(frozendict.frozendict, str, decimal.Decimal, BoolClass): + pass + class TupleStrDecimalBoolMixin(tuple, str, decimal.Decimal, BoolClass): + pass + # qty 5 + class NoneFrozenDictTupleStrDecimalMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal): + pass + class NoneFrozenDictTupleStrBoolMixin(NoneClass, frozendict.frozendict, tuple, str, BoolClass): + pass + class NoneFrozenDictTupleDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, decimal.Decimal, BoolClass): + pass + class NoneFrozenDictStrDecimalBoolMixin(NoneClass, frozendict.frozendict, str, decimal.Decimal, BoolClass): + pass + class NoneTupleStrDecimalBoolMixin(NoneClass, tuple, str, decimal.Decimal, BoolClass): + pass + class FrozenDictTupleStrDecimalBoolMixin(frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): + pass + # qty 6 + class NoneFrozenDictTupleStrDecimalBoolMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass): + pass + # qty 8 + class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin(NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, FileIO, bytes): + pass +else: + # qty 1 + class NoneMixin: + _types = {NoneClass} + class FrozenDictMixin: + _types = {frozendict.frozendict} + class TupleMixin: + _types = {tuple} + class StrMixin: + _types = {str} + class DecimalMixin: + _types = {decimal.Decimal} + class BoolMixin: + _types = {BoolClass} + class BytesMixin: + _types = {bytes} + class FileMixin: + _types = {FileIO} + # qty 2 + class BinaryMixin: + _types = {bytes, FileIO} + class NoneFrozenDictMixin: + _types = {NoneClass, frozendict.frozendict} + class NoneTupleMixin: + _types = {NoneClass, tuple} + class NoneStrMixin: + _types = {NoneClass, str} + class NoneDecimalMixin: + _types = {NoneClass, decimal.Decimal} + class NoneBoolMixin: + _types = {NoneClass, BoolClass} + class FrozenDictTupleMixin: + _types = {frozendict.frozendict, tuple} + class FrozenDictStrMixin: + _types = {frozendict.frozendict, str} + class FrozenDictDecimalMixin: + _types = {frozendict.frozendict, decimal.Decimal} + class FrozenDictBoolMixin: + _types = {frozendict.frozendict, BoolClass} + class TupleStrMixin: + _types = {tuple, str} + class TupleDecimalMixin: + _types = {tuple, decimal.Decimal} + class TupleBoolMixin: + _types = {tuple, BoolClass} + class StrDecimalMixin: + _types = {str, decimal.Decimal} + class StrBoolMixin: + _types = {str, BoolClass} + class DecimalBoolMixin: + _types = {decimal.Decimal, BoolClass} + # qty 3 + class NoneFrozenDictTupleMixin: + _types = {NoneClass, frozendict.frozendict, tuple} + class NoneFrozenDictStrMixin: + _types = {NoneClass, frozendict.frozendict, str} + class NoneFrozenDictDecimalMixin: + _types = {NoneClass, frozendict.frozendict, decimal.Decimal} + class NoneFrozenDictBoolMixin: + _types = {NoneClass, frozendict.frozendict, BoolClass} + class NoneTupleStrMixin: + _types = {NoneClass, tuple, str} + class NoneTupleDecimalMixin: + _types = {NoneClass, tuple, decimal.Decimal} + class NoneTupleBoolMixin: + _types = {NoneClass, tuple, BoolClass} + class NoneStrDecimalMixin: + _types = {NoneClass, str, decimal.Decimal} + class NoneStrBoolMixin: + _types = {NoneClass, str, BoolClass} + class NoneDecimalBoolMixin: + _types = {NoneClass, decimal.Decimal, BoolClass} + class FrozenDictTupleStrMixin: + _types = {frozendict.frozendict, tuple, str} + class FrozenDictTupleDecimalMixin: + _types = {frozendict.frozendict, tuple, decimal.Decimal} + class FrozenDictTupleBoolMixin: + _types = {frozendict.frozendict, tuple, BoolClass} + class FrozenDictStrDecimalMixin: + _types = {frozendict.frozendict, str, decimal.Decimal} + class FrozenDictStrBoolMixin: + _types = {frozendict.frozendict, str, BoolClass} + class FrozenDictDecimalBoolMixin: + _types = {frozendict.frozendict, decimal.Decimal, BoolClass} + class TupleStrDecimalMixin: + _types = {tuple, str, decimal.Decimal} + class TupleStrBoolMixin: + _types = {tuple, str, BoolClass} + class TupleDecimalBoolMixin: + _types = {tuple, decimal.Decimal, BoolClass} + class StrDecimalBoolMixin: + _types = {str, decimal.Decimal, BoolClass} + # qty 4 + class NoneFrozenDictTupleStrMixin: + _types = {NoneClass, frozendict.frozendict, tuple, str} + class NoneFrozenDictTupleDecimalMixin: + _types = {NoneClass, frozendict.frozendict, tuple, decimal.Decimal} + class NoneFrozenDictTupleBoolMixin: + _types = {NoneClass, frozendict.frozendict, tuple, BoolClass} + class NoneFrozenDictStrDecimalMixin: + _types = {NoneClass, frozendict.frozendict, str, decimal.Decimal} + class NoneFrozenDictStrBoolMixin: + _types = {NoneClass, frozendict.frozendict, str, BoolClass} + class NoneFrozenDictDecimalBoolMixin: + _types = {NoneClass, frozendict.frozendict, decimal.Decimal, BoolClass} + class NoneTupleStrDecimalMixin: + _types = {NoneClass, tuple, str, decimal.Decimal} + class NoneTupleStrBoolMixin: + _types = {NoneClass, tuple, str, BoolClass} + class NoneTupleDecimalBoolMixin: + _types = {NoneClass, tuple, decimal.Decimal, BoolClass} + class NoneStrDecimalBoolMixin: + _types = {NoneClass, str, decimal.Decimal, BoolClass} + class FrozenDictTupleStrDecimalMixin: + _types = {frozendict.frozendict, tuple, str, decimal.Decimal} + class FrozenDictTupleStrBoolMixin: + _types = {frozendict.frozendict, tuple, str, BoolClass} + class FrozenDictTupleDecimalBoolMixin: + _types = {frozendict.frozendict, tuple, decimal.Decimal, BoolClass} + class FrozenDictStrDecimalBoolMixin: + _types = {frozendict.frozendict, str, decimal.Decimal, BoolClass} + class TupleStrDecimalBoolMixin: + _types = {tuple, str, decimal.Decimal, BoolClass} + # qty 5 + class NoneFrozenDictTupleStrDecimalMixin: + _types = {NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal} + class NoneFrozenDictTupleStrBoolMixin: + _types = {NoneClass, frozendict.frozendict, tuple, str, BoolClass} + class NoneFrozenDictTupleDecimalBoolMixin: + _types = {NoneClass, frozendict.frozendict, tuple, decimal.Decimal, BoolClass} + class NoneFrozenDictStrDecimalBoolMixin: + _types = {NoneClass, frozendict.frozendict, str, decimal.Decimal, BoolClass} + class NoneTupleStrDecimalBoolMixin: + _types = {NoneClass, tuple, str, decimal.Decimal, BoolClass} + class FrozenDictTupleStrDecimalBoolMixin: + _types = {frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass} + # qty 6 + class NoneFrozenDictTupleStrDecimalBoolMixin: + _types = {NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass} + # qty 8 + class NoneFrozenDictTupleStrDecimalBoolFileBytesMixin: + _types = {NoneClass, frozendict.frozendict, tuple, str, decimal.Decimal, BoolClass, FileIO, bytes} + + +class ValidatorBase: + @staticmethod + def _is_json_validation_enabled_oapg(schema_keyword, configuration=None): + """Returns true if JSON schema validation is enabled for the specified + validation keyword. This can be used to skip JSON schema structural validation + as requested in the configuration. + Note: the suffix _oapg stands for openapi python (experimental) generator and + it has been added to prevent collisions with other methods and properties + + Args: + schema_keyword (string): the name of a JSON schema validation keyword. + configuration (Configuration): the configuration class. + """ + + return (configuration is None or + not hasattr(configuration, '_disabled_client_side_validations') or + schema_keyword not in configuration._disabled_client_side_validations) + + @staticmethod + def _raise_validation_errror_message_oapg(value, constraint_msg, constraint_value, path_to_item, additional_txt=""): + raise ApiValueError( + "Invalid value `{value}`, {constraint_msg} `{constraint_value}`{additional_txt} at {path_to_item}".format( + value=value, + constraint_msg=constraint_msg, + constraint_value=constraint_value, + additional_txt=additional_txt, + path_to_item=path_to_item, + ) + ) + + +class EnumBase: + @classmethod + def _validate_oapg( + cls, + arg, + validation_metadata: ValidationMetadata, + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: + """ + EnumBase _validate_oapg + Validates that arg is in the enum's allowed values + """ + try: + cls.MetaOapg.enum_value_to_name[arg] + except KeyError: + raise ApiValueError("Invalid value {} passed in to {}, allowed_values={}".format(arg, cls, cls.MetaOapg.enum_value_to_name.keys())) + return super()._validate_oapg(arg, validation_metadata=validation_metadata) + + +class BoolBase: + def is_true_oapg(self) -> bool: + """ + A replacement for x is True + True if the instance is a BoolClass True Singleton + """ + if not issubclass(self.__class__, BoolClass): + return False + return bool(self) + + def is_false_oapg(self) -> bool: + """ + A replacement for x is False + True if the instance is a BoolClass False Singleton + """ + if not issubclass(self.__class__, BoolClass): + return False + return bool(self) is False + + +class NoneBase: + def is_none_oapg(self) -> bool: + """ + A replacement for x is None + True if the instance is a NoneClass None Singleton + """ + if issubclass(self.__class__, NoneClass): + return True + return False + + +class StrBase(ValidatorBase): + MetaOapg: MetaOapgTyped + + @property + def as_str_oapg(self) -> str: + return self + + @property + def as_date_oapg(self) -> date: + raise Exception('not implemented') + + @property + def as_datetime_oapg(self) -> datetime: + raise Exception('not implemented') + + @property + def as_decimal_oapg(self) -> decimal.Decimal: + raise Exception('not implemented') + + @property + def as_uuid_oapg(self) -> uuid.UUID: + raise Exception('not implemented') + + @classmethod + def __check_str_validations( + cls, + arg: str, + validation_metadata: ValidationMetadata + ): + if not hasattr(cls, 'MetaOapg'): + return + if (cls._is_json_validation_enabled_oapg('maxLength', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'max_length') and + len(arg) > cls.MetaOapg.max_length): + cls._raise_validation_errror_message_oapg( + value=arg, + constraint_msg="length must be less than or equal to", + constraint_value=cls.MetaOapg.max_length, + path_to_item=validation_metadata.path_to_item + ) + + if (cls._is_json_validation_enabled_oapg('minLength', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'min_length') and + len(arg) < cls.MetaOapg.min_length): + cls._raise_validation_errror_message_oapg( + value=arg, + constraint_msg="length must be greater than or equal to", + constraint_value=cls.MetaOapg.min_length, + path_to_item=validation_metadata.path_to_item + ) + + if (cls._is_json_validation_enabled_oapg('pattern', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'regex')): + for regex_dict in cls.MetaOapg.regex: + flags = regex_dict.get('flags', 0) + if not re.search(regex_dict['pattern'], arg, flags=flags): + if flags != 0: + # Don't print the regex flags if the flags are not + # specified in the OAS document. + cls._raise_validation_errror_message_oapg( + value=arg, + constraint_msg="must match regular expression", + constraint_value=regex_dict['pattern'], + path_to_item=validation_metadata.path_to_item, + additional_txt=" with flags=`{}`".format(flags) + ) + cls._raise_validation_errror_message_oapg( + value=arg, + constraint_msg="must match regular expression", + constraint_value=regex_dict['pattern'], + path_to_item=validation_metadata.path_to_item + ) + + @classmethod + def _validate_oapg( + cls, + arg, + validation_metadata: ValidationMetadata, + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: + """ + StrBase _validate_oapg + Validates that validations pass + """ + if isinstance(arg, str): + cls.__check_str_validations(arg, validation_metadata) + return super()._validate_oapg(arg, validation_metadata=validation_metadata) + + +class UUIDBase: + @property + @functools.lru_cache() + def as_uuid_oapg(self) -> uuid.UUID: + return uuid.UUID(self) + + @classmethod + def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): + if isinstance(arg, str): + try: + uuid.UUID(arg) + return True + except ValueError: + raise ApiValueError( + "Invalid value '{}' for type UUID at {}".format(arg, validation_metadata.path_to_item) + ) + + @classmethod + def _validate_oapg( + cls, + arg, + validation_metadata: typing.Optional[ValidationMetadata] = None, + ): + """ + UUIDBase _validate_oapg + """ + cls.__validate_format(arg, validation_metadata=validation_metadata) + return super()._validate_oapg(arg, validation_metadata=validation_metadata) + + +class CustomIsoparser(isoparser): + + @_takes_ascii + def parse_isodatetime(self, dt_str): + components, pos = self._parse_isodate(dt_str) + if len(dt_str) > pos: + if self._sep is None or dt_str[pos:pos + 1] == self._sep: + components += self._parse_isotime(dt_str[pos + 1:]) + else: + raise ValueError('String contains unknown ISO components') + + if len(components) > 3 and components[3] == 24: + components[3] = 0 + return datetime(*components) + timedelta(days=1) + + if len(components) <= 3: + raise ValueError('Value is not a datetime') + + return datetime(*components) + + @_takes_ascii + def parse_isodate(self, datestr): + components, pos = self._parse_isodate(datestr) + + if len(datestr) > pos: + raise ValueError('String contains invalid time components') + + if len(components) > 3: + raise ValueError('String contains invalid time components') + + return date(*components) + + +DEFAULT_ISOPARSER = CustomIsoparser() + + +class DateBase: + @property + @functools.lru_cache() + def as_date_oapg(self) -> date: + return DEFAULT_ISOPARSER.parse_isodate(self) + + @classmethod + def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): + if isinstance(arg, str): + try: + DEFAULT_ISOPARSER.parse_isodate(arg) + return True + except ValueError: + raise ApiValueError( + "Value does not conform to the required ISO-8601 date format. " + "Invalid value '{}' for type date at {}".format(arg, validation_metadata.path_to_item) + ) + + @classmethod + def _validate_oapg( + cls, + arg, + validation_metadata: typing.Optional[ValidationMetadata] = None, + ): + """ + DateBase _validate_oapg + """ + cls.__validate_format(arg, validation_metadata=validation_metadata) + return super()._validate_oapg(arg, validation_metadata=validation_metadata) + + +class DateTimeBase: + @property + @functools.lru_cache() + def as_datetime_oapg(self) -> datetime: + return DEFAULT_ISOPARSER.parse_isodatetime(self) + + @classmethod + def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): + if isinstance(arg, str): + try: + DEFAULT_ISOPARSER.parse_isodatetime(arg) + return True + except ValueError: + raise ApiValueError( + "Value does not conform to the required ISO-8601 datetime format. " + "Invalid value '{}' for type datetime at {}".format(arg, validation_metadata.path_to_item) + ) + + @classmethod + def _validate_oapg( + cls, + arg, + validation_metadata: ValidationMetadata, + ): + """ + DateTimeBase _validate_oapg + """ + cls.__validate_format(arg, validation_metadata=validation_metadata) + return super()._validate_oapg(arg, validation_metadata=validation_metadata) + + +class DecimalBase: + """ + A class for storing decimals that are sent over the wire as strings + These schemas must remain based on StrBase rather than NumberBase + because picking base classes must be deterministic + """ + + @property + @functools.lru_cache() + def as_decimal_oapg(self) -> decimal.Decimal: + return decimal.Decimal(self) + + @classmethod + def __validate_format(cls, arg: typing.Optional[str], validation_metadata: ValidationMetadata): + if isinstance(arg, str): + try: + decimal.Decimal(arg) + return True + except decimal.InvalidOperation: + raise ApiValueError( + "Value cannot be converted to a decimal. " + "Invalid value '{}' for type decimal at {}".format(arg, validation_metadata.path_to_item) + ) + + @classmethod + def _validate_oapg( + cls, + arg, + validation_metadata: ValidationMetadata, + ): + """ + DecimalBase _validate_oapg + """ + cls.__validate_format(arg, validation_metadata=validation_metadata) + return super()._validate_oapg(arg, validation_metadata=validation_metadata) + + +class NumberBase(ValidatorBase): + MetaOapg: MetaOapgTyped + + @property + def as_int_oapg(self) -> int: + try: + return self._as_int + except AttributeError: + """ + Note: for some numbers like 9.0 they could be represented as an + integer but our code chooses to store them as + >>> Decimal('9.0').as_tuple() + DecimalTuple(sign=0, digits=(9, 0), exponent=-1) + so we can tell that the value came from a float and convert it back to a float + during later serialization + """ + if self.as_tuple().exponent < 0: + # this could be represented as an integer but should be represented as a float + # because that's what it was serialized from + raise ApiValueError(f'{self} is not an integer') + self._as_int = int(self) + return self._as_int + + @property + def as_float_oapg(self) -> float: + try: + return self._as_float + except AttributeError: + if self.as_tuple().exponent >= 0: + raise ApiValueError(f'{self} is not an float') + self._as_float = float(self) + return self._as_float + + @classmethod + def __check_numeric_validations( + cls, + arg, + validation_metadata: ValidationMetadata + ): + if not hasattr(cls, 'MetaOapg'): + return + if cls._is_json_validation_enabled_oapg('multipleOf', + validation_metadata.configuration) and hasattr(cls.MetaOapg, 'multiple_of'): + multiple_of_value = cls.MetaOapg.multiple_of + if (not (float(arg) / multiple_of_value).is_integer()): + # Note 'multipleOf' will be as good as the floating point arithmetic. + cls._raise_validation_errror_message_oapg( + value=arg, + constraint_msg="value must be a multiple of", + constraint_value=multiple_of_value, + path_to_item=validation_metadata.path_to_item + ) + + checking_max_or_min_values = any( + hasattr(cls.MetaOapg, validation_key) for validation_key in { + 'exclusive_maximum', + 'inclusive_maximum', + 'exclusive_minimum', + 'inclusive_minimum', + } + ) + if not checking_max_or_min_values: + return + + if (cls._is_json_validation_enabled_oapg('exclusiveMaximum', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'exclusive_maximum') and + arg >= cls.MetaOapg.exclusive_maximum): + cls._raise_validation_errror_message_oapg( + value=arg, + constraint_msg="must be a value less than", + constraint_value=cls.MetaOapg.exclusive_maximum, + path_to_item=validation_metadata.path_to_item + ) + + if (cls._is_json_validation_enabled_oapg('maximum', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'inclusive_maximum') and + arg > cls.MetaOapg.inclusive_maximum): + cls._raise_validation_errror_message_oapg( + value=arg, + constraint_msg="must be a value less than or equal to", + constraint_value=cls.MetaOapg.inclusive_maximum, + path_to_item=validation_metadata.path_to_item + ) + + if (cls._is_json_validation_enabled_oapg('exclusiveMinimum', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'exclusive_minimum') and + arg <= cls.MetaOapg.exclusive_minimum): + cls._raise_validation_errror_message_oapg( + value=arg, + constraint_msg="must be a value greater than", + constraint_value=cls.MetaOapg.exclusive_maximum, + path_to_item=validation_metadata.path_to_item + ) + + if (cls._is_json_validation_enabled_oapg('minimum', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'inclusive_minimum') and + arg < cls.MetaOapg.inclusive_minimum): + cls._raise_validation_errror_message_oapg( + value=arg, + constraint_msg="must be a value greater than or equal to", + constraint_value=cls.MetaOapg.inclusive_minimum, + path_to_item=validation_metadata.path_to_item + ) + + @classmethod + def _validate_oapg( + cls, + arg, + validation_metadata: ValidationMetadata, + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: + """ + NumberBase _validate_oapg + Validates that validations pass + """ + if isinstance(arg, decimal.Decimal): + cls.__check_numeric_validations(arg, validation_metadata) + return super()._validate_oapg(arg, validation_metadata=validation_metadata) + + +class ListBase(ValidatorBase): + MetaOapg: MetaOapgTyped + + @classmethod + def __validate_items(cls, list_items, validation_metadata: ValidationMetadata): + """ + Ensures that: + - values passed in for items are valid + Exceptions will be raised if: + - invalid arguments were passed in + + Args: + list_items: the input list of items + + Raises: + ApiTypeError - for missing required arguments, or for invalid properties + """ + + # if we have definitions for an items schema, use it + # otherwise accept anything + item_cls = getattr(cls.MetaOapg, 'items', UnsetAnyTypeSchema) + item_cls = cls._get_class_oapg(item_cls) + path_to_schemas = {} + for i, value in enumerate(list_items): + item_validation_metadata = ValidationMetadata( + from_server=validation_metadata.from_server, + configuration=validation_metadata.configuration, + path_to_item=validation_metadata.path_to_item+(i,), + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + if item_validation_metadata.validation_ran_earlier(item_cls): + continue + other_path_to_schemas = item_cls._validate_oapg( + value, validation_metadata=item_validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + @classmethod + def __check_tuple_validations( + cls, arg, + validation_metadata: ValidationMetadata): + if not hasattr(cls, 'MetaOapg'): + return + if (cls._is_json_validation_enabled_oapg('maxItems', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'max_items') and + len(arg) > cls.MetaOapg.max_items): + cls._raise_validation_errror_message_oapg( + value=arg, + constraint_msg="number of items must be less than or equal to", + constraint_value=cls.MetaOapg.max_items, + path_to_item=validation_metadata.path_to_item + ) + + if (cls._is_json_validation_enabled_oapg('minItems', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'min_items') and + len(arg) < cls.MetaOapg.min_items): + cls._raise_validation_errror_message_oapg( + value=arg, + constraint_msg="number of items must be greater than or equal to", + constraint_value=cls.MetaOapg.min_items, + path_to_item=validation_metadata.path_to_item + ) + + if (cls._is_json_validation_enabled_oapg('uniqueItems', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'unique_items') and cls.MetaOapg.unique_items and arg): + unique_items = set(arg) + if len(arg) > len(unique_items): + cls._raise_validation_errror_message_oapg( + value=arg, + constraint_msg="duplicate items were found, and the tuple must not contain duplicates because", + constraint_value='unique_items==True', + path_to_item=validation_metadata.path_to_item + ) + + @classmethod + def _validate_oapg( + cls, + arg, + validation_metadata: ValidationMetadata, + ): + """ + ListBase _validate_oapg + We return dynamic classes of different bases depending upon the inputs + This makes it so: + - the returned instance is always a subclass of our defining schema + - this allows us to check type based on whether an instance is a subclass of a schema + - the returned instance is a serializable type (except for None, True, and False) which are enums + + Returns: + new_cls (type): the new class + + Raises: + ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes + ApiTypeError: when the input type is not in the list of allowed spec types + """ + if isinstance(arg, tuple): + cls.__check_tuple_validations(arg, validation_metadata) + _path_to_schemas = super()._validate_oapg(arg, validation_metadata=validation_metadata) + if not isinstance(arg, tuple): + return _path_to_schemas + updated_vm = ValidationMetadata( + configuration=validation_metadata.configuration, + from_server=validation_metadata.from_server, + path_to_item=validation_metadata.path_to_item, + seen_classes=validation_metadata.seen_classes | frozenset({cls}), + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + other_path_to_schemas = cls.__validate_items(arg, validation_metadata=updated_vm) + update(_path_to_schemas, other_path_to_schemas) + return _path_to_schemas + + @classmethod + def _get_items_oapg( + cls: 'Schema', + arg: typing.List[typing.Any], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + ''' + ListBase _get_items_oapg + ''' + cast_items = [] + + for i, value in enumerate(arg): + item_path_to_item = path_to_item + (i,) + item_cls = path_to_schemas[item_path_to_item] + new_value = item_cls._get_new_instance_without_conversion_oapg( + value, + item_path_to_item, + path_to_schemas + ) + cast_items.append(new_value) + + return cast_items + + +class Discriminable: + MetaOapg: MetaOapgTyped + + @classmethod + def _ensure_discriminator_value_present_oapg(cls, disc_property_name: str, validation_metadata: ValidationMetadata, *args): + if not args or args and disc_property_name not in args[0]: + # The input data does not contain the discriminator property + raise ApiValueError( + "Cannot deserialize input data due to missing discriminator. " + "The discriminator property '{}' is missing at path: {}".format(disc_property_name, validation_metadata.path_to_item) + ) + + @classmethod + def get_discriminated_class_oapg(cls, disc_property_name: str, disc_payload_value: str): + """ + Used in schemas with discriminators + """ + if not hasattr(cls.MetaOapg, 'discriminator'): + return None + disc = cls.MetaOapg.discriminator() + if disc_property_name not in disc: + return None + discriminated_cls = disc[disc_property_name].get(disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + if not hasattr(cls, 'MetaOapg'): + return None + elif not ( + hasattr(cls.MetaOapg, 'all_of') or + hasattr(cls.MetaOapg, 'one_of') or + hasattr(cls.MetaOapg, 'any_of') + ): + return None + # TODO stop traveling if a cycle is hit + if hasattr(cls.MetaOapg, 'all_of'): + for allof_cls in cls.MetaOapg.all_of(): + discriminated_cls = allof_cls.get_discriminated_class_oapg( + disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + if hasattr(cls.MetaOapg, 'one_of'): + for oneof_cls in cls.MetaOapg.one_of(): + discriminated_cls = oneof_cls.get_discriminated_class_oapg( + disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + if hasattr(cls.MetaOapg, 'any_of'): + for anyof_cls in cls.MetaOapg.any_of(): + discriminated_cls = anyof_cls.get_discriminated_class_oapg( + disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + return None + + +class DictBase(Discriminable, ValidatorBase): + + @classmethod + def __validate_arg_presence(cls, arg): + """ + Ensures that: + - all required arguments are passed in + - the input variable names are valid + - present in properties or + - accepted because additionalProperties exists + Exceptions will be raised if: + - invalid arguments were passed in + - a var_name is invalid if additional_properties == NotAnyTypeSchema + and var_name not in properties.__annotations__ + - required properties were not passed in + + Args: + arg: the input dict + + Raises: + ApiTypeError - for missing required arguments, or for invalid properties + """ + seen_required_properties = set() + invalid_arguments = [] + required_property_names = getattr(cls.MetaOapg, 'required', set()) + additional_properties = getattr(cls.MetaOapg, 'additional_properties', UnsetAnyTypeSchema) + properties = getattr(cls.MetaOapg, 'properties', {}) + property_annotations = getattr(properties, '__annotations__', {}) + for property_name in arg: + if property_name in required_property_names: + seen_required_properties.add(property_name) + elif property_name in property_annotations: + continue + elif additional_properties is not NotAnyTypeSchema: + continue + else: + invalid_arguments.append(property_name) + missing_required_arguments = list(required_property_names - seen_required_properties) + if missing_required_arguments: + missing_required_arguments.sort() + raise ApiTypeError( + "{} is missing {} required argument{}: {}".format( + cls.__name__, + len(missing_required_arguments), + "s" if len(missing_required_arguments) > 1 else "", + missing_required_arguments + ) + ) + if invalid_arguments: + invalid_arguments.sort() + raise ApiTypeError( + "{} was passed {} invalid argument{}: {}".format( + cls.__name__, + len(invalid_arguments), + "s" if len(invalid_arguments) > 1 else "", + invalid_arguments + ) + ) + + @classmethod + def __validate_args(cls, arg, validation_metadata: ValidationMetadata): + """ + Ensures that: + - values passed in for properties are valid + Exceptions will be raised if: + - invalid arguments were passed in + + Args: + arg: the input dict + + Raises: + ApiTypeError - for missing required arguments, or for invalid properties + """ + path_to_schemas = {} + additional_properties = getattr(cls.MetaOapg, 'additional_properties', UnsetAnyTypeSchema) + properties = getattr(cls.MetaOapg, 'properties', {}) + property_annotations = getattr(properties, '__annotations__', {}) + for property_name, value in arg.items(): + path_to_item = validation_metadata.path_to_item+(property_name,) + if property_name in property_annotations: + schema = property_annotations[property_name] + elif additional_properties is not NotAnyTypeSchema: + if additional_properties is UnsetAnyTypeSchema: + """ + If additionalProperties is unset and this path_to_item does not yet have + any validations on it, validate it. + If it already has validations on it, skip this validation. + """ + if path_to_item in path_to_schemas: + continue + schema = additional_properties + else: + raise ApiTypeError('Unable to find schema for value={} in class={} at path_to_item={}'.format( + value, cls, validation_metadata.path_to_item+(property_name,) + )) + schema = cls._get_class_oapg(schema) + arg_validation_metadata = ValidationMetadata( + from_server=validation_metadata.from_server, + configuration=validation_metadata.configuration, + path_to_item=path_to_item, + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + if arg_validation_metadata.validation_ran_earlier(schema): + continue + other_path_to_schemas = schema._validate_oapg(value, validation_metadata=arg_validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + @classmethod + def __check_dict_validations( + cls, + arg, + validation_metadata: ValidationMetadata + ): + if not hasattr(cls, 'MetaOapg'): + return + if (cls._is_json_validation_enabled_oapg('maxProperties', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'max_properties') and + len(arg) > cls.MetaOapg.max_properties): + cls._raise_validation_errror_message_oapg( + value=arg, + constraint_msg="number of properties must be less than or equal to", + constraint_value=cls.MetaOapg.max_properties, + path_to_item=validation_metadata.path_to_item + ) + + if (cls._is_json_validation_enabled_oapg('minProperties', validation_metadata.configuration) and + hasattr(cls.MetaOapg, 'min_properties') and + len(arg) < cls.MetaOapg.min_properties): + cls._raise_validation_errror_message_oapg( + value=arg, + constraint_msg="number of properties must be greater than or equal to", + constraint_value=cls.MetaOapg.min_properties, + path_to_item=validation_metadata.path_to_item + ) + + @classmethod + def _validate_oapg( + cls, + arg, + validation_metadata: ValidationMetadata, + ): + """ + DictBase _validate_oapg + We return dynamic classes of different bases depending upon the inputs + This makes it so: + - the returned instance is always a subclass of our defining schema + - this allows us to check type based on whether an instance is a subclass of a schema + - the returned instance is a serializable type (except for None, True, and False) which are enums + + Returns: + new_cls (type): the new class + + Raises: + ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes + ApiTypeError: when the input type is not in the list of allowed spec types + """ + if isinstance(arg, frozendict.frozendict): + cls.__check_dict_validations(arg, validation_metadata) + _path_to_schemas = super()._validate_oapg(arg, validation_metadata=validation_metadata) + if not isinstance(arg, frozendict.frozendict): + return _path_to_schemas + cls.__validate_arg_presence(arg) + other_path_to_schemas = cls.__validate_args(arg, validation_metadata=validation_metadata) + update(_path_to_schemas, other_path_to_schemas) + try: + discriminator = cls.MetaOapg.discriminator() + except AttributeError: + return _path_to_schemas + # discriminator exists + disc_prop_name = list(discriminator.keys())[0] + cls._ensure_discriminator_value_present_oapg(disc_prop_name, validation_metadata, arg) + discriminated_cls = cls.get_discriminated_class_oapg( + disc_property_name=disc_prop_name, disc_payload_value=arg[disc_prop_name]) + if discriminated_cls is None: + raise ApiValueError( + "Invalid discriminator value was passed in to {}.{} Only the values {} are allowed at {}".format( + cls.__name__, + disc_prop_name, + list(discriminator[disc_prop_name].keys()), + validation_metadata.path_to_item + (disc_prop_name,) + ) + ) + updated_vm = ValidationMetadata( + configuration=validation_metadata.configuration, + from_server=validation_metadata.from_server, + path_to_item=validation_metadata.path_to_item, + seen_classes=validation_metadata.seen_classes | frozenset({cls}), + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + if updated_vm.validation_ran_earlier(discriminated_cls): + return _path_to_schemas + other_path_to_schemas = discriminated_cls._validate_oapg(arg, validation_metadata=updated_vm) + update(_path_to_schemas, other_path_to_schemas) + return _path_to_schemas + + @classmethod + def _get_properties_oapg( + cls, + arg: typing.Dict[str, typing.Any], + path_to_item: typing.Tuple[typing.Union[str, int], ...], + path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Type['Schema']] + ): + """ + DictBase _get_properties_oapg, this is how properties are set + These values already passed validation + """ + dict_items = {} + + for property_name_js, value in arg.items(): + property_path_to_item = path_to_item + (property_name_js,) + property_cls = path_to_schemas[property_path_to_item] + new_value = property_cls._get_new_instance_without_conversion_oapg( + value, + property_path_to_item, + path_to_schemas + ) + dict_items[property_name_js] = new_value + + return dict_items + + def __setattr__(self, name: str, value: typing.Any): + if not isinstance(self, FileIO): + raise AttributeError('property setting not supported on immutable instances') + + def __getattr__(self, name: str): + """ + for instance.name access + Properties are only type hinted for required properties + so that hasattr(instance, 'optionalProp') is False when that key is not present + """ + if not isinstance(self, frozendict.frozendict): + return super().__getattr__(name) + if name not in self.__class__.__annotations__: + raise AttributeError(f"{self} has no attribute '{name}'") + try: + value = self[name] + return value + except KeyError as ex: + raise AttributeError(str(ex)) + + def __getitem__(self, name: str): + """ + dict_instance[name] accessor + key errors thrown + """ + if not isinstance(self, frozendict.frozendict): + return super().__getattr__(name) + return super().__getitem__(name) + + def get_item_oapg(self, name: str) -> typing.Union['AnyTypeSchema', Unset]: + # dict_instance[name] accessor + if not isinstance(self, frozendict.frozendict): + raise NotImplementedError() + try: + return super().__getitem__(name) + except KeyError: + return unset + + +def cast_to_allowed_types( + arg: typing.Union[str, date, datetime, uuid.UUID, decimal.Decimal, int, float, None, dict, frozendict.frozendict, list, tuple, bytes, Schema, io.FileIO, io.BufferedReader], + from_server: bool, + validated_path_to_schemas: typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]], + path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), +) -> typing.Union[frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO]: + """ + Casts the input payload arg into the allowed types + The input validated_path_to_schemas is mutated by running this function + + When from_server is False then + - date/datetime is cast to str + - int/float is cast to Decimal + + If a Schema instance is passed in it is converted back to a primitive instance because + One may need to validate that data to the original Schema class AND additional different classes + those additional classes will need to be added to the new manufactured class for that payload + If the code didn't do this and kept the payload as a Schema instance it would fail to validate to other + Schema classes and the code wouldn't be able to mfg a new class that includes all valid schemas + TODO: store the validated schema classes in validation_metadata + + Args: + arg: the payload + from_server: whether this payload came from the server or not + validated_path_to_schemas: a dict that stores the validated classes at any path location in the payload + """ + if isinstance(arg, Schema): + # store the already run validations + schema_classes = set() + source_schema_was_unset = len(arg.__class__.__bases__) == 2 and UnsetAnyTypeSchema in arg.__class__.__bases__ + if not source_schema_was_unset: + """ + Do not include UnsetAnyTypeSchema and its base class because + it did not exist in the original spec schema definition + It was added to ensure that all instances are of type Schema and the allowed base types + """ + for cls in arg.__class__.__bases__: + if cls is Singleton: + # Skip Singleton + continue + schema_classes.add(cls) + validated_path_to_schemas[path_to_item] = schema_classes + + type_error = ApiTypeError(f"Invalid type. Required value type is str and passed type was {type(arg)} at {path_to_item}") + if isinstance(arg, str): + return str(arg) + elif isinstance(arg, (dict, frozendict.frozendict)): + return frozendict.frozendict({key: cast_to_allowed_types(val, from_server, validated_path_to_schemas, path_to_item + (key,)) for key, val in arg.items()}) + elif isinstance(arg, (bool, BoolClass)): + """ + this check must come before isinstance(arg, (int, float)) + because isinstance(True, int) is True + """ + if arg: + return BoolClass.TRUE + return BoolClass.FALSE + elif isinstance(arg, int): + return decimal.Decimal(arg) + elif isinstance(arg, float): + decimal_from_float = decimal.Decimal(arg) + if decimal_from_float.as_integer_ratio()[1] == 1: + # 9.0 -> Decimal('9.0') + # 3.4028234663852886e+38 -> Decimal('340282346638528859811704183484516925440.0') + return decimal.Decimal(str(decimal_from_float)+'.0') + return decimal_from_float + elif isinstance(arg, (tuple, list)): + return tuple([cast_to_allowed_types(item, from_server, validated_path_to_schemas, path_to_item + (i,)) for i, item in enumerate(arg)]) + elif isinstance(arg, (none_type, NoneClass)): + return NoneClass.NONE + elif isinstance(arg, (date, datetime)): + if not from_server: + return arg.isoformat() + raise type_error + elif isinstance(arg, uuid.UUID): + if not from_server: + return str(arg) + raise type_error + elif isinstance(arg, decimal.Decimal): + return decimal.Decimal(arg) + elif isinstance(arg, bytes): + return bytes(arg) + elif isinstance(arg, (io.FileIO, io.BufferedReader)): + return FileIO(arg) + raise ValueError('Invalid type passed in got input={} type={}'.format(arg, type(arg))) + + +class ComposedBase(Discriminable): + + @classmethod + def __get_allof_classes(cls, arg, validation_metadata: ValidationMetadata): + path_to_schemas = defaultdict(set) + for allof_cls in cls.MetaOapg.all_of(): + if validation_metadata.validation_ran_earlier(allof_cls): + continue + other_path_to_schemas = allof_cls._validate_oapg(arg, validation_metadata=validation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + @classmethod + def __get_oneof_class( + cls, + arg, + discriminated_cls, + validation_metadata: ValidationMetadata, + ): + oneof_classes = [] + path_to_schemas = defaultdict(set) + for oneof_cls in cls.MetaOapg.one_of(): + if oneof_cls in path_to_schemas[validation_metadata.path_to_item]: + oneof_classes.append(oneof_cls) + continue + if validation_metadata.validation_ran_earlier(oneof_cls): + oneof_classes.append(oneof_cls) + continue + try: + path_to_schemas = oneof_cls._validate_oapg(arg, validation_metadata=validation_metadata) + except (ApiValueError, ApiTypeError) as ex: + if discriminated_cls is not None and oneof_cls is discriminated_cls: + raise ex + continue + oneof_classes.append(oneof_cls) + if not oneof_classes: + raise ApiValueError( + "Invalid inputs given to generate an instance of {}. None " + "of the oneOf schemas matched the input data.".format(cls) + ) + elif len(oneof_classes) > 1: + raise ApiValueError( + "Invalid inputs given to generate an instance of {}. Multiple " + "oneOf schemas {} matched the inputs, but a max of one is allowed.".format(cls, oneof_classes) + ) + return path_to_schemas + + @classmethod + def __get_anyof_classes( + cls, + arg, + discriminated_cls, + validation_metadata: ValidationMetadata + ): + anyof_classes = [] + path_to_schemas = defaultdict(set) + for anyof_cls in cls.MetaOapg.any_of(): + if validation_metadata.validation_ran_earlier(anyof_cls): + anyof_classes.append(anyof_cls) + continue + + try: + other_path_to_schemas = anyof_cls._validate_oapg(arg, validation_metadata=validation_metadata) + except (ApiValueError, ApiTypeError) as ex: + if discriminated_cls is not None and anyof_cls is discriminated_cls: + raise ex + continue + anyof_classes.append(anyof_cls) + update(path_to_schemas, other_path_to_schemas) + if not anyof_classes: + raise ApiValueError( + "Invalid inputs given to generate an instance of {}. None " + "of the anyOf schemas matched the input data.".format(cls) + ) + return path_to_schemas + + @classmethod + def _validate_oapg( + cls, + arg, + validation_metadata: ValidationMetadata, + ) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]: + """ + ComposedBase _validate_oapg + We return dynamic classes of different bases depending upon the inputs + This makes it so: + - the returned instance is always a subclass of our defining schema + - this allows us to check type based on whether an instance is a subclass of a schema + - the returned instance is a serializable type (except for None, True, and False) which are enums + + Returns: + new_cls (type): the new class + + Raises: + ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes + ApiTypeError: when the input type is not in the list of allowed spec types + """ + # validation checking on types, validations, and enums + path_to_schemas = super()._validate_oapg(arg, validation_metadata=validation_metadata) + + updated_vm = ValidationMetadata( + configuration=validation_metadata.configuration, + from_server=validation_metadata.from_server, + path_to_item=validation_metadata.path_to_item, + seen_classes=validation_metadata.seen_classes | frozenset({cls}), + validated_path_to_schemas=validation_metadata.validated_path_to_schemas + ) + + # process composed schema + discriminator = getattr(cls, 'discriminator', None) + discriminated_cls = None + if discriminator and arg and isinstance(arg, frozendict.frozendict): + disc_property_name = list(discriminator.keys())[0] + cls._ensure_discriminator_value_present_oapg(disc_property_name, updated_vm, arg) + # get discriminated_cls by looking at the dict in the current class + discriminated_cls = cls.get_discriminated_class_oapg( + disc_property_name=disc_property_name, disc_payload_value=arg[disc_property_name]) + if discriminated_cls is None: + raise ApiValueError( + "Invalid discriminator value '{}' was passed in to {}.{} Only the values {} are allowed at {}".format( + arg[disc_property_name], + cls.__name__, + disc_property_name, + list(discriminator[disc_property_name].keys()), + updated_vm.path_to_item + (disc_property_name,) + ) + ) + + if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'all_of'): + other_path_to_schemas = cls.__get_allof_classes(arg, validation_metadata=updated_vm) + update(path_to_schemas, other_path_to_schemas) + if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'one_of'): + other_path_to_schemas = cls.__get_oneof_class( + arg, + discriminated_cls=discriminated_cls, + validation_metadata=updated_vm + ) + update(path_to_schemas, other_path_to_schemas) + if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'any_of'): + other_path_to_schemas = cls.__get_anyof_classes( + arg, + discriminated_cls=discriminated_cls, + validation_metadata=updated_vm + ) + update(path_to_schemas, other_path_to_schemas) + not_cls = None + if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'not_schema'): + not_cls = cls.MetaOapg.not_schema + not_cls = cls._get_class_oapg(not_cls) + if not_cls: + other_path_to_schemas = None + not_exception = ApiValueError( + "Invalid value '{}' was passed in to {}. Value is invalid because it is disallowed by {}".format( + arg, + cls.__name__, + not_cls.__name__, + ) + ) + if updated_vm.validation_ran_earlier(not_cls): + raise not_exception + + try: + other_path_to_schemas = not_cls._validate_oapg(arg, validation_metadata=updated_vm) + except (ApiValueError, ApiTypeError): + pass + if other_path_to_schemas: + raise not_exception + + if discriminated_cls is not None and not updated_vm.validation_ran_earlier(discriminated_cls): + # TODO use an exception from this package here + assert discriminated_cls in path_to_schemas[updated_vm.path_to_item] + return path_to_schemas + + +# DictBase, ListBase, NumberBase, StrBase, BoolBase, NoneBase +class ComposedSchema( + ComposedBase, + DictBase, + ListBase, + NumberBase, + StrBase, + BoolBase, + NoneBase, + Schema, + NoneFrozenDictTupleStrDecimalBoolMixin +): + @classmethod + def from_openapi_data_oapg(cls, *args: typing.Any, _configuration: typing.Optional[Configuration] = None, **kwargs): + if not args: + if not kwargs: + raise ApiTypeError('{} is missing required input data in args or kwargs'.format(cls.__name__)) + args = (kwargs, ) + return super().from_openapi_data_oapg(args[0], _configuration=_configuration) + + +class ListSchema( + ListBase, + Schema, + TupleMixin +): + + @classmethod + def from_openapi_data_oapg(cls, arg: typing.List[typing.Any], _configuration: typing.Optional[Configuration] = None): + return super().from_openapi_data_oapg(arg, _configuration=_configuration) + + def __new__(cls, arg: typing.Union[typing.List[typing.Any], typing.Tuple[typing.Any]], **kwargs: Configuration): + return super().__new__(cls, arg, **kwargs) + + +class NoneSchema( + NoneBase, + Schema, + NoneMixin +): + + @classmethod + def from_openapi_data_oapg(cls, arg: None, _configuration: typing.Optional[Configuration] = None): + return super().from_openapi_data_oapg(arg, _configuration=_configuration) + + def __new__(cls, arg: None, **kwargs: Configuration): + return super().__new__(cls, arg, **kwargs) + + +class NumberSchema( + NumberBase, + Schema, + DecimalMixin +): + """ + This is used for type: number with no format + Both integers AND floats are accepted + """ + + @classmethod + def from_openapi_data_oapg(cls, arg: typing.Union[int, float], _configuration: typing.Optional[Configuration] = None): + return super().from_openapi_data_oapg(arg, _configuration=_configuration) + + def __new__(cls, arg: typing.Union[decimal.Decimal, int, float], **kwargs: Configuration): + return super().__new__(cls, arg, **kwargs) + + +class IntBase: + @property + def as_int_oapg(self) -> int: + try: + return self._as_int + except AttributeError: + self._as_int = int(self) + return self._as_int + + @classmethod + def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): + if isinstance(arg, decimal.Decimal): + + denominator = arg.as_integer_ratio()[-1] + if denominator != 1: + raise ApiValueError( + "Invalid value '{}' for type integer at {}".format(arg, validation_metadata.path_to_item) + ) + + @classmethod + def _validate_oapg( + cls, + arg, + validation_metadata: ValidationMetadata, + ): + """ + IntBase _validate_oapg + TODO what about types = (int, number) -> IntBase, NumberBase? We could drop int and keep number only + """ + cls.__validate_format(arg, validation_metadata=validation_metadata) + return super()._validate_oapg(arg, validation_metadata=validation_metadata) + + +class IntSchema(IntBase, NumberSchema): + + @classmethod + def from_openapi_data_oapg(cls, arg: int, _configuration: typing.Optional[Configuration] = None): + return super().from_openapi_data_oapg(arg, _configuration=_configuration) + + def __new__(cls, arg: typing.Union[decimal.Decimal, int], **kwargs: Configuration): + return super().__new__(cls, arg, **kwargs) + + +class Int32Base: + __inclusive_minimum = decimal.Decimal(-2147483648) + __inclusive_maximum = decimal.Decimal(2147483647) + + @classmethod + def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): + if isinstance(arg, decimal.Decimal) and arg.as_tuple().exponent == 0: + if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: + raise ApiValueError( + "Invalid value '{}' for type int32 at {}".format(arg, validation_metadata.path_to_item) + ) + + @classmethod + def _validate_oapg( + cls, + arg, + validation_metadata: ValidationMetadata, + ): + """ + Int32Base _validate_oapg + """ + cls.__validate_format(arg, validation_metadata=validation_metadata) + return super()._validate_oapg(arg, validation_metadata=validation_metadata) + + +class Int32Schema( + Int32Base, + IntSchema +): + pass + + +class Int64Base: + __inclusive_minimum = decimal.Decimal(-9223372036854775808) + __inclusive_maximum = decimal.Decimal(9223372036854775807) + + @classmethod + def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): + if isinstance(arg, decimal.Decimal) and arg.as_tuple().exponent == 0: + if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: + raise ApiValueError( + "Invalid value '{}' for type int64 at {}".format(arg, validation_metadata.path_to_item) + ) + + @classmethod + def _validate_oapg( + cls, + arg, + validation_metadata: ValidationMetadata, + ): + """ + Int64Base _validate_oapg + """ + cls.__validate_format(arg, validation_metadata=validation_metadata) + return super()._validate_oapg(arg, validation_metadata=validation_metadata) + + +class Int64Schema( + Int64Base, + IntSchema +): + pass + + +class Float32Base: + __inclusive_minimum = decimal.Decimal(-3.4028234663852886e+38) + __inclusive_maximum = decimal.Decimal(3.4028234663852886e+38) + + @classmethod + def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): + if isinstance(arg, decimal.Decimal): + if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: + raise ApiValueError( + "Invalid value '{}' for type float at {}".format(arg, validation_metadata.path_to_item) + ) + + @classmethod + def _validate_oapg( + cls, + arg, + validation_metadata: ValidationMetadata, + ): + """ + Float32Base _validate_oapg + """ + cls.__validate_format(arg, validation_metadata=validation_metadata) + return super()._validate_oapg(arg, validation_metadata=validation_metadata) + + +class Float32Schema( + Float32Base, + NumberSchema +): + + @classmethod + def from_openapi_data_oapg(cls, arg: float, _configuration: typing.Optional[Configuration] = None): + return super().from_openapi_data_oapg(arg, _configuration=_configuration) + + +class Float64Base: + __inclusive_minimum = decimal.Decimal(-1.7976931348623157E+308) + __inclusive_maximum = decimal.Decimal(1.7976931348623157E+308) + + @classmethod + def __validate_format(cls, arg: typing.Optional[decimal.Decimal], validation_metadata: ValidationMetadata): + if isinstance(arg, decimal.Decimal): + if not cls.__inclusive_minimum <= arg <= cls.__inclusive_maximum: + raise ApiValueError( + "Invalid value '{}' for type double at {}".format(arg, validation_metadata.path_to_item) + ) + + @classmethod + def _validate_oapg( + cls, + arg, + validation_metadata: ValidationMetadata, + ): + """ + Float64Base _validate_oapg + """ + cls.__validate_format(arg, validation_metadata=validation_metadata) + return super()._validate_oapg(arg, validation_metadata=validation_metadata) + +class Float64Schema( + Float64Base, + NumberSchema +): + + @classmethod + def from_openapi_data_oapg(cls, arg: float, _configuration: typing.Optional[Configuration] = None): + # todo check format + return super().from_openapi_data_oapg(arg, _configuration=_configuration) + + +class StrSchema( + StrBase, + Schema, + StrMixin +): + """ + date + datetime string types must inherit from this class + That is because one can validate a str payload as both: + - type: string (format unset) + - type: string, format: date + """ + + @classmethod + def from_openapi_data_oapg(cls, arg: str, _configuration: typing.Optional[Configuration] = None) -> 'StrSchema': + return super().from_openapi_data_oapg(arg, _configuration=_configuration) + + def __new__(cls, arg: typing.Union[str, date, datetime, uuid.UUID], **kwargs: Configuration): + return super().__new__(cls, arg, **kwargs) + + +class UUIDSchema(UUIDBase, StrSchema): + + def __new__(cls, arg: typing.Union[str, uuid.UUID], **kwargs: Configuration): + return super().__new__(cls, arg, **kwargs) + + +class DateSchema(DateBase, StrSchema): + + def __new__(cls, arg: typing.Union[str, date], **kwargs: Configuration): + return super().__new__(cls, arg, **kwargs) + + +class DateTimeSchema(DateTimeBase, StrSchema): + + def __new__(cls, arg: typing.Union[str, datetime], **kwargs: Configuration): + return super().__new__(cls, arg, **kwargs) + + +class DecimalSchema(DecimalBase, StrSchema): + + def __new__(cls, arg: str, **kwargs: Configuration): + """ + Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads + which can be simple (str) or complex (dicts or lists with nested values) + Because casting is only done once and recursively casts all values prior to validation then for a potential + client side Decimal input if Decimal was accepted as an input in DecimalSchema then one would not know + if one was using it for a StrSchema (where it should be cast to str) or one is using it for NumberSchema + where it should stay as Decimal. + """ + return super().__new__(cls, arg, **kwargs) + + +class BytesSchema( + Schema, + BytesMixin +): + """ + this class will subclass bytes and is immutable + """ + def __new__(cls, arg: bytes, **kwargs: Configuration): + return super(Schema, cls).__new__(cls, arg) + + +class FileSchema( + Schema, + FileMixin +): + """ + This class is NOT immutable + Dynamic classes are built using it for example when AnyType allows in binary data + Al other schema classes ARE immutable + If one wanted to make this immutable one could make this a DictSchema with required properties: + - data = BytesSchema (which would be an immutable bytes based schema) + - file_name = StrSchema + and cast_to_allowed_types would convert bytes and file instances into dicts containing data + file_name + The downside would be that data would be stored in memory which one may not want to do for very large files + + The developer is responsible for closing this file and deleting it + + This class was kept as mutable: + - to allow file reading and writing to disk + - to be able to preserve file name info + """ + + def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader], **kwargs: Configuration): + return super(Schema, cls).__new__(cls, arg) + + +class BinaryBase: + pass + + +class BinarySchema( + ComposedBase, + BinaryBase, + Schema, + BinaryMixin +): + class MetaOapg: + @staticmethod + def one_of(): + return [ + BytesSchema, + FileSchema, + ] + + def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: Configuration): + return super().__new__(cls, arg) + + +class BoolSchema( + BoolBase, + Schema, + BoolMixin +): + + @classmethod + def from_openapi_data_oapg(cls, arg: bool, _configuration: typing.Optional[Configuration] = None): + return super().from_openapi_data_oapg(arg, _configuration=_configuration) + + def __new__(cls, arg: bool, **kwargs: ValidationMetadata): + return super().__new__(cls, arg, **kwargs) + + +class AnyTypeSchema( + DictBase, + ListBase, + NumberBase, + StrBase, + BoolBase, + NoneBase, + Schema, + NoneFrozenDictTupleStrDecimalBoolFileBytesMixin +): + # Python representation of a schema defined as true or {} + pass + + +class UnsetAnyTypeSchema(AnyTypeSchema): + # Used when additionalProperties/items was not explicitly defined and a defining schema is needed + pass + + +class NotAnyTypeSchema( + ComposedSchema, +): + """ + Python representation of a schema defined as false or {'not': {}} + Does not allow inputs in of AnyType + Note: validations on this class are never run because the code knows that no inputs will ever validate + """ + + class MetaOapg: + not_schema = AnyTypeSchema + + def __new__( + cls, + *args, + _configuration: typing.Optional[Configuration] = None, + ) -> 'NotAnyTypeSchema': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) + + +class DictSchema( + DictBase, + Schema, + FrozenDictMixin +): + @classmethod + def from_openapi_data_oapg(cls, arg: typing.Dict[str, typing.Any], _configuration: typing.Optional[Configuration] = None): + return super().from_openapi_data_oapg(arg, _configuration=_configuration) + + def __new__(cls, *args: typing.Union[dict, frozendict.frozendict], **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, ValidationMetadata]): + return super().__new__(cls, *args, **kwargs) + + +schema_type_classes = {NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema, AnyTypeSchema} + + +@functools.lru_cache() +def get_new_class( + class_name: str, + bases: typing.Tuple[typing.Type[typing.Union[Schema, typing.Any]], ...] +) -> typing.Type[Schema]: + """ + Returns a new class that is made with the subclass bases + """ + new_cls: typing.Type[Schema] = type(class_name, bases, {}) + return new_cls + + +LOG_CACHE_USAGE = False + + +def log_cache_usage(cache_fn): + if LOG_CACHE_USAGE: + print(cache_fn.__name__, cache_fn.cache_info()) diff --git a/samples/openapi3/client/features/dynamic-servers/python/git_push.sh b/samples/openapi3/client/features/dynamic-servers/python/git_push.sh index f53a75d4fabe..ced3be2b0c7b 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/git_push.sh +++ b/samples/openapi3/client/features/dynamic-servers/python/git_push.sh @@ -1,7 +1,7 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 @@ -38,14 +38,14 @@ git add . git commit -m "$release_note" # Sets the new remote -git_remote=$(git 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 + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -55,3 +55,4 @@ 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/features/dynamic-servers/python/requirements.txt b/samples/openapi3/client/features/dynamic-servers/python/requirements.txt index 96947f60408f..c9227e58a1be 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/requirements.txt +++ b/samples/openapi3/client/features/dynamic-servers/python/requirements.txt @@ -1,3 +1,5 @@ +certifi >= 14.05.14 +frozendict >= 2.0.3 python_dateutil >= 2.5.3 setuptools >= 21.0.0 -urllib3 >= 1.25.3 +urllib3 >= 1.15.1 diff --git a/samples/openapi3/client/features/dynamic-servers/python/setup.py b/samples/openapi3/client/features/dynamic-servers/python/setup.py index 16802f144fe4..5723b628053e 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/setup.py +++ b/samples/openapi3/client/features/dynamic-servers/python/setup.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Extension with dynamic servers @@ -7,7 +9,6 @@ Generated by: https://openapi-generator.tech """ - from setuptools import setup, find_packages # noqa: H301 NAME = "dynamic-servers" @@ -20,8 +21,11 @@ # http://pypi.python.org/pypi/setuptools REQUIRES = [ - "urllib3 >= 1.25.3", + "urllib3 >= 1.15", + "certifi", "python-dateutil", + "frozendict >= 2.0.3", + "typing_extensions", ] setup( @@ -32,7 +36,7 @@ author_email="team@openapitools.org", url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Extension with dynamic servers"], - python_requires=">=3.6", + python_requires=">=3.7", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, diff --git a/samples/openapi3/client/features/dynamic-servers/python/test-requirements.txt b/samples/openapi3/client/features/dynamic-servers/python/test-requirements.txt index bb4f22bb7a6e..2d88b0341921 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/test-requirements.txt +++ b/samples/openapi3/client/features/dynamic-servers/python/test-requirements.txt @@ -1 +1,3 @@ +pytest~=4.6.7 # needed for python 3.4 pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 3.4 diff --git a/samples/openapi3/client/petstore/python-experimental/test/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/test/test_models/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/__init__.py rename to samples/openapi3/client/features/dynamic-servers/python/test/test_models/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/test/test_paths/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/__init__.py rename to samples/openapi3/client/features/dynamic-servers/python/test/test_paths/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/test/test_paths/test_custom/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/__init__.py rename to samples/openapi3/client/features/dynamic-servers/python/test/test_paths/test_custom/__init__.py diff --git a/samples/openapi3/client/features/dynamic-servers/python/test/test_paths/test_custom/test_get.py b/samples/openapi3/client/features/dynamic-servers/python/test/test_paths/test_custom/test_get.py new file mode 100644 index 000000000000..5c1e563e3483 --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/python/test/test_paths/test_custom/test_get.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import dynamic_servers +from dynamic_servers.paths.custom import get # noqa: E501 +from dynamic_servers import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestCustom(ApiTestMixin, unittest.TestCase): + """ + Custom unit test stubs + Use custom server # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + + + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_another_fake_dummy/__init__.py b/samples/openapi3/client/features/dynamic-servers/python/test/test_paths/test_default/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_another_fake_dummy/__init__.py rename to samples/openapi3/client/features/dynamic-servers/python/test/test_paths/test_default/__init__.py diff --git a/samples/openapi3/client/features/dynamic-servers/python/test/test_paths/test_default/test_get.py b/samples/openapi3/client/features/dynamic-servers/python/test/test_paths/test_default/test_get.py new file mode 100644 index 000000000000..7816dd50f22d --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/python/test/test_paths/test_default/test_get.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import dynamic_servers +from dynamic_servers.paths.default import get # noqa: E501 +from dynamic_servers import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestDefault(ApiTestMixin, unittest.TestCase): + """ + Default unit test stubs + Use default server # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + + + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/features/dynamic-servers/python/tox.ini b/samples/openapi3/client/features/dynamic-servers/python/tox.ini index c27e7fe3270f..67c29e77f4e2 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/tox.ini +++ b/samples/openapi3/client/features/dynamic-servers/python/tox.ini @@ -1,7 +1,8 @@ [tox] -envlist = py3 +envlist = py37 [testenv] +passenv = PYTHON_VERSION deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES deleted file mode 100644 index 0ce65f0078f7..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES +++ /dev/null @@ -1,387 +0,0 @@ -.gitignore -.gitlab-ci.yml -.travis.yml -README.md -docs/apis/tags/AnotherFakeApi.md -docs/apis/tags/DefaultApi.md -docs/apis/tags/FakeApi.md -docs/apis/tags/FakeClassnameTags123Api.md -docs/apis/tags/PetApi.md -docs/apis/tags/StoreApi.md -docs/apis/tags/UserApi.md -docs/models/AdditionalPropertiesClass.md -docs/models/AdditionalPropertiesValidator.md -docs/models/AdditionalPropertiesWithArrayOfEnums.md -docs/models/Address.md -docs/models/Animal.md -docs/models/AnimalFarm.md -docs/models/AnyTypeAndFormat.md -docs/models/AnyTypeNotString.md -docs/models/ApiResponse.md -docs/models/Apple.md -docs/models/AppleReq.md -docs/models/ArrayHoldingAnyType.md -docs/models/ArrayOfArrayOfNumberOnly.md -docs/models/ArrayOfEnums.md -docs/models/ArrayOfNumberOnly.md -docs/models/ArrayTest.md -docs/models/ArrayWithValidationsInItems.md -docs/models/Banana.md -docs/models/BananaReq.md -docs/models/Bar.md -docs/models/BasquePig.md -docs/models/Boolean.md -docs/models/BooleanEnum.md -docs/models/Capitalization.md -docs/models/Cat.md -docs/models/Category.md -docs/models/ChildCat.md -docs/models/ClassModel.md -docs/models/Client.md -docs/models/ComplexQuadrilateral.md -docs/models/ComposedAnyOfDifferentTypesNoValidations.md -docs/models/ComposedArray.md -docs/models/ComposedBool.md -docs/models/ComposedNone.md -docs/models/ComposedNumber.md -docs/models/ComposedObject.md -docs/models/ComposedOneOfDifferentTypes.md -docs/models/ComposedString.md -docs/models/Currency.md -docs/models/DanishPig.md -docs/models/DateTimeTest.md -docs/models/DateTimeWithValidations.md -docs/models/DateWithValidations.md -docs/models/DecimalPayload.md -docs/models/Dog.md -docs/models/Drawing.md -docs/models/EnumArrays.md -docs/models/EnumClass.md -docs/models/EnumTest.md -docs/models/EquilateralTriangle.md -docs/models/File.md -docs/models/FileSchemaTestClass.md -docs/models/Foo.md -docs/models/FormatTest.md -docs/models/Fruit.md -docs/models/FruitReq.md -docs/models/GmFruit.md -docs/models/GrandparentAnimal.md -docs/models/HasOnlyReadOnly.md -docs/models/HealthCheckResult.md -docs/models/IntegerEnum.md -docs/models/IntegerEnumBig.md -docs/models/IntegerEnumOneValue.md -docs/models/IntegerEnumWithDefaultValue.md -docs/models/IntegerMax10.md -docs/models/IntegerMin15.md -docs/models/IsoscelesTriangle.md -docs/models/JSONPatchRequest.md -docs/models/JSONPatchRequestAddReplaceTest.md -docs/models/JSONPatchRequestMoveCopy.md -docs/models/JSONPatchRequestRemove.md -docs/models/Mammal.md -docs/models/MapTest.md -docs/models/MixedPropertiesAndAdditionalPropertiesClass.md -docs/models/Model200Response.md -docs/models/ModelReturn.md -docs/models/Money.md -docs/models/Name.md -docs/models/NoAdditionalProperties.md -docs/models/NullableClass.md -docs/models/NullableShape.md -docs/models/NullableString.md -docs/models/Number.md -docs/models/NumberOnly.md -docs/models/NumberWithValidations.md -docs/models/ObjectInterface.md -docs/models/ObjectModelWithRefProps.md -docs/models/ObjectWithDecimalProperties.md -docs/models/ObjectWithDifficultlyNamedProps.md -docs/models/ObjectWithInlineCompositionProperty.md -docs/models/ObjectWithValidations.md -docs/models/Order.md -docs/models/ParentPet.md -docs/models/Pet.md -docs/models/Pig.md -docs/models/Player.md -docs/models/Quadrilateral.md -docs/models/QuadrilateralInterface.md -docs/models/ReadOnlyFirst.md -docs/models/ScaleneTriangle.md -docs/models/Shape.md -docs/models/ShapeOrNull.md -docs/models/SimpleQuadrilateral.md -docs/models/SomeObject.md -docs/models/SpecialModelName.md -docs/models/String.md -docs/models/StringBooleanMap.md -docs/models/StringEnum.md -docs/models/StringEnumWithDefaultValue.md -docs/models/StringWithValidation.md -docs/models/Tag.md -docs/models/Triangle.md -docs/models/TriangleInterface.md -docs/models/UUIDString.md -docs/models/User.md -docs/models/Whale.md -docs/models/Zebra.md -git_push.sh -petstore_api/__init__.py -petstore_api/api_client.py -petstore_api/apis/__init__.py -petstore_api/apis/tags/another_fake_api.py -petstore_api/apis/tags/default_api.py -petstore_api/apis/tags/fake_api.py -petstore_api/apis/tags/fake_classname_tags123_api.py -petstore_api/apis/tags/pet_api.py -petstore_api/apis/tags/store_api.py -petstore_api/apis/tags/user_api.py -petstore_api/configuration.py -petstore_api/exceptions.py -petstore_api/model/__init__.py -petstore_api/model/additional_properties_class.py -petstore_api/model/additional_properties_class.pyi -petstore_api/model/additional_properties_validator.py -petstore_api/model/additional_properties_validator.pyi -petstore_api/model/additional_properties_with_array_of_enums.py -petstore_api/model/additional_properties_with_array_of_enums.pyi -petstore_api/model/address.py -petstore_api/model/address.pyi -petstore_api/model/animal.py -petstore_api/model/animal.pyi -petstore_api/model/animal_farm.py -petstore_api/model/animal_farm.pyi -petstore_api/model/any_type_and_format.py -petstore_api/model/any_type_and_format.pyi -petstore_api/model/any_type_not_string.py -petstore_api/model/any_type_not_string.pyi -petstore_api/model/api_response.py -petstore_api/model/api_response.pyi -petstore_api/model/apple.py -petstore_api/model/apple.pyi -petstore_api/model/apple_req.py -petstore_api/model/apple_req.pyi -petstore_api/model/array_holding_any_type.py -petstore_api/model/array_holding_any_type.pyi -petstore_api/model/array_of_array_of_number_only.py -petstore_api/model/array_of_array_of_number_only.pyi -petstore_api/model/array_of_enums.py -petstore_api/model/array_of_enums.pyi -petstore_api/model/array_of_number_only.py -petstore_api/model/array_of_number_only.pyi -petstore_api/model/array_test.py -petstore_api/model/array_test.pyi -petstore_api/model/array_with_validations_in_items.py -petstore_api/model/array_with_validations_in_items.pyi -petstore_api/model/banana.py -petstore_api/model/banana.pyi -petstore_api/model/banana_req.py -petstore_api/model/banana_req.pyi -petstore_api/model/bar.py -petstore_api/model/bar.pyi -petstore_api/model/basque_pig.py -petstore_api/model/basque_pig.pyi -petstore_api/model/boolean.py -petstore_api/model/boolean.pyi -petstore_api/model/boolean_enum.py -petstore_api/model/boolean_enum.pyi -petstore_api/model/capitalization.py -petstore_api/model/capitalization.pyi -petstore_api/model/cat.py -petstore_api/model/cat.pyi -petstore_api/model/category.py -petstore_api/model/category.pyi -petstore_api/model/child_cat.py -petstore_api/model/child_cat.pyi -petstore_api/model/class_model.py -petstore_api/model/class_model.pyi -petstore_api/model/client.py -petstore_api/model/client.pyi -petstore_api/model/complex_quadrilateral.py -petstore_api/model/complex_quadrilateral.pyi -petstore_api/model/composed_any_of_different_types_no_validations.py -petstore_api/model/composed_any_of_different_types_no_validations.pyi -petstore_api/model/composed_array.py -petstore_api/model/composed_array.pyi -petstore_api/model/composed_bool.py -petstore_api/model/composed_bool.pyi -petstore_api/model/composed_none.py -petstore_api/model/composed_none.pyi -petstore_api/model/composed_number.py -petstore_api/model/composed_number.pyi -petstore_api/model/composed_object.py -petstore_api/model/composed_object.pyi -petstore_api/model/composed_one_of_different_types.py -petstore_api/model/composed_one_of_different_types.pyi -petstore_api/model/composed_string.py -petstore_api/model/composed_string.pyi -petstore_api/model/currency.py -petstore_api/model/currency.pyi -petstore_api/model/danish_pig.py -petstore_api/model/danish_pig.pyi -petstore_api/model/date_time_test.py -petstore_api/model/date_time_test.pyi -petstore_api/model/date_time_with_validations.py -petstore_api/model/date_time_with_validations.pyi -petstore_api/model/date_with_validations.py -petstore_api/model/date_with_validations.pyi -petstore_api/model/decimal_payload.py -petstore_api/model/decimal_payload.pyi -petstore_api/model/dog.py -petstore_api/model/dog.pyi -petstore_api/model/drawing.py -petstore_api/model/drawing.pyi -petstore_api/model/enum_arrays.py -petstore_api/model/enum_arrays.pyi -petstore_api/model/enum_class.py -petstore_api/model/enum_class.pyi -petstore_api/model/enum_test.py -petstore_api/model/enum_test.pyi -petstore_api/model/equilateral_triangle.py -petstore_api/model/equilateral_triangle.pyi -petstore_api/model/file.py -petstore_api/model/file.pyi -petstore_api/model/file_schema_test_class.py -petstore_api/model/file_schema_test_class.pyi -petstore_api/model/foo.py -petstore_api/model/foo.pyi -petstore_api/model/format_test.py -petstore_api/model/format_test.pyi -petstore_api/model/fruit.py -petstore_api/model/fruit.pyi -petstore_api/model/fruit_req.py -petstore_api/model/fruit_req.pyi -petstore_api/model/gm_fruit.py -petstore_api/model/gm_fruit.pyi -petstore_api/model/grandparent_animal.py -petstore_api/model/grandparent_animal.pyi -petstore_api/model/has_only_read_only.py -petstore_api/model/has_only_read_only.pyi -petstore_api/model/health_check_result.py -petstore_api/model/health_check_result.pyi -petstore_api/model/integer_enum.py -petstore_api/model/integer_enum.pyi -petstore_api/model/integer_enum_big.py -petstore_api/model/integer_enum_big.pyi -petstore_api/model/integer_enum_one_value.py -petstore_api/model/integer_enum_one_value.pyi -petstore_api/model/integer_enum_with_default_value.py -petstore_api/model/integer_enum_with_default_value.pyi -petstore_api/model/integer_max10.py -petstore_api/model/integer_max10.pyi -petstore_api/model/integer_min15.py -petstore_api/model/integer_min15.pyi -petstore_api/model/isosceles_triangle.py -petstore_api/model/isosceles_triangle.pyi -petstore_api/model/json_patch_request.py -petstore_api/model/json_patch_request.pyi -petstore_api/model/json_patch_request_add_replace_test.py -petstore_api/model/json_patch_request_add_replace_test.pyi -petstore_api/model/json_patch_request_move_copy.py -petstore_api/model/json_patch_request_move_copy.pyi -petstore_api/model/json_patch_request_remove.py -petstore_api/model/json_patch_request_remove.pyi -petstore_api/model/mammal.py -petstore_api/model/mammal.pyi -petstore_api/model/map_test.py -petstore_api/model/map_test.pyi -petstore_api/model/mixed_properties_and_additional_properties_class.py -petstore_api/model/mixed_properties_and_additional_properties_class.pyi -petstore_api/model/model200_response.py -petstore_api/model/model200_response.pyi -petstore_api/model/model_return.py -petstore_api/model/model_return.pyi -petstore_api/model/money.py -petstore_api/model/money.pyi -petstore_api/model/name.py -petstore_api/model/name.pyi -petstore_api/model/no_additional_properties.py -petstore_api/model/no_additional_properties.pyi -petstore_api/model/nullable_class.py -petstore_api/model/nullable_class.pyi -petstore_api/model/nullable_shape.py -petstore_api/model/nullable_shape.pyi -petstore_api/model/nullable_string.py -petstore_api/model/nullable_string.pyi -petstore_api/model/number.py -petstore_api/model/number.pyi -petstore_api/model/number_only.py -petstore_api/model/number_only.pyi -petstore_api/model/number_with_validations.py -petstore_api/model/number_with_validations.pyi -petstore_api/model/object_interface.py -petstore_api/model/object_interface.pyi -petstore_api/model/object_model_with_ref_props.py -petstore_api/model/object_model_with_ref_props.pyi -petstore_api/model/object_with_decimal_properties.py -petstore_api/model/object_with_decimal_properties.pyi -petstore_api/model/object_with_difficultly_named_props.py -petstore_api/model/object_with_difficultly_named_props.pyi -petstore_api/model/object_with_inline_composition_property.py -petstore_api/model/object_with_inline_composition_property.pyi -petstore_api/model/object_with_validations.py -petstore_api/model/object_with_validations.pyi -petstore_api/model/order.py -petstore_api/model/order.pyi -petstore_api/model/parent_pet.py -petstore_api/model/parent_pet.pyi -petstore_api/model/pet.py -petstore_api/model/pet.pyi -petstore_api/model/pig.py -petstore_api/model/pig.pyi -petstore_api/model/player.py -petstore_api/model/player.pyi -petstore_api/model/quadrilateral.py -petstore_api/model/quadrilateral.pyi -petstore_api/model/quadrilateral_interface.py -petstore_api/model/quadrilateral_interface.pyi -petstore_api/model/read_only_first.py -petstore_api/model/read_only_first.pyi -petstore_api/model/scalene_triangle.py -petstore_api/model/scalene_triangle.pyi -petstore_api/model/shape.py -petstore_api/model/shape.pyi -petstore_api/model/shape_or_null.py -petstore_api/model/shape_or_null.pyi -petstore_api/model/simple_quadrilateral.py -petstore_api/model/simple_quadrilateral.pyi -petstore_api/model/some_object.py -petstore_api/model/some_object.pyi -petstore_api/model/special_model_name.py -petstore_api/model/special_model_name.pyi -petstore_api/model/string.py -petstore_api/model/string.pyi -petstore_api/model/string_boolean_map.py -petstore_api/model/string_boolean_map.pyi -petstore_api/model/string_enum.py -petstore_api/model/string_enum.pyi -petstore_api/model/string_enum_with_default_value.py -petstore_api/model/string_enum_with_default_value.pyi -petstore_api/model/string_with_validation.py -petstore_api/model/string_with_validation.pyi -petstore_api/model/tag.py -petstore_api/model/tag.pyi -petstore_api/model/triangle.py -petstore_api/model/triangle.pyi -petstore_api/model/triangle_interface.py -petstore_api/model/triangle_interface.pyi -petstore_api/model/user.py -petstore_api/model/user.pyi -petstore_api/model/uuid_string.py -petstore_api/model/uuid_string.pyi -petstore_api/model/whale.py -petstore_api/model/whale.pyi -petstore_api/model/zebra.py -petstore_api/model/zebra.pyi -petstore_api/models/__init__.py -petstore_api/rest.py -petstore_api/schemas.py -petstore_api/signing.py -requirements.txt -setup.cfg -setup.py -test-requirements.txt -test/__init__.py -test/test_models/__init__.py -tox.ini diff --git a/samples/openapi3/client/petstore/python-experimental/Makefile b/samples/openapi3/client/petstore/python-experimental/Makefile deleted file mode 100644 index 863c380ebef9..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -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_python.sh \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md deleted file mode 100644 index de83b18c1fff..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/README.md +++ /dev/null @@ -1,420 +0,0 @@ -# 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.PythonExperimentalClientCodegen - -## Requirements. - -Python >=3.7 - -## Migration from other generators like python and python-legacy - -### Changes -1. This generator uses spec case for all (object) property names and parameter names. - - So if the spec has a property name like camelCase, it will use camelCase rather than camel_case - - So you will need to update how you input and read properties to use spec case -2. Endpoint parameters are stored in dictionaries to prevent collisions (explanation below) - - So you will need to update how you pass data in to endpoints -3. Endpoint responses now include the original response, the deserialized response body, and (todo)the deserialized headers - - So you will need to update your code to use response.body to access deserialized data -4. All validated data is instantiated in an instance that subclasses all validated Schema classes and Decimal/str/list/tuple/frozendict/NoneClass/BoolClass/bytes/io.FileIO - - This means that you can use isinstance to check if a payload validated against a schema class - - This means that no data will be of type None/True/False - - ingested None will subclass NoneClass - - ingested True will subclass BoolClass - - ingested False will subclass BoolClass - - So if you need to check is True/False/None, instead use instance.is_true_oapg()/.is_false_oapg()/.is_none_oapg() -5. All validated class instances are immutable except for ones based on io.File - - This is because if properties were changed after validation, that validation would no longer apply - - So no changing values or property values after a class has been instantiated -6. String + Number types with formats - - String type data is stored as a string and if you need to access types based on its format like date, - date-time, uuid, number etc then you will need to use accessor functions on the instance - - type string + format: See .as_date_oapg, .as_datetime_oapg, .as_decimal_oapg, .as_uuid_oapg - - type number + format: See .as_float_oapg, .as_int_oapg - - this was done because openapi/json-schema defines constraints. string data may be type string with no format - keyword in one schema, and include a format constraint in another schema - - So if you need to access a string format based type, use as_date_oapg/as_datetime_oapg/as_decimal_oapg/as_uuid_oapg - - So if you need to access a number format based type, use as_int_oapg/as_float_oapg -7. Property access on AnyType(type unset) or object(dict) schemas - - Only required keys with valid python names are properties like .someProp and have type hints - - All optional keys may not exist, so properties are not defined for them - - One can access optional values with dict_instance['optionalProp'] and KeyError will be raised if it does not exist - - Use get_item_oapg if you need a way to always get a value whether or not the key exists - - If the key does not exist, schemas.unset is returned from calling dict_instance.get_item_oapg('optionalProp') - - All required and optional keys have type hints for this method, and @typing.overload is used - - A type hint is also generated for additionalProperties accessed using this method - - So you will need to update you code to use some_instance['optionalProp'] to access optional property - and additionalProperty values -8. The location of the api classes has changed - - Api classes are located in your_package.apis.tags.some_api - - This change was made to eliminate redundant code generation - - Legacy generators generated the same endpoint twice if it had > 1 tag on it - - This generator defines an endpoint in one class, then inherits that class to generate - apis by tags and by paths - - This change reduces code and allows quicker run time if you use the path apis - - path apis are at your_package.apis.paths.some_path - - Those apis will only load their needed models, which is less to load than all of the resources needed in a tag api - - So you will need to update your import paths to the api classes - -### Why are Oapg and _oapg used in class and method names? -Classes can have arbitrarily named properties set on them -Endpoints can have arbitrary operationId method names set -For those reasons, I use the prefix Oapg and _oapg to greatly reduce the likelihood of collisions -on protected + public classes/methods. -oapg stands for OpenApi Python Generator. - -### Object property spec case -This was done because when payloads are ingested, they can be validated against N number of schemas. -If the input signature used a different property name then that has mutated the payload. -So SchemaA and SchemaB must both see the camelCase spec named variable. -Also it is possible to send in two properties, named camelCase and camel_case in the same payload. -That use case should be support so spec case is used. - -### Parameter spec case -Parameters can be included in different locations including: -- query -- path -- header -- cookie - -Any of those parameters could use the same parameter names, so if every parameter -was included as an endpoint parameter in a function signature, they would collide. -For that reason, each of those inputs have been separated out into separate typed dictionaries: -- query_params -- path_params -- header_params -- cookie_params - -So when updating your code, you will need to pass endpoint parameters in using those -dictionaries. - -### Endpoint responses -Endpoint responses have been enriched to now include more information. -Any response reom an endpoint will now include the following properties: -response: urllib3.HTTPResponse -body: typing.Union[Unset, Schema] -headers: typing.Union[Unset, TODO] -Note: response header deserialization has not yet been added - - -## 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 -import datetimeimport datetimeimport datetimeimport datetimeimport datetimeimport datetimeimport datetime -import time -import petstore_api -from pprint import pprint -from petstore_api.apis import another_fake_api -from petstore_api.model.client import Client -# 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 = another_fake_api.AnotherFakeApi(api_client) - client = Client( - client="client_example", - ) # Client | client model - - try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(client) - pprint(api_response) - except petstore_api.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/apis/tags/AnotherFakeApi.md#call_123_test_special_tags) | **patch** /another-fake/dummy | To test special tags -*DefaultApi* | [**foo_get**](docs/apis/tags/DefaultApi.md#foo_get) | **get** /foo | -*FakeApi* | [**additional_properties_with_array_of_enums**](docs/apis/tags/FakeApi.md#additional_properties_with_array_of_enums) | **get** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums -*FakeApi* | [**array_model**](docs/apis/tags/FakeApi.md#array_model) | **post** /fake/refs/arraymodel | -*FakeApi* | [**array_of_enums**](docs/apis/tags/FakeApi.md#array_of_enums) | **post** /fake/refs/array-of-enums | Array of Enums -*FakeApi* | [**body_with_file_schema**](docs/apis/tags/FakeApi.md#body_with_file_schema) | **put** /fake/body-with-file-schema | -*FakeApi* | [**body_with_query_params**](docs/apis/tags/FakeApi.md#body_with_query_params) | **put** /fake/body-with-query-params | -*FakeApi* | [**boolean**](docs/apis/tags/FakeApi.md#boolean) | **post** /fake/refs/boolean | -*FakeApi* | [**case_sensitive_params**](docs/apis/tags/FakeApi.md#case_sensitive_params) | **put** /fake/case-sensitive-params | -*FakeApi* | [**client_model**](docs/apis/tags/FakeApi.md#client_model) | **patch** /fake | To test \"client\" model -*FakeApi* | [**composed_one_of_different_types**](docs/apis/tags/FakeApi.md#composed_one_of_different_types) | **post** /fake/refs/composed_one_of_number_with_validations | -*FakeApi* | [**delete_coffee**](docs/apis/tags/FakeApi.md#delete_coffee) | **delete** /fake/deleteCoffee/{id} | Delete coffee -*FakeApi* | [**endpoint_parameters**](docs/apis/tags/FakeApi.md#endpoint_parameters) | **post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**enum_parameters**](docs/apis/tags/FakeApi.md#enum_parameters) | **get** /fake | To test enum parameters -*FakeApi* | [**fake_health_get**](docs/apis/tags/FakeApi.md#fake_health_get) | **get** /fake/health | Health check endpoint -*FakeApi* | [**group_parameters**](docs/apis/tags/FakeApi.md#group_parameters) | **delete** /fake | Fake endpoint to test group parameters (optional) -*FakeApi* | [**inline_additional_properties**](docs/apis/tags/FakeApi.md#inline_additional_properties) | **post** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**inline_composition**](docs/apis/tags/FakeApi.md#inline_composition) | **post** /fake/inlineComposition/ | testing composed schemas at inline locations -*FakeApi* | [**json_form_data**](docs/apis/tags/FakeApi.md#json_form_data) | **get** /fake/jsonFormData | test json serialization of form data -*FakeApi* | [**json_patch**](docs/apis/tags/FakeApi.md#json_patch) | **patch** /fake/jsonPatch | json patch -*FakeApi* | [**json_with_charset**](docs/apis/tags/FakeApi.md#json_with_charset) | **post** /fake/jsonWithCharset | json with charset tx and rx -*FakeApi* | [**mammal**](docs/apis/tags/FakeApi.md#mammal) | **post** /fake/refs/mammal | -*FakeApi* | [**number_with_validations**](docs/apis/tags/FakeApi.md#number_with_validations) | **post** /fake/refs/number | -*FakeApi* | [**object_in_query**](docs/apis/tags/FakeApi.md#object_in_query) | **get** /fake/objInQuery | user list -*FakeApi* | [**object_model_with_ref_props**](docs/apis/tags/FakeApi.md#object_model_with_ref_props) | **post** /fake/refs/object_model_with_ref_props | -*FakeApi* | [**parameter_collisions**](docs/apis/tags/FakeApi.md#parameter_collisions) | **post** /fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/ | parameter collision case -*FakeApi* | [**query_parameter_collection_format**](docs/apis/tags/FakeApi.md#query_parameter_collection_format) | **put** /fake/test-query-paramters | -*FakeApi* | [**ref_object_in_query**](docs/apis/tags/FakeApi.md#ref_object_in_query) | **get** /fake/refObjInQuery | user list -*FakeApi* | [**response_without_schema**](docs/apis/tags/FakeApi.md#response_without_schema) | **get** /fake/responseWithoutSchema | receives a response without schema -*FakeApi* | [**string**](docs/apis/tags/FakeApi.md#string) | **post** /fake/refs/string | -*FakeApi* | [**string_enum**](docs/apis/tags/FakeApi.md#string_enum) | **post** /fake/refs/enum | -*FakeApi* | [**upload_download_file**](docs/apis/tags/FakeApi.md#upload_download_file) | **post** /fake/uploadDownloadFile | uploads a file and downloads a file using application/octet-stream -*FakeApi* | [**upload_file**](docs/apis/tags/FakeApi.md#upload_file) | **post** /fake/uploadFile | uploads a file using multipart/form-data -*FakeApi* | [**upload_files**](docs/apis/tags/FakeApi.md#upload_files) | **post** /fake/uploadFiles | uploads files using multipart/form-data -*FakeClassnameTags123Api* | [**classname**](docs/apis/tags/FakeClassnameTags123Api.md#classname) | **patch** /fake_classname_test | To test class name in snake case -*PetApi* | [**add_pet**](docs/apis/tags/PetApi.md#add_pet) | **post** /pet | Add a new pet to the store -*PetApi* | [**delete_pet**](docs/apis/tags/PetApi.md#delete_pet) | **delete** /pet/{petId} | Deletes a pet -*PetApi* | [**find_pets_by_status**](docs/apis/tags/PetApi.md#find_pets_by_status) | **get** /pet/findByStatus | Finds Pets by status -*PetApi* | [**find_pets_by_tags**](docs/apis/tags/PetApi.md#find_pets_by_tags) | **get** /pet/findByTags | Finds Pets by tags -*PetApi* | [**get_pet_by_id**](docs/apis/tags/PetApi.md#get_pet_by_id) | **get** /pet/{petId} | Find pet by ID -*PetApi* | [**update_pet**](docs/apis/tags/PetApi.md#update_pet) | **put** /pet | Update an existing pet -*PetApi* | [**update_pet_with_form**](docs/apis/tags/PetApi.md#update_pet_with_form) | **post** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**upload_file_with_required_file**](docs/apis/tags/PetApi.md#upload_file_with_required_file) | **post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*PetApi* | [**upload_image**](docs/apis/tags/PetApi.md#upload_image) | **post** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**delete_order**](docs/apis/tags/StoreApi.md#delete_order) | **delete** /store/order/{order_id} | Delete purchase order by ID -*StoreApi* | [**get_inventory**](docs/apis/tags/StoreApi.md#get_inventory) | **get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**get_order_by_id**](docs/apis/tags/StoreApi.md#get_order_by_id) | **get** /store/order/{order_id} | Find purchase order by ID -*StoreApi* | [**place_order**](docs/apis/tags/StoreApi.md#place_order) | **post** /store/order | Place an order for a pet -*UserApi* | [**create_user**](docs/apis/tags/UserApi.md#create_user) | **post** /user | Create user -*UserApi* | [**create_users_with_array_input**](docs/apis/tags/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/apis/tags/UserApi.md#create_users_with_list_input) | **post** /user/createWithList | Creates list of users with given input array -*UserApi* | [**delete_user**](docs/apis/tags/UserApi.md#delete_user) | **delete** /user/{username} | Delete user -*UserApi* | [**get_user_by_name**](docs/apis/tags/UserApi.md#get_user_by_name) | **get** /user/{username} | Get user by user name -*UserApi* | [**login_user**](docs/apis/tags/UserApi.md#login_user) | **get** /user/login | Logs user into the system -*UserApi* | [**logout_user**](docs/apis/tags/UserApi.md#logout_user) | **get** /user/logout | Logs out current logged in user session -*UserApi* | [**update_user**](docs/apis/tags/UserApi.md#update_user) | **put** /user/{username} | Updated user - -## Documentation For Models - - - [AdditionalPropertiesClass](docs/models/AdditionalPropertiesClass.md) - - [AdditionalPropertiesValidator](docs/models/AdditionalPropertiesValidator.md) - - [AdditionalPropertiesWithArrayOfEnums](docs/models/AdditionalPropertiesWithArrayOfEnums.md) - - [Address](docs/models/Address.md) - - [Animal](docs/models/Animal.md) - - [AnimalFarm](docs/models/AnimalFarm.md) - - [AnyTypeAndFormat](docs/models/AnyTypeAndFormat.md) - - [AnyTypeNotString](docs/models/AnyTypeNotString.md) - - [ApiResponse](docs/models/ApiResponse.md) - - [Apple](docs/models/Apple.md) - - [AppleReq](docs/models/AppleReq.md) - - [ArrayHoldingAnyType](docs/models/ArrayHoldingAnyType.md) - - [ArrayOfArrayOfNumberOnly](docs/models/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfEnums](docs/models/ArrayOfEnums.md) - - [ArrayOfNumberOnly](docs/models/ArrayOfNumberOnly.md) - - [ArrayTest](docs/models/ArrayTest.md) - - [ArrayWithValidationsInItems](docs/models/ArrayWithValidationsInItems.md) - - [Banana](docs/models/Banana.md) - - [BananaReq](docs/models/BananaReq.md) - - [Bar](docs/models/Bar.md) - - [BasquePig](docs/models/BasquePig.md) - - [Boolean](docs/models/Boolean.md) - - [BooleanEnum](docs/models/BooleanEnum.md) - - [Capitalization](docs/models/Capitalization.md) - - [Cat](docs/models/Cat.md) - - [Category](docs/models/Category.md) - - [ChildCat](docs/models/ChildCat.md) - - [ClassModel](docs/models/ClassModel.md) - - [Client](docs/models/Client.md) - - [ComplexQuadrilateral](docs/models/ComplexQuadrilateral.md) - - [ComposedAnyOfDifferentTypesNoValidations](docs/models/ComposedAnyOfDifferentTypesNoValidations.md) - - [ComposedArray](docs/models/ComposedArray.md) - - [ComposedBool](docs/models/ComposedBool.md) - - [ComposedNone](docs/models/ComposedNone.md) - - [ComposedNumber](docs/models/ComposedNumber.md) - - [ComposedObject](docs/models/ComposedObject.md) - - [ComposedOneOfDifferentTypes](docs/models/ComposedOneOfDifferentTypes.md) - - [ComposedString](docs/models/ComposedString.md) - - [Currency](docs/models/Currency.md) - - [DanishPig](docs/models/DanishPig.md) - - [DateTimeTest](docs/models/DateTimeTest.md) - - [DateTimeWithValidations](docs/models/DateTimeWithValidations.md) - - [DateWithValidations](docs/models/DateWithValidations.md) - - [DecimalPayload](docs/models/DecimalPayload.md) - - [Dog](docs/models/Dog.md) - - [Drawing](docs/models/Drawing.md) - - [EnumArrays](docs/models/EnumArrays.md) - - [EnumClass](docs/models/EnumClass.md) - - [EnumTest](docs/models/EnumTest.md) - - [EquilateralTriangle](docs/models/EquilateralTriangle.md) - - [File](docs/models/File.md) - - [FileSchemaTestClass](docs/models/FileSchemaTestClass.md) - - [Foo](docs/models/Foo.md) - - [FormatTest](docs/models/FormatTest.md) - - [Fruit](docs/models/Fruit.md) - - [FruitReq](docs/models/FruitReq.md) - - [GmFruit](docs/models/GmFruit.md) - - [GrandparentAnimal](docs/models/GrandparentAnimal.md) - - [HasOnlyReadOnly](docs/models/HasOnlyReadOnly.md) - - [HealthCheckResult](docs/models/HealthCheckResult.md) - - [IntegerEnum](docs/models/IntegerEnum.md) - - [IntegerEnumBig](docs/models/IntegerEnumBig.md) - - [IntegerEnumOneValue](docs/models/IntegerEnumOneValue.md) - - [IntegerEnumWithDefaultValue](docs/models/IntegerEnumWithDefaultValue.md) - - [IntegerMax10](docs/models/IntegerMax10.md) - - [IntegerMin15](docs/models/IntegerMin15.md) - - [IsoscelesTriangle](docs/models/IsoscelesTriangle.md) - - [JSONPatchRequest](docs/models/JSONPatchRequest.md) - - [JSONPatchRequestAddReplaceTest](docs/models/JSONPatchRequestAddReplaceTest.md) - - [JSONPatchRequestMoveCopy](docs/models/JSONPatchRequestMoveCopy.md) - - [JSONPatchRequestRemove](docs/models/JSONPatchRequestRemove.md) - - [Mammal](docs/models/Mammal.md) - - [MapTest](docs/models/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/models/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/models/Model200Response.md) - - [ModelReturn](docs/models/ModelReturn.md) - - [Money](docs/models/Money.md) - - [Name](docs/models/Name.md) - - [NoAdditionalProperties](docs/models/NoAdditionalProperties.md) - - [NullableClass](docs/models/NullableClass.md) - - [NullableShape](docs/models/NullableShape.md) - - [NullableString](docs/models/NullableString.md) - - [Number](docs/models/Number.md) - - [NumberOnly](docs/models/NumberOnly.md) - - [NumberWithValidations](docs/models/NumberWithValidations.md) - - [ObjectInterface](docs/models/ObjectInterface.md) - - [ObjectModelWithRefProps](docs/models/ObjectModelWithRefProps.md) - - [ObjectWithDecimalProperties](docs/models/ObjectWithDecimalProperties.md) - - [ObjectWithDifficultlyNamedProps](docs/models/ObjectWithDifficultlyNamedProps.md) - - [ObjectWithInlineCompositionProperty](docs/models/ObjectWithInlineCompositionProperty.md) - - [ObjectWithValidations](docs/models/ObjectWithValidations.md) - - [Order](docs/models/Order.md) - - [ParentPet](docs/models/ParentPet.md) - - [Pet](docs/models/Pet.md) - - [Pig](docs/models/Pig.md) - - [Player](docs/models/Player.md) - - [Quadrilateral](docs/models/Quadrilateral.md) - - [QuadrilateralInterface](docs/models/QuadrilateralInterface.md) - - [ReadOnlyFirst](docs/models/ReadOnlyFirst.md) - - [ScaleneTriangle](docs/models/ScaleneTriangle.md) - - [Shape](docs/models/Shape.md) - - [ShapeOrNull](docs/models/ShapeOrNull.md) - - [SimpleQuadrilateral](docs/models/SimpleQuadrilateral.md) - - [SomeObject](docs/models/SomeObject.md) - - [SpecialModelName](docs/models/SpecialModelName.md) - - [String](docs/models/String.md) - - [StringBooleanMap](docs/models/StringBooleanMap.md) - - [StringEnum](docs/models/StringEnum.md) - - [StringEnumWithDefaultValue](docs/models/StringEnumWithDefaultValue.md) - - [StringWithValidation](docs/models/StringWithValidation.md) - - [Tag](docs/models/Tag.md) - - [Triangle](docs/models/Triangle.md) - - [TriangleInterface](docs/models/TriangleInterface.md) - - [UUIDString](docs/models/UUIDString.md) - - [User](docs/models/User.md) - - [Whale](docs/models/Whale.md) - - [Zebra](docs/models/Zebra.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 - -- **Type**: HTTP signature authentication - - Authentication schemes defined for the API: -## 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 - - - - - - - - - -## Notes for Large OpenAPI documents -If the OpenAPI document is large, imports in petstore_api.apis and petstore_api.models may fail with a -RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: - -Solution 1: -Use specific imports for apis and models like: -- `from petstore_api.apis.default_api import DefaultApi` -- `from petstore_api.model.pet import Pet` - -Solution 1: -Before importing the package, adjust the maximum recursion limit as shown below: -``` -import sys -sys.setrecursionlimit(1500) -import petstore_api -from petstore_api.apis import * -from petstore_api.models import * -``` diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py deleted file mode 100644 index b5d32822d19e..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py +++ /dev/null @@ -1,1498 +0,0 @@ -# coding: utf-8 -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from dataclasses import dataclass -from decimal import Decimal -import enum -import email -import json -import os -import io -import atexit -from multiprocessing.pool import ThreadPool -import re -import tempfile -import typing -import typing_extensions -import urllib3 -from urllib3._collections import HTTPHeaderDict -from urllib.parse import urlparse, quote -from urllib3.fields import RequestField as RequestFieldBase - -import frozendict - -from petstore_api import rest -from petstore_api.configuration import Configuration -from petstore_api.exceptions import ApiTypeError, ApiValueError -from petstore_api.schemas import ( - NoneClass, - BoolClass, - Schema, - FileIO, - BinarySchema, - date, - datetime, - none_type, - Unset, - unset, -) - - -class RequestField(RequestFieldBase): - def __eq__(self, other): - if not isinstance(other, RequestField): - return False - return self.__dict__ == other.__dict__ - - -class JSONEncoder(json.JSONEncoder): - def default(self, obj): - if isinstance(obj, str): - return str(obj) - elif isinstance(obj, float): - return float(obj) - elif isinstance(obj, int): - return int(obj) - elif isinstance(obj, Decimal): - if obj.as_tuple().exponent >= 0: - return int(obj) - return float(obj) - elif isinstance(obj, NoneClass): - return None - elif isinstance(obj, BoolClass): - return bool(obj) - elif isinstance(obj, (dict, frozendict.frozendict)): - return {key: self.default(val) for key, val in obj.items()} - elif isinstance(obj, (list, tuple)): - return [self.default(item) for item in obj] - raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) - - -class ParameterInType(enum.Enum): - QUERY = 'query' - HEADER = 'header' - PATH = 'path' - COOKIE = 'cookie' - - -class ParameterStyle(enum.Enum): - MATRIX = 'matrix' - LABEL = 'label' - FORM = 'form' - SIMPLE = 'simple' - SPACE_DELIMITED = 'spaceDelimited' - PIPE_DELIMITED = 'pipeDelimited' - DEEP_OBJECT = 'deepObject' - - -class PrefixSeparatorIterator: - # A class to store prefixes and separators for rfc6570 expansions - - def __init__(self, prefix: str, separator: str): - self.prefix = prefix - self.separator = separator - self.first = True - if separator in {'.', '|', '%20'}: - item_separator = separator - else: - item_separator = ',' - self.item_separator = item_separator - - def __iter__(self): - return self - - def __next__(self): - if self.first: - self.first = False - return self.prefix - return self.separator - - -class ParameterSerializerBase: - @classmethod - def _get_default_explode(cls, style: ParameterStyle) -> bool: - return False - - @staticmethod - def __ref6570_item_value(in_data: typing.Any, percent_encode: bool): - """ - Get representation if str/float/int/None/items in list/ values in dict - None is returned if an item is undefined, use cases are value= - - None - - [] - - {} - - [None, None None] - - {'a': None, 'b': None} - """ - if type(in_data) in {str, float, int}: - if percent_encode: - return quote(str(in_data)) - return str(in_data) - elif isinstance(in_data, none_type): - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return None - elif isinstance(in_data, list) and not in_data: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return None - elif isinstance(in_data, dict) and not in_data: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return None - raise ApiValueError('Unable to generate a ref6570 item representation of {}'.format(in_data)) - - @staticmethod - def _to_dict(name: str, value: str): - return {name: value} - - @classmethod - def __ref6570_str_float_int_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator, - var_name_piece: str, - named_parameter_expansion: bool - ) -> str: - item_value = cls.__ref6570_item_value(in_data, percent_encode) - if item_value is None or (item_value == '' and prefix_separator_iterator.separator == ';'): - return next(prefix_separator_iterator) + var_name_piece - value_pair_equals = '=' if named_parameter_expansion else '' - return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value - - @classmethod - def __ref6570_list_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator, - var_name_piece: str, - named_parameter_expansion: bool - ) -> str: - item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] - item_values = [v for v in item_values if v is not None] - if not item_values: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - value_pair_equals = '=' if named_parameter_expansion else '' - if not explode: - return ( - next(prefix_separator_iterator) + - var_name_piece + - value_pair_equals + - prefix_separator_iterator.item_separator.join(item_values) - ) - # exploded - return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( - [var_name_piece + value_pair_equals + val for val in item_values] - ) - - @classmethod - def __ref6570_dict_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator, - var_name_piece: str, - named_parameter_expansion: bool - ) -> str: - in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} - in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} - if not in_data_transformed: - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - value_pair_equals = '=' if named_parameter_expansion else '' - if not explode: - return ( - next(prefix_separator_iterator) + - var_name_piece + value_pair_equals + - prefix_separator_iterator.item_separator.join( - prefix_separator_iterator.item_separator.join( - item_pair - ) for item_pair in in_data_transformed.items() - ) - ) - # exploded - return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( - [key + '=' + val for key, val in in_data_transformed.items()] - ) - - @classmethod - def _ref6570_expansion( - cls, - variable_name: str, - in_data: typing.Any, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: PrefixSeparatorIterator - ) -> str: - """ - Separator is for separate variables like dict with explode true, not for array item separation - """ - named_parameter_expansion = prefix_separator_iterator.separator in {'&', ';'} - var_name_piece = variable_name if named_parameter_expansion else '' - if type(in_data) in {str, float, int}: - return cls.__ref6570_str_float_int_expansion( - variable_name, - in_data, - explode, - percent_encode, - prefix_separator_iterator, - var_name_piece, - named_parameter_expansion - ) - elif isinstance(in_data, none_type): - # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 - return "" - elif isinstance(in_data, list): - return cls.__ref6570_list_expansion( - variable_name, - in_data, - explode, - percent_encode, - prefix_separator_iterator, - var_name_piece, - named_parameter_expansion - ) - elif isinstance(in_data, dict): - return cls.__ref6570_dict_expansion( - variable_name, - in_data, - explode, - percent_encode, - prefix_separator_iterator, - var_name_piece, - named_parameter_expansion - ) - # bool, bytes, etc - raise ApiValueError('Unable to generate a ref6570 representation of {}'.format(in_data)) - - -class StyleFormSerializer(ParameterSerializerBase): - @classmethod - def _get_default_explode(cls, style: ParameterStyle) -> bool: - if style is ParameterStyle.FORM: - return True - return super()._get_default_explode(style) - - def _serialize_form( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - name: str, - explode: bool, - percent_encode: bool, - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None - ) -> str: - if prefix_separator_iterator is None: - prefix_separator_iterator = PrefixSeparatorIterator('?', '&') - return self._ref6570_expansion( - variable_name=name, - in_data=in_data, - explode=explode, - percent_encode=percent_encode, - prefix_separator_iterator=prefix_separator_iterator - ) - - -class StyleSimpleSerializer(ParameterSerializerBase): - - def _serialize_simple( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - name: str, - explode: bool, - percent_encode: bool - ) -> str: - prefix_separator_iterator = PrefixSeparatorIterator('', ',') - return self._ref6570_expansion( - variable_name=name, - in_data=in_data, - explode=explode, - percent_encode=percent_encode, - prefix_separator_iterator=prefix_separator_iterator - ) - - -@dataclass -class ParameterBase: - name: str - in_type: ParameterInType - required: bool - style: typing.Optional[ParameterStyle] - explode: typing.Optional[bool] - allow_reserved: typing.Optional[bool] - schema: typing.Optional[typing.Type[Schema]] - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] - - __style_to_in_type = { - ParameterStyle.MATRIX: {ParameterInType.PATH}, - ParameterStyle.LABEL: {ParameterInType.PATH}, - ParameterStyle.FORM: {ParameterInType.QUERY, ParameterInType.COOKIE}, - ParameterStyle.SIMPLE: {ParameterInType.PATH, ParameterInType.HEADER}, - ParameterStyle.SPACE_DELIMITED: {ParameterInType.QUERY}, - ParameterStyle.PIPE_DELIMITED: {ParameterInType.QUERY}, - ParameterStyle.DEEP_OBJECT: {ParameterInType.QUERY}, - } - __in_type_to_default_style = { - ParameterInType.QUERY: ParameterStyle.FORM, - ParameterInType.PATH: ParameterStyle.SIMPLE, - ParameterInType.HEADER: ParameterStyle.SIMPLE, - ParameterInType.COOKIE: ParameterStyle.FORM, - } - __disallowed_header_names = {'Accept', 'Content-Type', 'Authorization'} - _json_encoder = JSONEncoder() - _json_content_type = 'application/json' - - @classmethod - def __verify_style_to_in_type(cls, style: typing.Optional[ParameterStyle], in_type: ParameterInType): - if style is None: - return - in_type_set = cls.__style_to_in_type[style] - if in_type not in in_type_set: - raise ValueError( - 'Invalid style and in_type combination. For style={} only in_type={} are allowed'.format( - style, in_type_set - ) - ) - - def __init__( - self, - name: str, - in_type: ParameterInType, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - if schema is None and content is None: - raise ValueError('Value missing; Pass in either schema or content') - if schema and content: - raise ValueError('Too many values provided. Both schema and content were provided. Only one may be input') - if name in self.__disallowed_header_names and in_type is ParameterInType.HEADER: - raise ValueError('Invalid name, name may not be one of {}'.format(self.__disallowed_header_names)) - self.__verify_style_to_in_type(style, in_type) - if content is None and style is None: - style = self.__in_type_to_default_style[in_type] - if content is not None and in_type in self.__in_type_to_default_style and len(content) != 1: - raise ValueError('Invalid content length, content length must equal 1') - self.in_type = in_type - self.name = name - self.required = required - self.style = style - self.explode = explode - self.allow_reserved = allow_reserved - self.schema = schema - self.content = content - - def _serialize_json( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list] - ) -> str: - return json.dumps(in_data) - - -class PathParameter(ParameterBase, StyleSimpleSerializer): - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - super().__init__( - name, - in_type=ParameterInType.PATH, - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - def __serialize_label( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list] - ) -> typing.Dict[str, str]: - prefix_separator_iterator = PrefixSeparatorIterator('.', '.') - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_matrix( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list] - ) -> typing.Dict[str, str]: - prefix_separator_iterator = PrefixSeparatorIterator(';', ';') - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_simple( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - ) -> typing.Dict[str, str]: - value = self._serialize_simple( - in_data=in_data, - name=self.name, - explode=self.explode, - percent_encode=True - ) - return self._to_dict(self.name, value) - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] - ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - simple -> path - path: - returns path_params: dict - label -> path - returns path_params - matrix -> path - returns path_params - """ - if self.style: - if self.style is ParameterStyle.SIMPLE: - return self.__serialize_simple(cast_in_data) - elif self.style is ParameterStyle.LABEL: - return self.__serialize_label(cast_in_data) - elif self.style is ParameterStyle.MATRIX: - return self.__serialize_matrix(cast_in_data) - # self.content will be length one - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if content_type == self._json_content_type: - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class QueryParameter(ParameterBase, StyleFormSerializer): - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: typing.Optional[bool] = None, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - used_style = ParameterStyle.FORM if style is None and content is None and schema else style - used_explode = self._get_default_explode(used_style) if explode is None else explode - - super().__init__( - name, - in_type=ParameterInType.QUERY, - required=required, - style=used_style, - explode=used_explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - def __serialize_space_delimited( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] - ) -> typing.Dict[str, str]: - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_pipe_delimited( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] - ) -> typing.Dict[str, str]: - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._ref6570_expansion( - variable_name=self.name, - in_data=in_data, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def __serialize_form( - self, - in_data: typing.Union[None, int, float, str, bool, dict, list], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] - ) -> typing.Dict[str, str]: - if prefix_separator_iterator is None: - prefix_separator_iterator = self.get_prefix_separator_iterator() - value = self._serialize_form( - in_data, - name=self.name, - explode=self.explode, - percent_encode=True, - prefix_separator_iterator=prefix_separator_iterator - ) - return self._to_dict(self.name, value) - - def get_prefix_separator_iterator(self) -> typing.Optional[PrefixSeparatorIterator]: - if not self.schema: - return None - if self.style is ParameterStyle.FORM: - return PrefixSeparatorIterator('?', '&') - elif self.style is ParameterStyle.SPACE_DELIMITED: - return PrefixSeparatorIterator('', '%20') - elif self.style is ParameterStyle.PIPE_DELIMITED: - return PrefixSeparatorIterator('', '|') - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], - prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None - ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - form -> query - query: - - GET/HEAD/DELETE: could use fields - - PUT/POST: must use urlencode to send parameters - returns fields: tuple - spaceDelimited -> query - returns fields - pipeDelimited -> query - returns fields - deepObject -> query, https://github.com/OAI/OpenAPI-Specification/issues/1706 - returns fields - """ - if self.style: - # TODO update query ones to omit setting values when [] {} or None is input - if self.style is ParameterStyle.FORM: - return self.__serialize_form(cast_in_data, prefix_separator_iterator) - elif self.style is ParameterStyle.SPACE_DELIMITED: - return self.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) - elif self.style is ParameterStyle.PIPE_DELIMITED: - return self.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) - # self.content will be length one - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if content_type == self._json_content_type: - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class CookieParameter(ParameterBase, StyleFormSerializer): - - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: typing.Optional[bool] = None, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - used_style = ParameterStyle.FORM if style is None and content is None and schema else style - used_explode = self._get_default_explode(used_style) if explode is None else explode - - super().__init__( - name, - in_type=ParameterInType.COOKIE, - required=required, - style=used_style, - explode=used_explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] - ) -> typing.Dict[str, str]: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - form -> cookie - returns fields: tuple - """ - if self.style: - """ - TODO add escaping of comma, space, equals - or turn encoding on - """ - value = self._serialize_form( - cast_in_data, - explode=self.explode, - name=self.name, - percent_encode=False, - prefix_separator_iterator=PrefixSeparatorIterator('', '&') - ) - return self._to_dict(self.name, value) - # self.content will be length one - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if content_type == self._json_content_type: - value = self._serialize_json(cast_in_data) - return self._to_dict(self.name, value) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class HeaderParameter(ParameterBase, StyleSimpleSerializer): - def __init__( - self, - name: str, - required: bool = False, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: typing.Optional[bool] = None, - schema: typing.Optional[typing.Type[Schema]] = None, - content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None - ): - super().__init__( - name, - in_type=ParameterInType.HEADER, - required=required, - style=style, - explode=explode, - allow_reserved=allow_reserved, - schema=schema, - content=content - ) - - @staticmethod - def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHeaderDict: - data = tuple(t for t in in_data if t) - headers = HTTPHeaderDict() - if not data: - return headers - headers.extend(data) - return headers - - def serialize( - self, - in_data: typing.Union[ - Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] - ) -> HTTPHeaderDict: - if self.schema: - cast_in_data = self.schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - """ - simple -> header - headers: PoolManager needs a mapping, tuple is close - returns headers: dict - """ - if self.style: - value = self._serialize_simple(cast_in_data, self.name, self.explode, False) - return self.__to_headers(((self.name, value),)) - # self.content will be length one - for content_type, schema in self.content.items(): - cast_in_data = schema(in_data) - cast_in_data = self._json_encoder.default(cast_in_data) - if content_type == self._json_content_type: - value = self._serialize_json(cast_in_data) - return self.__to_headers(((self.name, value),)) - raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) - - -class Encoding: - def __init__( - self, - content_type: str, - headers: typing.Optional[typing.Dict[str, HeaderParameter]] = None, - style: typing.Optional[ParameterStyle] = None, - explode: bool = False, - allow_reserved: bool = False, - ): - self.content_type = content_type - self.headers = headers - self.style = style - self.explode = explode - self.allow_reserved = allow_reserved - - -@dataclass -class MediaType: - """ - Used to store request and response body schema information - encoding: - A map between a property name and its encoding information. - The key, being the property name, MUST exist in the schema as a property. - The encoding object SHALL only apply to requestBody objects when the media type is - multipart or application/x-www-form-urlencoded. - """ - schema: typing.Optional[typing.Type[Schema]] = None - encoding: typing.Optional[typing.Dict[str, Encoding]] = None - - -@dataclass -class ApiResponse: - response: urllib3.HTTPResponse - body: typing.Union[Unset, Schema] - headers: typing.Union[Unset, typing.List[HeaderParameter]] - - def __init__( - self, - response: urllib3.HTTPResponse, - body: typing.Union[Unset, typing.Type[Schema]], - headers: typing.Union[Unset, typing.List[HeaderParameter]] - ): - """ - pycharm needs this to prevent 'Unexpected argument' warnings - """ - self.response = response - self.body = body - self.headers = headers - - -@dataclass -class ApiResponseWithoutDeserialization(ApiResponse): - response: urllib3.HTTPResponse - body: typing.Union[Unset, typing.Type[Schema]] = unset - headers: typing.Union[Unset, typing.List[HeaderParameter]] = unset - - -class JSONDetector: - """ - Works for: - application/json - application/json; charset=UTF-8 - application/json-patch+json - application/geo+json - """ - __json_content_type_pattern = re.compile("application/[^+]*[+]?(json);?.*") - - @classmethod - def _content_type_is_json(cls, content_type: str) -> bool: - if cls.__json_content_type_pattern.match(content_type): - return True - return False - - -class OpenApiResponse(JSONDetector): - __filename_content_disposition_pattern = re.compile('filename="(.+?)"') - - def __init__( - self, - response_cls: typing.Type[ApiResponse] = ApiResponse, - content: typing.Optional[typing.Dict[str, MediaType]] = None, - headers: typing.Optional[typing.List[HeaderParameter]] = None, - ): - self.headers = headers - if content is not None and len(content) == 0: - raise ValueError('Invalid value for content, the content dict must have >= 1 entry') - self.content = content - self.response_cls = response_cls - - @staticmethod - def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: - # python must be >= 3.9 so we can pass in bytes into json.loads - return json.loads(response.data) - - @staticmethod - def __file_name_from_response_url(response_url: typing.Optional[str]) -> typing.Optional[str]: - if response_url is None: - return None - url_path = urlparse(response_url).path - if url_path: - path_basename = os.path.basename(url_path) - if path_basename: - _filename, ext = os.path.splitext(path_basename) - if ext: - return path_basename - return None - - @classmethod - def __file_name_from_content_disposition(cls, content_disposition: typing.Optional[str]) -> typing.Optional[str]: - if content_disposition is None: - return None - match = cls.__filename_content_disposition_pattern.search(content_disposition) - if not match: - return None - return match.group(1) - - def __deserialize_application_octet_stream( - self, response: urllib3.HTTPResponse - ) -> typing.Union[bytes, io.BufferedReader]: - """ - urllib3 use cases: - 1. when preload_content=True (stream=False) then supports_chunked_reads is False and bytes are returned - 2. when preload_content=False (stream=True) then supports_chunked_reads is True and - a file will be written and returned - """ - if response.supports_chunked_reads(): - file_name = ( - self.__file_name_from_content_disposition(response.headers.get('content-disposition')) - or self.__file_name_from_response_url(response.geturl()) - ) - - if file_name is None: - _fd, path = tempfile.mkstemp() - else: - path = os.path.join(tempfile.gettempdir(), file_name) - - with open(path, 'wb') as new_file: - chunk_size = 1024 - while True: - data = response.read(chunk_size) - if not data: - break - new_file.write(data) - # release_conn is needed for streaming connections only - response.release_conn() - new_file = open(path, 'rb') - return new_file - else: - return response.data - - @staticmethod - def __deserialize_multipart_form_data( - response: urllib3.HTTPResponse - ) -> typing.Dict[str, typing.Any]: - msg = email.message_from_bytes(response.data) - return { - part.get_param("name", header="Content-Disposition"): part.get_payload( - decode=True - ).decode(part.get_content_charset()) - if part.get_content_charset() - else part.get_payload() - for part in msg.get_payload() - } - - def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> ApiResponse: - content_type = response.getheader('content-type') - deserialized_body = unset - streamed = response.supports_chunked_reads() - - deserialized_headers = unset - if self.headers is not None: - # TODO add header deserialiation here - pass - - if self.content is not None: - if content_type not in self.content: - raise ApiValueError( - f"Invalid content_type returned. Content_type='{content_type}' was returned " - f"when only {str(set(self.content))} are defined for status_code={str(response.status)}" - ) - body_schema = self.content[content_type].schema - if body_schema is None: - # some specs do not define response content media type schemas - return self.response_cls( - response=response, - headers=deserialized_headers, - body=unset - ) - - if self._content_type_is_json(content_type): - body_data = self.__deserialize_json(response) - elif content_type == 'application/octet-stream': - body_data = self.__deserialize_application_octet_stream(response) - elif content_type.startswith('multipart/form-data'): - body_data = self.__deserialize_multipart_form_data(response) - content_type = 'multipart/form-data' - else: - raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) - deserialized_body = body_schema.from_openapi_data_oapg( - body_data, _configuration=configuration) - elif streamed: - response.release_conn() - - return self.response_cls( - response=response, - headers=deserialized_headers, - body=deserialized_body - ) - - -class ApiClient: - """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. - """ - - _pool = None - - def __init__( - self, - configuration: typing.Optional[Configuration] = None, - header_name: typing.Optional[str] = None, - header_value: typing.Optional[str] = None, - cookie: typing.Optional[str] = None, - pool_threads: int = 1 - ): - if configuration is None: - configuration = Configuration() - 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' - - 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 - - def __call_api( - self, - resource_path: str, - method: str, - headers: typing.Optional[HTTPHeaderDict] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - host: typing.Optional[str] = None, - ) -> urllib3.HTTPResponse: - - # header parameters - headers = headers or {} - headers.update(self.default_headers) - if self.cookie: - headers['Cookie'] = self.cookie - - # auth setting - self.update_params_for_auth(headers, - auth_settings, resource_path, method, 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 - - # perform request and return response - response = self.request( - method, - url, - headers=headers, - fields=fields, - body=body, - stream=stream, - timeout=timeout, - ) - return response - - def call_api( - self, - resource_path: str, - method: str, - headers: typing.Optional[HTTPHeaderDict] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - host: typing.Optional[str] = None, - ) -> urllib3.HTTPResponse: - """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 headers: Header parameters to be - placed in the request header. - :param body: Request body. - :param fields: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings: Auth Settings names for the request. - :param async_req: execute request asynchronously - :type async_req: bool, optional TODO remove, unused - :param stream: if True, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Also when True, if the openapi spec describes a file download, - the data will be written to a local filesystme file and the BinarySchema - instance will also inherit from FileSchema and FileIO - Default is False. - :type stream: bool, optional - :param 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 host: api endpoint host - :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, - headers, - body, - fields, - auth_settings, - stream, - timeout, - host, - ) - - return self.pool.apply_async( - self.__call_api, - ( - resource_path, - method, - headers, - body, - json, - fields, - auth_settings, - stream, - timeout, - host, - ) - ) - - def request( - self, - method: str, - url: str, - headers: typing.Optional[HTTPHeaderDict] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> urllib3.HTTPResponse: - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - stream=stream, - timeout=timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - stream=stream, - timeout=timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - headers=headers, - fields=fields, - stream=stream, - timeout=timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - headers=headers, - stream=stream, - timeout=timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def update_params_for_auth(self, headers, auth_settings, - resource_path, method, body): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). - """ - if not auth_settings: - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if not auth_setting: - continue - if auth_setting['in'] == 'cookie': - headers.add('Cookie', auth_setting['value']) - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers.add(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 - querys = tuple() - auth_headers = signing_info.get_http_signature_headers( - resource_path, method, headers, body, querys) - for key, value in auth_headers.items(): - headers.add(key, value) - elif auth_setting['in'] == 'query': - """ TODO implement auth in query - need to pass in prefix_separator_iterator - and need to output resource_path with query params added - """ - raise ApiValueError("Auth in query not yet implemented") - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - -class Api: - """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: typing.Optional[ApiClient] = None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - @staticmethod - def _verify_typed_dict_inputs_oapg(cls: typing.Type[typing_extensions.TypedDict], data: typing.Dict[str, typing.Any]): - """ - Ensures that: - - required keys are present - - additional properties are not input - - value stored under required keys do not have the value unset - Note: detailed value checking is done in schema classes - """ - missing_required_keys = [] - required_keys_with_unset_values = [] - for required_key in cls.__required_keys__: - if required_key not in data: - missing_required_keys.append(required_key) - continue - value = data[required_key] - if value is unset: - required_keys_with_unset_values.append(required_key) - if missing_required_keys: - raise ApiTypeError( - '{} missing {} required arguments: {}'.format( - cls.__name__, len(missing_required_keys), missing_required_keys - ) - ) - if required_keys_with_unset_values: - raise ApiValueError( - '{} contains invalid unset values for {} required keys: {}'.format( - cls.__name__, len(required_keys_with_unset_values), required_keys_with_unset_values - ) - ) - - disallowed_additional_keys = [] - for key in data: - if key in cls.__required_keys__ or key in cls.__optional_keys__: - continue - disallowed_additional_keys.append(key) - if disallowed_additional_keys: - raise ApiTypeError( - '{} got {} unexpected keyword arguments: {}'.format( - cls.__name__, len(disallowed_additional_keys), disallowed_additional_keys - ) - ) - - def _get_host_oapg( - self, - operation_id: str, - servers: typing.Tuple[typing.Dict[str, str], ...] = tuple(), - host_index: typing.Optional[int] = None - ) -> typing.Optional[str]: - configuration = self.api_client.configuration - try: - if host_index is None: - index = configuration.server_operation_index.get( - operation_id, configuration.server_index - ) - else: - index = host_index - server_variables = configuration.server_operation_variables.get( - operation_id, configuration.server_variables - ) - host = configuration.get_host_from_settings( - index, variables=server_variables, servers=servers - ) - except IndexError: - if servers: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(servers) - ) - host = None - return host - - -class SerializedRequestBody(typing_extensions.TypedDict, total=False): - body: typing.Union[str, bytes] - fields: typing.Tuple[typing.Union[RequestField, typing.Tuple[str, str]], ...] - - -class RequestBody(StyleFormSerializer, JSONDetector): - """ - A request body parameter - content: content_type to MediaType Schema info - """ - __json_encoder = JSONEncoder() - - def __init__( - self, - content: typing.Dict[str, MediaType], - required: bool = False, - ): - self.required = required - if len(content) == 0: - raise ValueError('Invalid value for content, the content dict must have >= 1 entry') - self.content = content - - def __serialize_json( - self, - in_data: typing.Any - ) -> typing.Dict[str, bytes]: - in_data = self.__json_encoder.default(in_data) - json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( - "utf-8" - ) - return dict(body=json_str) - - @staticmethod - def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: - if isinstance(in_data, frozendict.frozendict): - raise ValueError('Unable to serialize type frozendict.frozendict to text/plain') - elif isinstance(in_data, tuple): - raise ValueError('Unable to serialize type tuple to text/plain') - elif isinstance(in_data, NoneClass): - raise ValueError('Unable to serialize type NoneClass to text/plain') - elif isinstance(in_data, BoolClass): - raise ValueError('Unable to serialize type BoolClass to text/plain') - return dict(body=str(in_data)) - - def __multipart_json_item(self, key: str, value: Schema) -> RequestField: - json_value = self.__json_encoder.default(value) - return RequestField(name=key, data=json.dumps(json_value), headers={'Content-Type': 'application/json'}) - - def __multipart_form_item(self, key: str, value: Schema) -> RequestField: - if isinstance(value, str): - return RequestField(name=key, data=str(value), headers={'Content-Type': 'text/plain'}) - elif isinstance(value, bytes): - return RequestField(name=key, data=value, headers={'Content-Type': 'application/octet-stream'}) - elif isinstance(value, FileIO): - request_field = RequestField( - name=key, - data=value.read(), - filename=os.path.basename(value.name), - headers={'Content-Type': 'application/octet-stream'} - ) - value.close() - return request_field - else: - return self.__multipart_json_item(key=key, value=value) - - def __serialize_multipart_form_data( - self, in_data: Schema - ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: - if not isinstance(in_data, frozendict.frozendict): - raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') - """ - In a multipart/form-data request body, each schema property, or each element of a schema array property, - takes a section in the payload with an internal header as defined by RFC7578. The serialization strategy - for each property of a multipart/form-data request body can be specified in an associated Encoding Object. - - When passing in multipart types, boundaries MAY be used to separate sections of the content being - transferred – thus, the following default Content-Types are defined for multipart: - - If the (object) property is a primitive, or an array of primitive values, the default Content-Type is text/plain - If the property is complex, or an array of complex values, the default Content-Type is application/json - Question: how is the array of primitives encoded? - If the property is a type: string with a contentEncoding, the default Content-Type is application/octet-stream - """ - fields = [] - for key, value in in_data.items(): - if isinstance(value, tuple): - if value: - # values use explode = True, so the code makes a RequestField for each item with name=key - for item in value: - request_field = self.__multipart_form_item(key=key, value=item) - fields.append(request_field) - else: - # send an empty array as json because exploding will not send it - request_field = self.__multipart_json_item(key=key, value=value) - fields.append(request_field) - else: - request_field = self.__multipart_form_item(key=key, value=value) - fields.append(request_field) - - return dict(fields=tuple(fields)) - - def __serialize_application_octet_stream(self, in_data: BinarySchema) -> typing.Dict[str, bytes]: - if isinstance(in_data, bytes): - return dict(body=in_data) - # FileIO type - result = dict(body=in_data.read()) - in_data.close() - return result - - def __serialize_application_x_www_form_data( - self, in_data: typing.Any - ) -> SerializedRequestBody: - """ - POST submission of form data in body - """ - if not isinstance(in_data, frozendict.frozendict): - raise ValueError( - f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') - cast_in_data = self.__json_encoder.default(in_data) - value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=False) - return dict(body=value) - - def serialize( - self, in_data: typing.Any, content_type: str - ) -> SerializedRequestBody: - """ - If a str is returned then the result will be assigned to data when making the request - If a tuple is returned then the result will be used as fields input in encode_multipart_formdata - Return a tuple of - - The key of the return dict is - - body for application/json - - encode_multipart and fields for multipart/form-data - """ - media_type = self.content[content_type] - if isinstance(in_data, media_type.schema): - cast_in_data = in_data - elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: - cast_in_data = media_type.schema(**in_data) - else: - cast_in_data = media_type.schema(in_data) - # TODO check for and use encoding if it exists - # and content_type is multipart or application/x-www-form-urlencoded - if self._content_type_is_json(content_type): - return self.__serialize_json(cast_in_data) - elif content_type == 'text/plain': - return self.__serialize_text_plain(cast_in_data) - elif content_type == 'multipart/form-data': - return self.__serialize_multipart_form_data(cast_in_data) - elif content_type == 'application/x-www-form-urlencoded': - return self.__serialize_application_x_www_form_data(cast_in_data) - elif content_type == 'application/octet-stream': - return self.__serialize_application_octet_stream(cast_in_data) - raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/__init__.py deleted file mode 100644 index 7840f7726f6a..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints then import them from -# tags, paths, or path_to_api, or tag_to_api \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py deleted file mode 100644 index 79ca58cf2307..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py +++ /dev/null @@ -1,307 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AdditionalPropertiesClass( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class map_property( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.StrSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'map_property': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - - - class map_of_map_property( - schemas.DictSchema - ): - - - class MetaOapg: - - - class additional_properties( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.StrSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'additional_properties': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ], - ) -> 'map_of_map_property': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - anytype_1 = schemas.AnyTypeSchema - map_with_undeclared_properties_anytype_1 = schemas.DictSchema - map_with_undeclared_properties_anytype_2 = schemas.DictSchema - - - class map_with_undeclared_properties_anytype_3( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.AnyTypeSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - ) -> 'map_with_undeclared_properties_anytype_3': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - - - class empty_map( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.NotAnyTypeSchema - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'empty_map': - return super().__new__( - cls, - *args, - _configuration=_configuration, - ) - - - class map_with_undeclared_properties_string( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.StrSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'map_with_undeclared_properties_string': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "map_property": map_property, - "map_of_map_property": map_of_map_property, - "anytype_1": anytype_1, - "map_with_undeclared_properties_anytype_1": map_with_undeclared_properties_anytype_1, - "map_with_undeclared_properties_anytype_2": map_with_undeclared_properties_anytype_2, - "map_with_undeclared_properties_anytype_3": map_with_undeclared_properties_anytype_3, - "empty_map": empty_map, - "map_with_undeclared_properties_string": map_with_undeclared_properties_string, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_property"]) -> MetaOapg.properties.map_property: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_of_map_property"]) -> MetaOapg.properties.map_of_map_property: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["anytype_1"]) -> MetaOapg.properties.anytype_1: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_1"]) -> MetaOapg.properties.map_with_undeclared_properties_anytype_1: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_2"]) -> MetaOapg.properties.map_with_undeclared_properties_anytype_2: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_3"]) -> MetaOapg.properties.map_with_undeclared_properties_anytype_3: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["empty_map"]) -> MetaOapg.properties.empty_map: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_string"]) -> MetaOapg.properties.map_with_undeclared_properties_string: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["map_property", "map_of_map_property", "anytype_1", "map_with_undeclared_properties_anytype_1", "map_with_undeclared_properties_anytype_2", "map_with_undeclared_properties_anytype_3", "empty_map", "map_with_undeclared_properties_string", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_property"]) -> typing.Union[MetaOapg.properties.map_property, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_of_map_property"]) -> typing.Union[MetaOapg.properties.map_of_map_property, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["anytype_1"]) -> typing.Union[MetaOapg.properties.anytype_1, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_1"]) -> typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_1, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_2"]) -> typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_2, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_3"]) -> typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_3, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["empty_map"]) -> typing.Union[MetaOapg.properties.empty_map, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_with_undeclared_properties_string"]) -> typing.Union[MetaOapg.properties.map_with_undeclared_properties_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["map_property", "map_of_map_property", "anytype_1", "map_with_undeclared_properties_anytype_1", "map_with_undeclared_properties_anytype_2", "map_with_undeclared_properties_anytype_3", "empty_map", "map_with_undeclared_properties_string", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - map_property: typing.Union[MetaOapg.properties.map_property, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - map_of_map_property: typing.Union[MetaOapg.properties.map_of_map_property, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - anytype_1: typing.Union[MetaOapg.properties.anytype_1, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - map_with_undeclared_properties_anytype_1: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_1, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - map_with_undeclared_properties_anytype_2: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_2, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - map_with_undeclared_properties_anytype_3: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_3, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - empty_map: typing.Union[MetaOapg.properties.empty_map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - map_with_undeclared_properties_string: typing.Union[MetaOapg.properties.map_with_undeclared_properties_string, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'AdditionalPropertiesClass': - return super().__new__( - cls, - *args, - map_property=map_property, - map_of_map_property=map_of_map_property, - anytype_1=anytype_1, - map_with_undeclared_properties_anytype_1=map_with_undeclared_properties_anytype_1, - map_with_undeclared_properties_anytype_2=map_with_undeclared_properties_anytype_2, - map_with_undeclared_properties_anytype_3=map_with_undeclared_properties_anytype_3, - empty_map=empty_map, - map_with_undeclared_properties_string=map_with_undeclared_properties_string, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py deleted file mode 100644 index 2a0bbc303134..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AdditionalPropertiesWithArrayOfEnums( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class additional_properties( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['EnumClass']: - return EnumClass - - def __new__( - cls, - arg: typing.Union[typing.Tuple['EnumClass'], typing.List['EnumClass']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'additional_properties': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'EnumClass': - return super().__getitem__(i) - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, list, tuple, ], - ) -> 'AdditionalPropertiesWithArrayOfEnums': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.enum_class import EnumClass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py deleted file mode 100644 index 64fb96cfb9fa..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Address( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - additional_properties = schemas.IntSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, decimal.Decimal, int, ], - ) -> 'Address': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py deleted file mode 100644 index 06d7246fa33a..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Animal( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "className", - } - - @staticmethod - def discriminator(): - return { - 'className': { - 'Cat': Cat, - 'Dog': Dog, - } - } - - class properties: - className = schemas.StrSchema - color = schemas.StrSchema - __annotations__ = { - "className": className, - "color": color, - } - - className: MetaOapg.properties.className - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["color"]) -> MetaOapg.properties.color: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["className", "color", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["color"]) -> typing.Union[MetaOapg.properties.color, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className", "color", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - className: typing.Union[MetaOapg.properties.className, str, ], - color: typing.Union[MetaOapg.properties.color, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Animal': - return super().__new__( - cls, - *args, - className=className, - color=color, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.cat import Cat -from petstore_api.model.dog import Dog diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py deleted file mode 100644 index 082a4988ce73..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AnimalFarm( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['Animal']: - return Animal - - def __new__( - cls, - arg: typing.Union[typing.Tuple['Animal'], typing.List['Animal']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'AnimalFarm': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'Animal': - return super().__getitem__(i) - -from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py deleted file mode 100644 index 236e29d4e780..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ApiResponse( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - code = schemas.Int32Schema - type = schemas.StrSchema - message = schemas.StrSchema - __annotations__ = { - "code": code, - "type": type, - "message": message, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["code"]) -> MetaOapg.properties.code: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["type"]) -> MetaOapg.properties.type: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["message"]) -> MetaOapg.properties.message: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["code", "type", "message", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["code"]) -> typing.Union[MetaOapg.properties.code, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["type"]) -> typing.Union[MetaOapg.properties.type, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["message"]) -> typing.Union[MetaOapg.properties.message, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["code", "type", "message", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - code: typing.Union[MetaOapg.properties.code, decimal.Decimal, int, schemas.Unset] = schemas.unset, - type: typing.Union[MetaOapg.properties.type, str, schemas.Unset] = schemas.unset, - message: typing.Union[MetaOapg.properties.message, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ApiResponse': - return super().__new__( - cls, - *args, - code=code, - type=type, - message=message, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py deleted file mode 100644 index 638edc274dc5..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Apple( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "cultivar", - } - - class properties: - - - class cultivar( - schemas.StrSchema - ): - - - class MetaOapg: - regex=[{ - 'pattern': r'^[a-zA-Z\s]*$', # noqa: E501 - }] - - - class origin( - schemas.StrSchema - ): - - - class MetaOapg: - regex=[{ - 'pattern': r'^[A-Z\s]*$', # noqa: E501 - 'flags': ( - re.IGNORECASE - ) - }] - __annotations__ = { - "cultivar": cultivar, - "origin": origin, - } - - - cultivar: MetaOapg.properties.cultivar - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["origin"]) -> MetaOapg.properties.origin: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["cultivar", "origin", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["origin"]) -> typing.Union[MetaOapg.properties.origin, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["cultivar", "origin", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, None, ], - origin: typing.Union[MetaOapg.properties.origin, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Apple': - return super().__new__( - cls, - *args, - origin=origin, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py deleted file mode 100644 index 03d83c22cffc..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class AppleReq( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "cultivar", - } - - class properties: - cultivar = schemas.StrSchema - mealy = schemas.BoolSchema - __annotations__ = { - "cultivar": cultivar, - "mealy": mealy, - } - additional_properties = schemas.NotAnyTypeSchema - - cultivar: MetaOapg.properties.cultivar - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["mealy"]) -> MetaOapg.properties.mealy: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["cultivar"], typing_extensions.Literal["mealy"], ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["mealy"]) -> typing.Union[MetaOapg.properties.mealy, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["cultivar"], typing_extensions.Literal["mealy"], ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - cultivar: typing.Union[MetaOapg.properties.cultivar, str, ], - mealy: typing.Union[MetaOapg.properties.mealy, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'AppleReq': - return super().__new__( - cls, - *args, - cultivar=cultivar, - mealy=mealy, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py deleted file mode 100644 index 5237741d8382..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ArrayOfArrayOfNumberOnly( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class ArrayArrayNumber( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.NumberSchema - - def __new__( - cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'items': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - def __new__( - cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, list, tuple, ]], typing.List[typing.Union[MetaOapg.items, list, tuple, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ArrayArrayNumber': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - __annotations__ = { - "ArrayArrayNumber": ArrayArrayNumber, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["ArrayArrayNumber"]) -> MetaOapg.properties.ArrayArrayNumber: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["ArrayArrayNumber", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["ArrayArrayNumber"]) -> typing.Union[MetaOapg.properties.ArrayArrayNumber, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["ArrayArrayNumber", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - ArrayArrayNumber: typing.Union[MetaOapg.properties.ArrayArrayNumber, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ArrayOfArrayOfNumberOnly': - return super().__new__( - cls, - *args, - ArrayArrayNumber=ArrayArrayNumber, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py deleted file mode 100644 index d7eb9d4838d5..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ArrayOfEnums( - schemas.ListSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['StringEnum']: - return StringEnum - - def __new__( - cls, - arg: typing.Union[typing.Tuple['StringEnum'], typing.List['StringEnum']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ArrayOfEnums': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'StringEnum': - return super().__getitem__(i) - -from petstore_api.model.string_enum import StringEnum diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py deleted file mode 100644 index 9c5a9b55d24c..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ArrayOfNumberOnly( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class ArrayNumber( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.NumberSchema - - def __new__( - cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'ArrayNumber': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - __annotations__ = { - "ArrayNumber": ArrayNumber, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["ArrayNumber"]) -> MetaOapg.properties.ArrayNumber: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["ArrayNumber", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["ArrayNumber"]) -> typing.Union[MetaOapg.properties.ArrayNumber, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["ArrayNumber", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - ArrayNumber: typing.Union[MetaOapg.properties.ArrayNumber, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ArrayOfNumberOnly': - return super().__new__( - cls, - *args, - ArrayNumber=ArrayNumber, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py deleted file mode 100644 index d53b0df62d3e..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py +++ /dev/null @@ -1,213 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ArrayTest( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class array_of_string( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.StrSchema - - def __new__( - cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_of_string': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - - class array_array_of_integer( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.Int64Schema - - def __new__( - cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'items': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - def __new__( - cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, list, tuple, ]], typing.List[typing.Union[MetaOapg.items, list, tuple, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_array_of_integer': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - - class array_array_of_model( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['ReadOnlyFirst']: - return ReadOnlyFirst - - def __new__( - cls, - arg: typing.Union[typing.Tuple['ReadOnlyFirst'], typing.List['ReadOnlyFirst']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'items': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'ReadOnlyFirst': - return super().__getitem__(i) - - def __new__( - cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, list, tuple, ]], typing.List[typing.Union[MetaOapg.items, list, tuple, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_array_of_model': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - __annotations__ = { - "array_of_string": array_of_string, - "array_array_of_integer": array_array_of_integer, - "array_array_of_model": array_array_of_model, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_of_string"]) -> MetaOapg.properties.array_of_string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_array_of_integer"]) -> MetaOapg.properties.array_array_of_integer: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_array_of_model"]) -> MetaOapg.properties.array_array_of_model: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["array_of_string", "array_array_of_integer", "array_array_of_model", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_of_string"]) -> typing.Union[MetaOapg.properties.array_of_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_array_of_integer"]) -> typing.Union[MetaOapg.properties.array_array_of_integer, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_array_of_model"]) -> typing.Union[MetaOapg.properties.array_array_of_model, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["array_of_string", "array_array_of_integer", "array_array_of_model", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - array_of_string: typing.Union[MetaOapg.properties.array_of_string, list, tuple, schemas.Unset] = schemas.unset, - array_array_of_integer: typing.Union[MetaOapg.properties.array_array_of_integer, list, tuple, schemas.Unset] = schemas.unset, - array_array_of_model: typing.Union[MetaOapg.properties.array_array_of_model, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ArrayTest': - return super().__new__( - cls, - *args, - array_of_string=array_of_string, - array_array_of_integer=array_array_of_integer, - array_array_of_model=array_array_of_model, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.read_only_first import ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py deleted file mode 100644 index b3d1c7d792df..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py +++ /dev/null @@ -1,83 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Banana( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "lengthCm", - } - - class properties: - lengthCm = schemas.NumberSchema - __annotations__ = { - "lengthCm": lengthCm, - } - - lengthCm: MetaOapg.properties.lengthCm - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["lengthCm", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["lengthCm", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - lengthCm: typing.Union[MetaOapg.properties.lengthCm, decimal.Decimal, int, float, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Banana': - return super().__new__( - cls, - *args, - lengthCm=lengthCm, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py deleted file mode 100644 index 1fdfa7d34acf..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class BananaReq( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "lengthCm", - } - - class properties: - lengthCm = schemas.NumberSchema - sweet = schemas.BoolSchema - __annotations__ = { - "lengthCm": lengthCm, - "sweet": sweet, - } - additional_properties = schemas.NotAnyTypeSchema - - lengthCm: MetaOapg.properties.lengthCm - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["sweet"]) -> MetaOapg.properties.sweet: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["lengthCm"], typing_extensions.Literal["sweet"], ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["sweet"]) -> typing.Union[MetaOapg.properties.sweet, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["lengthCm"], typing_extensions.Literal["sweet"], ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - lengthCm: typing.Union[MetaOapg.properties.lengthCm, decimal.Decimal, int, float, ], - sweet: typing.Union[MetaOapg.properties.sweet, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'BananaReq': - return super().__new__( - cls, - *args, - lengthCm=lengthCm, - sweet=sweet, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py deleted file mode 100644 index 528cfa498b0d..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class BasquePig( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "className", - } - - class properties: - - - class className( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "BasquePig": "BASQUE_PIG", - } - - @schemas.classproperty - def BASQUE_PIG(cls): - return cls("BasquePig") - __annotations__ = { - "className": className, - } - - className: MetaOapg.properties.className - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["className", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - className: typing.Union[MetaOapg.properties.className, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'BasquePig': - return super().__new__( - cls, - *args, - className=className, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py deleted file mode 100644 index 66d5be713125..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class BooleanEnum( - schemas.EnumBase, - schemas.BoolSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - schemas.BoolClass.TRUE: "TRUE", - } - - @schemas.classproperty - def TRUE(cls): - return cls(True) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py deleted file mode 100644 index 3dc195865d41..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py +++ /dev/null @@ -1,128 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Capitalization( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - smallCamel = schemas.StrSchema - CapitalCamel = schemas.StrSchema - small_Snake = schemas.StrSchema - Capital_Snake = schemas.StrSchema - SCA_ETH_Flow_Points = schemas.StrSchema - ATT_NAME = schemas.StrSchema - __annotations__ = { - "smallCamel": smallCamel, - "CapitalCamel": CapitalCamel, - "small_Snake": small_Snake, - "Capital_Snake": Capital_Snake, - "SCA_ETH_Flow_Points": SCA_ETH_Flow_Points, - "ATT_NAME": ATT_NAME, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["smallCamel"]) -> MetaOapg.properties.smallCamel: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["CapitalCamel"]) -> MetaOapg.properties.CapitalCamel: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["small_Snake"]) -> MetaOapg.properties.small_Snake: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["Capital_Snake"]) -> MetaOapg.properties.Capital_Snake: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["SCA_ETH_Flow_Points"]) -> MetaOapg.properties.SCA_ETH_Flow_Points: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["ATT_NAME"]) -> MetaOapg.properties.ATT_NAME: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["smallCamel", "CapitalCamel", "small_Snake", "Capital_Snake", "SCA_ETH_Flow_Points", "ATT_NAME", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["smallCamel"]) -> typing.Union[MetaOapg.properties.smallCamel, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["CapitalCamel"]) -> typing.Union[MetaOapg.properties.CapitalCamel, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["small_Snake"]) -> typing.Union[MetaOapg.properties.small_Snake, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["Capital_Snake"]) -> typing.Union[MetaOapg.properties.Capital_Snake, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["SCA_ETH_Flow_Points"]) -> typing.Union[MetaOapg.properties.SCA_ETH_Flow_Points, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["ATT_NAME"]) -> typing.Union[MetaOapg.properties.ATT_NAME, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["smallCamel", "CapitalCamel", "small_Snake", "Capital_Snake", "SCA_ETH_Flow_Points", "ATT_NAME", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - smallCamel: typing.Union[MetaOapg.properties.smallCamel, str, schemas.Unset] = schemas.unset, - CapitalCamel: typing.Union[MetaOapg.properties.CapitalCamel, str, schemas.Unset] = schemas.unset, - small_Snake: typing.Union[MetaOapg.properties.small_Snake, str, schemas.Unset] = schemas.unset, - Capital_Snake: typing.Union[MetaOapg.properties.Capital_Snake, str, schemas.Unset] = schemas.unset, - SCA_ETH_Flow_Points: typing.Union[MetaOapg.properties.SCA_ETH_Flow_Points, str, schemas.Unset] = schemas.unset, - ATT_NAME: typing.Union[MetaOapg.properties.ATT_NAME, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Capitalization': - return super().__new__( - cls, - *args, - smallCamel=smallCamel, - CapitalCamel=CapitalCamel, - small_Snake=small_Snake, - Capital_Snake=Capital_Snake, - SCA_ETH_Flow_Points=SCA_ETH_Flow_Points, - ATT_NAME=ATT_NAME, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py deleted file mode 100644 index da07def367b4..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Cat( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - declawed = schemas.BoolSchema - __annotations__ = { - "declawed": declawed, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["declawed"]) -> MetaOapg.properties.declawed: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["declawed", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["declawed"]) -> typing.Union[MetaOapg.properties.declawed, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["declawed", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - declawed: typing.Union[MetaOapg.properties.declawed, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *args, - declawed=declawed, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Animal, - cls.all_of_1, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Cat': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py deleted file mode 100644 index 5537a4437bbf..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Category( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "name", - } - - class properties: - name = schemas.StrSchema - id = schemas.Int64Schema - __annotations__ = { - "name": name, - "id": id, - } - - name: MetaOapg.properties.name - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "id", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "id", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - name: typing.Union[MetaOapg.properties.name, str, ], - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Category': - return super().__new__( - cls, - *args, - name=name, - id=id, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py deleted file mode 100644 index 32db862b8a7a..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ChildCat( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - name = schemas.StrSchema - __annotations__ = { - "name": name, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *args, - name=name, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - ParentPet, - cls.all_of_1, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ChildCat': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.parent_pet import ParentPet diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py deleted file mode 100644 index 75d36e823c2a..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py +++ /dev/null @@ -1,81 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ClassModel( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Model for testing model with "_class" property - """ - - - class MetaOapg: - - class properties: - _class = schemas.StrSchema - __annotations__ = { - "_class": _class, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["_class"]) -> MetaOapg.properties._class: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["_class", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["_class"]) -> typing.Union[MetaOapg.properties._class, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["_class", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _class: typing.Union[MetaOapg.properties._class, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ClassModel': - return super().__new__( - cls, - *args, - _class=_class, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py deleted file mode 100644 index 4c7c16b564eb..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Client( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - client = schemas.StrSchema - __annotations__ = { - "client": client, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["client"]) -> MetaOapg.properties.client: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["client", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["client"]) -> typing.Union[MetaOapg.properties.client, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["client", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - client: typing.Union[MetaOapg.properties.client, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Client': - return super().__new__( - cls, - *args, - client=client, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py deleted file mode 100644 index 434c2c0c77ae..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ComplexQuadrilateral( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class quadrilateralType( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "ComplexQuadrilateral": "COMPLEX_QUADRILATERAL", - } - - @schemas.classproperty - def COMPLEX_QUADRILATERAL(cls): - return cls("ComplexQuadrilateral") - __annotations__ = { - "quadrilateralType": quadrilateralType, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["quadrilateralType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["quadrilateralType"]) -> typing.Union[MetaOapg.properties.quadrilateralType, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["quadrilateralType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - quadrilateralType: typing.Union[MetaOapg.properties.quadrilateralType, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *args, - quadrilateralType=quadrilateralType, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - QuadrilateralInterface, - cls.all_of_1, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ComplexQuadrilateral': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.quadrilateral_interface import QuadrilateralInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py deleted file mode 100644 index bcffd8ff006d..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class DanishPig( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "className", - } - - class properties: - - - class className( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "DanishPig": "DANISH_PIG", - } - - @schemas.classproperty - def DANISH_PIG(cls): - return cls("DanishPig") - __annotations__ = { - "className": className, - } - - className: MetaOapg.properties.className - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["className", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - className: typing.Union[MetaOapg.properties.className, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'DanishPig': - return super().__new__( - cls, - *args, - className=className, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py deleted file mode 100644 index a8dd43038d34..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Dog( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - breed = schemas.StrSchema - __annotations__ = { - "breed": breed, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["breed"]) -> MetaOapg.properties.breed: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["breed", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["breed"]) -> typing.Union[MetaOapg.properties.breed, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["breed", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - breed: typing.Union[MetaOapg.properties.breed, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *args, - breed=breed, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Animal, - cls.all_of_1, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Dog': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py deleted file mode 100644 index 9c7b54ae9cd4..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py +++ /dev/null @@ -1,149 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Drawing( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - @staticmethod - def mainShape() -> typing.Type['Shape']: - return Shape - - @staticmethod - def shapeOrNull() -> typing.Type['ShapeOrNull']: - return ShapeOrNull - - @staticmethod - def nullableShape() -> typing.Type['NullableShape']: - return NullableShape - - - class shapes( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['Shape']: - return Shape - - def __new__( - cls, - arg: typing.Union[typing.Tuple['Shape'], typing.List['Shape']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'shapes': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'Shape': - return super().__getitem__(i) - __annotations__ = { - "mainShape": mainShape, - "shapeOrNull": shapeOrNull, - "nullableShape": nullableShape, - "shapes": shapes, - } - - @staticmethod - def additional_properties() -> typing.Type['Fruit']: - return Fruit - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["mainShape"]) -> 'Shape': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["shapeOrNull"]) -> 'ShapeOrNull': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["nullableShape"]) -> 'NullableShape': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["shapes"]) -> MetaOapg.properties.shapes: ... - - @typing.overload - def __getitem__(self, name: str) -> 'Fruit': ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["mainShape"], typing_extensions.Literal["shapeOrNull"], typing_extensions.Literal["nullableShape"], typing_extensions.Literal["shapes"], str, ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["mainShape"]) -> typing.Union['Shape', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["shapeOrNull"]) -> typing.Union['ShapeOrNull', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["nullableShape"]) -> typing.Union['NullableShape', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["shapes"]) -> typing.Union[MetaOapg.properties.shapes, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union['Fruit', schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["mainShape"], typing_extensions.Literal["shapeOrNull"], typing_extensions.Literal["nullableShape"], typing_extensions.Literal["shapes"], str, ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - mainShape: typing.Union['Shape', schemas.Unset] = schemas.unset, - shapeOrNull: typing.Union['ShapeOrNull', schemas.Unset] = schemas.unset, - nullableShape: typing.Union['NullableShape', schemas.Unset] = schemas.unset, - shapes: typing.Union[MetaOapg.properties.shapes, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: 'Fruit', - ) -> 'Drawing': - return super().__new__( - cls, - *args, - mainShape=mainShape, - shapeOrNull=shapeOrNull, - nullableShape=nullableShape, - shapes=shapes, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.fruit import Fruit -from petstore_api.model.nullable_shape import NullableShape -from petstore_api.model.shape import Shape -from petstore_api.model.shape_or_null import ShapeOrNull diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py deleted file mode 100644 index 1e7e0843da1a..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py +++ /dev/null @@ -1,150 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class EnumArrays( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class just_symbol( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - ">=": "GREATER_THAN_EQUALS", - "$": "DOLLAR", - } - - @schemas.classproperty - def GREATER_THAN_EQUALS(cls): - return cls(">=") - - @schemas.classproperty - def DOLLAR(cls): - return cls("$") - - - class array_enum( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "fish": "FISH", - "crab": "CRAB", - } - - @schemas.classproperty - def FISH(cls): - return cls("fish") - - @schemas.classproperty - def CRAB(cls): - return cls("crab") - - def __new__( - cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_enum': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - __annotations__ = { - "just_symbol": just_symbol, - "array_enum": array_enum, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["just_symbol"]) -> MetaOapg.properties.just_symbol: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_enum"]) -> MetaOapg.properties.array_enum: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["just_symbol", "array_enum", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["just_symbol"]) -> typing.Union[MetaOapg.properties.just_symbol, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_enum"]) -> typing.Union[MetaOapg.properties.array_enum, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["just_symbol", "array_enum", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - just_symbol: typing.Union[MetaOapg.properties.just_symbol, str, schemas.Unset] = schemas.unset, - array_enum: typing.Union[MetaOapg.properties.array_enum, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'EnumArrays': - return super().__new__( - cls, - *args, - just_symbol=just_symbol, - array_enum=array_enum, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py deleted file mode 100644 index 27018e19a6d4..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class EnumClass( - schemas.EnumBase, - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - "_abc": "_ABC", - "-efg": "EFG", - "(xyz)": "XYZ", - "COUNT_1M": "COUNT_1M", - "COUNT_50M": "COUNT_50M", - } - - @schemas.classproperty - def _ABC(cls): - return cls("_abc") - - @schemas.classproperty - def EFG(cls): - return cls("-efg") - - @schemas.classproperty - def XYZ(cls): - return cls("(xyz)") - - @schemas.classproperty - def COUNT_1M(cls): - return cls("COUNT_1M") - - @schemas.classproperty - def COUNT_50M(cls): - return cls("COUNT_50M") diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py deleted file mode 100644 index 094073cddc7f..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py +++ /dev/null @@ -1,276 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class EnumTest( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "enum_string_required", - } - - class properties: - - - class enum_string_required( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "UPPER": "UPPER", - "lower": "LOWER", - "": "EMPTY", - } - - @schemas.classproperty - def UPPER(cls): - return cls("UPPER") - - @schemas.classproperty - def LOWER(cls): - return cls("lower") - - @schemas.classproperty - def EMPTY(cls): - return cls("") - - - class enum_string( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "UPPER": "UPPER", - "lower": "LOWER", - "": "EMPTY", - } - - @schemas.classproperty - def UPPER(cls): - return cls("UPPER") - - @schemas.classproperty - def LOWER(cls): - return cls("lower") - - @schemas.classproperty - def EMPTY(cls): - return cls("") - - - class enum_integer( - schemas.EnumBase, - schemas.Int32Schema - ): - - - class MetaOapg: - format = 'int32' - enum_value_to_name = { - 1: "POSITIVE_1", - -1: "NEGATIVE_1", - } - - @schemas.classproperty - def POSITIVE_1(cls): - return cls(1) - - @schemas.classproperty - def NEGATIVE_1(cls): - return cls(-1) - - - class enum_number( - schemas.EnumBase, - schemas.Float64Schema - ): - - - class MetaOapg: - format = 'double' - enum_value_to_name = { - 1.1: "POSITIVE_1_PT_1", - -1.2: "NEGATIVE_1_PT_2", - } - - @schemas.classproperty - def POSITIVE_1_PT_1(cls): - return cls(1.1) - - @schemas.classproperty - def NEGATIVE_1_PT_2(cls): - return cls(-1.2) - - @staticmethod - def stringEnum() -> typing.Type['StringEnum']: - return StringEnum - - @staticmethod - def IntegerEnum() -> typing.Type['IntegerEnum']: - return IntegerEnum - - @staticmethod - def StringEnumWithDefaultValue() -> typing.Type['StringEnumWithDefaultValue']: - return StringEnumWithDefaultValue - - @staticmethod - def IntegerEnumWithDefaultValue() -> typing.Type['IntegerEnumWithDefaultValue']: - return IntegerEnumWithDefaultValue - - @staticmethod - def IntegerEnumOneValue() -> typing.Type['IntegerEnumOneValue']: - return IntegerEnumOneValue - __annotations__ = { - "enum_string_required": enum_string_required, - "enum_string": enum_string, - "enum_integer": enum_integer, - "enum_number": enum_number, - "stringEnum": stringEnum, - "IntegerEnum": IntegerEnum, - "StringEnumWithDefaultValue": StringEnumWithDefaultValue, - "IntegerEnumWithDefaultValue": IntegerEnumWithDefaultValue, - "IntegerEnumOneValue": IntegerEnumOneValue, - } - - enum_string_required: MetaOapg.properties.enum_string_required - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_string_required"]) -> MetaOapg.properties.enum_string_required: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_string"]) -> MetaOapg.properties.enum_string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_integer"]) -> MetaOapg.properties.enum_integer: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["enum_number"]) -> MetaOapg.properties.enum_number: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["stringEnum"]) -> 'StringEnum': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["IntegerEnum"]) -> 'IntegerEnum': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["StringEnumWithDefaultValue"]) -> 'StringEnumWithDefaultValue': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["IntegerEnumWithDefaultValue"]) -> 'IntegerEnumWithDefaultValue': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["IntegerEnumOneValue"]) -> 'IntegerEnumOneValue': ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["enum_string_required", "enum_string", "enum_integer", "enum_number", "stringEnum", "IntegerEnum", "StringEnumWithDefaultValue", "IntegerEnumWithDefaultValue", "IntegerEnumOneValue", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_string_required"]) -> MetaOapg.properties.enum_string_required: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_string"]) -> typing.Union[MetaOapg.properties.enum_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_integer"]) -> typing.Union[MetaOapg.properties.enum_integer, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["enum_number"]) -> typing.Union[MetaOapg.properties.enum_number, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["stringEnum"]) -> typing.Union['StringEnum', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["IntegerEnum"]) -> typing.Union['IntegerEnum', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["StringEnumWithDefaultValue"]) -> typing.Union['StringEnumWithDefaultValue', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["IntegerEnumWithDefaultValue"]) -> typing.Union['IntegerEnumWithDefaultValue', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["IntegerEnumOneValue"]) -> typing.Union['IntegerEnumOneValue', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["enum_string_required", "enum_string", "enum_integer", "enum_number", "stringEnum", "IntegerEnum", "StringEnumWithDefaultValue", "IntegerEnumWithDefaultValue", "IntegerEnumOneValue", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - enum_string_required: typing.Union[MetaOapg.properties.enum_string_required, str, ], - enum_string: typing.Union[MetaOapg.properties.enum_string, str, schemas.Unset] = schemas.unset, - enum_integer: typing.Union[MetaOapg.properties.enum_integer, decimal.Decimal, int, schemas.Unset] = schemas.unset, - enum_number: typing.Union[MetaOapg.properties.enum_number, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - stringEnum: typing.Union['StringEnum', schemas.Unset] = schemas.unset, - IntegerEnum: typing.Union['IntegerEnum', schemas.Unset] = schemas.unset, - StringEnumWithDefaultValue: typing.Union['StringEnumWithDefaultValue', schemas.Unset] = schemas.unset, - IntegerEnumWithDefaultValue: typing.Union['IntegerEnumWithDefaultValue', schemas.Unset] = schemas.unset, - IntegerEnumOneValue: typing.Union['IntegerEnumOneValue', schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'EnumTest': - return super().__new__( - cls, - *args, - enum_string_required=enum_string_required, - enum_string=enum_string, - enum_integer=enum_integer, - enum_number=enum_number, - stringEnum=stringEnum, - IntegerEnum=IntegerEnum, - StringEnumWithDefaultValue=StringEnumWithDefaultValue, - IntegerEnumWithDefaultValue=IntegerEnumWithDefaultValue, - IntegerEnumOneValue=IntegerEnumOneValue, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.integer_enum import IntegerEnum -from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue -from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue -from petstore_api.model.string_enum import StringEnum -from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py deleted file mode 100644 index a45ac99de806..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class EquilateralTriangle( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class triangleType( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "EquilateralTriangle": "EQUILATERAL_TRIANGLE", - } - - @schemas.classproperty - def EQUILATERAL_TRIANGLE(cls): - return cls("EquilateralTriangle") - __annotations__ = { - "triangleType": triangleType, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["triangleType"]) -> typing.Union[MetaOapg.properties.triangleType, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - triangleType: typing.Union[MetaOapg.properties.triangleType, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *args, - triangleType=triangleType, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - TriangleInterface, - cls.all_of_1, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'EquilateralTriangle': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py deleted file mode 100644 index 886f7a62d343..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class File( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Must be named `File` for test. - """ - - - class MetaOapg: - - class properties: - sourceURI = schemas.StrSchema - __annotations__ = { - "sourceURI": sourceURI, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["sourceURI"]) -> MetaOapg.properties.sourceURI: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["sourceURI", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["sourceURI"]) -> typing.Union[MetaOapg.properties.sourceURI, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["sourceURI", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - sourceURI: typing.Union[MetaOapg.properties.sourceURI, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'File': - return super().__new__( - cls, - *args, - sourceURI=sourceURI, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py deleted file mode 100644 index e9320d9a0e7a..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class FileSchemaTestClass( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - @staticmethod - def file() -> typing.Type['File']: - return File - - - class files( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['File']: - return File - - def __new__( - cls, - arg: typing.Union[typing.Tuple['File'], typing.List['File']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'files': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'File': - return super().__getitem__(i) - __annotations__ = { - "file": file, - "files": files, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["file"]) -> 'File': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["files"]) -> MetaOapg.properties.files: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["file", "files", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["file"]) -> typing.Union['File', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["files"]) -> typing.Union[MetaOapg.properties.files, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["file", "files", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - file: typing.Union['File', schemas.Unset] = schemas.unset, - files: typing.Union[MetaOapg.properties.files, list, tuple, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'FileSchemaTestClass': - return super().__new__( - cls, - *args, - file=file, - files=files, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.file import File diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py deleted file mode 100644 index ce7d00afa0a3..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Foo( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - bar = schemas.StrSchema - __annotations__ = { - "bar": bar, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Foo': - return super().__new__( - cls, - *args, - bar=bar, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py deleted file mode 100644 index b16b10a0488f..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py +++ /dev/null @@ -1,406 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class FormatTest( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "date", - "number", - "password", - "byte", - } - - class properties: - - - class number( - schemas.NumberSchema - ): - - - class MetaOapg: - inclusive_maximum = 543.2 - inclusive_minimum = 32.1 - multiple_of = 32.5 - byte = schemas.StrSchema - date = schemas.DateSchema - - - class password( - schemas.StrSchema - ): - - - class MetaOapg: - format = 'password' - max_length = 64 - min_length = 10 - - - class integer( - schemas.IntSchema - ): - - - class MetaOapg: - inclusive_maximum = 100 - inclusive_minimum = 10 - multiple_of = 2 - int32 = schemas.Int32Schema - - - class int32withValidations( - schemas.Int32Schema - ): - - - class MetaOapg: - format = 'int32' - inclusive_maximum = 200 - inclusive_minimum = 20 - int64 = schemas.Int64Schema - - - class _float( - schemas.Float32Schema - ): - - - class MetaOapg: - format = 'float' - inclusive_maximum = 987.6 - inclusive_minimum = 54.3 - float32 = schemas.Float32Schema - - - class double( - schemas.Float64Schema - ): - - - class MetaOapg: - format = 'double' - inclusive_maximum = 123.4 - inclusive_minimum = 67.8 - float64 = schemas.Float64Schema - - - class arrayWithUniqueItems( - schemas.ListSchema - ): - - - class MetaOapg: - unique_items = True - items = schemas.NumberSchema - - def __new__( - cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'arrayWithUniqueItems': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - - class string( - schemas.StrSchema - ): - - - class MetaOapg: - regex=[{ - 'pattern': r'[a-z]', # noqa: E501 - 'flags': ( - re.IGNORECASE - ) - }] - binary = schemas.BinarySchema - dateTime = schemas.DateTimeSchema - uuid = schemas.UUIDSchema - uuidNoExample = schemas.UUIDSchema - - - class pattern_with_digits( - schemas.StrSchema - ): - - - class MetaOapg: - regex=[{ - 'pattern': r'^\d{10}$', # noqa: E501 - }] - - - class pattern_with_digits_and_delimiter( - schemas.StrSchema - ): - - - class MetaOapg: - regex=[{ - 'pattern': r'^image_\d{1,3}$', # noqa: E501 - 'flags': ( - re.IGNORECASE - ) - }] - noneProp = schemas.NoneSchema - __annotations__ = { - "number": number, - "byte": byte, - "date": date, - "password": password, - "integer": integer, - "int32": int32, - "int32withValidations": int32withValidations, - "int64": int64, - "float": _float, - "float32": float32, - "double": double, - "float64": float64, - "arrayWithUniqueItems": arrayWithUniqueItems, - "string": string, - "binary": binary, - "dateTime": dateTime, - "uuid": uuid, - "uuidNoExample": uuidNoExample, - "pattern_with_digits": pattern_with_digits, - "pattern_with_digits_and_delimiter": pattern_with_digits_and_delimiter, - "noneProp": noneProp, - } - - date: MetaOapg.properties.date - number: MetaOapg.properties.number - password: MetaOapg.properties.password - byte: MetaOapg.properties.byte - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["byte"]) -> MetaOapg.properties.byte: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["date"]) -> MetaOapg.properties.date: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["password"]) -> MetaOapg.properties.password: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["integer"]) -> MetaOapg.properties.integer: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int32"]) -> MetaOapg.properties.int32: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int32withValidations"]) -> MetaOapg.properties.int32withValidations: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["int64"]) -> MetaOapg.properties.int64: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["float"]) -> MetaOapg.properties._float: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["float32"]) -> MetaOapg.properties.float32: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["double"]) -> MetaOapg.properties.double: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["float64"]) -> MetaOapg.properties.float64: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["arrayWithUniqueItems"]) -> MetaOapg.properties.arrayWithUniqueItems: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["string"]) -> MetaOapg.properties.string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["binary"]) -> MetaOapg.properties.binary: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["uuid"]) -> MetaOapg.properties.uuid: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["uuidNoExample"]) -> MetaOapg.properties.uuidNoExample: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["pattern_with_digits"]) -> MetaOapg.properties.pattern_with_digits: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["pattern_with_digits_and_delimiter"]) -> MetaOapg.properties.pattern_with_digits_and_delimiter: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["noneProp"]) -> MetaOapg.properties.noneProp: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["number", "byte", "date", "password", "integer", "int32", "int32withValidations", "int64", "float", "float32", "double", "float64", "arrayWithUniqueItems", "string", "binary", "dateTime", "uuid", "uuidNoExample", "pattern_with_digits", "pattern_with_digits_and_delimiter", "noneProp", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["byte"]) -> MetaOapg.properties.byte: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["date"]) -> MetaOapg.properties.date: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["password"]) -> MetaOapg.properties.password: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["integer"]) -> typing.Union[MetaOapg.properties.integer, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int32"]) -> typing.Union[MetaOapg.properties.int32, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int32withValidations"]) -> typing.Union[MetaOapg.properties.int32withValidations, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["int64"]) -> typing.Union[MetaOapg.properties.int64, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["float"]) -> typing.Union[MetaOapg.properties._float, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["float32"]) -> typing.Union[MetaOapg.properties.float32, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["double"]) -> typing.Union[MetaOapg.properties.double, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["float64"]) -> typing.Union[MetaOapg.properties.float64, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["arrayWithUniqueItems"]) -> typing.Union[MetaOapg.properties.arrayWithUniqueItems, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["string"]) -> typing.Union[MetaOapg.properties.string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["binary"]) -> typing.Union[MetaOapg.properties.binary, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["dateTime"]) -> typing.Union[MetaOapg.properties.dateTime, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["uuid"]) -> typing.Union[MetaOapg.properties.uuid, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["uuidNoExample"]) -> typing.Union[MetaOapg.properties.uuidNoExample, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["pattern_with_digits"]) -> typing.Union[MetaOapg.properties.pattern_with_digits, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["pattern_with_digits_and_delimiter"]) -> typing.Union[MetaOapg.properties.pattern_with_digits_and_delimiter, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["noneProp"]) -> typing.Union[MetaOapg.properties.noneProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["number", "byte", "date", "password", "integer", "int32", "int32withValidations", "int64", "float", "float32", "double", "float64", "arrayWithUniqueItems", "string", "binary", "dateTime", "uuid", "uuidNoExample", "pattern_with_digits", "pattern_with_digits_and_delimiter", "noneProp", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - date: typing.Union[MetaOapg.properties.date, str, date, ], - number: typing.Union[MetaOapg.properties.number, decimal.Decimal, int, float, ], - password: typing.Union[MetaOapg.properties.password, str, ], - byte: typing.Union[MetaOapg.properties.byte, str, ], - integer: typing.Union[MetaOapg.properties.integer, decimal.Decimal, int, schemas.Unset] = schemas.unset, - int32: typing.Union[MetaOapg.properties.int32, decimal.Decimal, int, schemas.Unset] = schemas.unset, - int32withValidations: typing.Union[MetaOapg.properties.int32withValidations, decimal.Decimal, int, schemas.Unset] = schemas.unset, - int64: typing.Union[MetaOapg.properties.int64, decimal.Decimal, int, schemas.Unset] = schemas.unset, - float32: typing.Union[MetaOapg.properties.float32, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - double: typing.Union[MetaOapg.properties.double, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - float64: typing.Union[MetaOapg.properties.float64, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - arrayWithUniqueItems: typing.Union[MetaOapg.properties.arrayWithUniqueItems, list, tuple, schemas.Unset] = schemas.unset, - string: typing.Union[MetaOapg.properties.string, str, schemas.Unset] = schemas.unset, - binary: typing.Union[MetaOapg.properties.binary, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - dateTime: typing.Union[MetaOapg.properties.dateTime, str, datetime, schemas.Unset] = schemas.unset, - uuid: typing.Union[MetaOapg.properties.uuid, str, uuid.UUID, schemas.Unset] = schemas.unset, - uuidNoExample: typing.Union[MetaOapg.properties.uuidNoExample, str, uuid.UUID, schemas.Unset] = schemas.unset, - pattern_with_digits: typing.Union[MetaOapg.properties.pattern_with_digits, str, schemas.Unset] = schemas.unset, - pattern_with_digits_and_delimiter: typing.Union[MetaOapg.properties.pattern_with_digits_and_delimiter, str, schemas.Unset] = schemas.unset, - noneProp: typing.Union[MetaOapg.properties.noneProp, None, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'FormatTest': - return super().__new__( - cls, - *args, - date=date, - number=number, - password=password, - byte=byte, - integer=integer, - int32=int32, - int32withValidations=int32withValidations, - int64=int64, - float32=float32, - double=double, - float64=float64, - arrayWithUniqueItems=arrayWithUniqueItems, - string=string, - binary=binary, - dateTime=dateTime, - uuid=uuid, - uuidNoExample=uuidNoExample, - pattern_with_digits=pattern_with_digits, - pattern_with_digits_and_delimiter=pattern_with_digits_and_delimiter, - noneProp=noneProp, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py deleted file mode 100644 index 056b33f22f5b..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Fruit( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - color = schemas.StrSchema - __annotations__ = { - "color": color, - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Apple, - Banana, - ] - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["color"]) -> MetaOapg.properties.color: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["color", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["color"]) -> typing.Union[MetaOapg.properties.color, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["color", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - color: typing.Union[MetaOapg.properties.color, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Fruit': - return super().__new__( - cls, - *args, - color=color, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.apple import Apple -from petstore_api.model.banana import Banana diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py deleted file mode 100644 index 18879cd45c21..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class FruitReq( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - one_of_0 = schemas.NoneSchema - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - AppleReq, - BananaReq, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'FruitReq': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.apple_req import AppleReq -from petstore_api.model.banana_req import BananaReq diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py deleted file mode 100644 index 5646a4704e20..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class GmFruit( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - color = schemas.StrSchema - __annotations__ = { - "color": color, - } - - @classmethod - @functools.lru_cache() - def any_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Apple, - Banana, - ] - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["color"]) -> MetaOapg.properties.color: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["color", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["color"]) -> typing.Union[MetaOapg.properties.color, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["color", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - color: typing.Union[MetaOapg.properties.color, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'GmFruit': - return super().__new__( - cls, - *args, - color=color, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.apple import Apple -from petstore_api.model.banana import Banana diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py deleted file mode 100644 index 838d96a814f4..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py +++ /dev/null @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class GrandparentAnimal( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "pet_type", - } - - @staticmethod - def discriminator(): - return { - 'pet_type': { - 'ChildCat': ChildCat, - 'ParentPet': ParentPet, - } - } - - class properties: - pet_type = schemas.StrSchema - __annotations__ = { - "pet_type": pet_type, - } - - pet_type: MetaOapg.properties.pet_type - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["pet_type"]) -> MetaOapg.properties.pet_type: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["pet_type", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["pet_type"]) -> MetaOapg.properties.pet_type: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["pet_type", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - pet_type: typing.Union[MetaOapg.properties.pet_type, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'GrandparentAnimal': - return super().__new__( - cls, - *args, - pet_type=pet_type, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.child_cat import ChildCat -from petstore_api.model.parent_pet import ParentPet diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py deleted file mode 100644 index f56f17aad800..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class HasOnlyReadOnly( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - bar = schemas.StrSchema - foo = schemas.StrSchema - __annotations__ = { - "bar": bar, - "foo": foo, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", "foo", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", "foo", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, - foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'HasOnlyReadOnly': - return super().__new__( - cls, - *args, - bar=bar, - foo=foo, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py deleted file mode 100644 index 840a5ad96f14..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class HealthCheckResult( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. - """ - - - class MetaOapg: - - class properties: - - - class NullableMessage( - schemas.StrBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneStrMixin - ): - - - def __new__( - cls, - *args: typing.Union[None, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'NullableMessage': - return super().__new__( - cls, - *args, - _configuration=_configuration, - ) - __annotations__ = { - "NullableMessage": NullableMessage, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["NullableMessage"]) -> MetaOapg.properties.NullableMessage: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["NullableMessage", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["NullableMessage"]) -> typing.Union[MetaOapg.properties.NullableMessage, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["NullableMessage", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - NullableMessage: typing.Union[MetaOapg.properties.NullableMessage, None, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'HealthCheckResult': - return super().__new__( - cls, - *args, - NullableMessage=NullableMessage, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py deleted file mode 100644 index 18cd8df6434d..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class IntegerEnum( - schemas.EnumBase, - schemas.IntSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - 0: "POSITIVE_0", - 1: "POSITIVE_1", - 2: "POSITIVE_2", - } - - @schemas.classproperty - def POSITIVE_0(cls): - return cls(0) - - @schemas.classproperty - def POSITIVE_1(cls): - return cls(1) - - @schemas.classproperty - def POSITIVE_2(cls): - return cls(2) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py deleted file mode 100644 index 6ab7f2f21302..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class IntegerEnumOneValue( - schemas.EnumBase, - schemas.IntSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - 0: "POSITIVE_0", - } - - @schemas.classproperty - def POSITIVE_0(cls): - return cls(0) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py deleted file mode 100644 index 87b44b36f166..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class IntegerEnumWithDefaultValue( - schemas.EnumBase, - schemas.IntSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - 0: "POSITIVE_0", - 1: "POSITIVE_1", - 2: "POSITIVE_2", - } - - @schemas.classproperty - def POSITIVE_0(cls): - return cls(0) - - @schemas.classproperty - def POSITIVE_1(cls): - return cls(1) - - @schemas.classproperty - def POSITIVE_2(cls): - return cls(2) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py deleted file mode 100644 index ddce91c9b96e..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class IsoscelesTriangle( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class triangleType( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "IsoscelesTriangle": "ISOSCELES_TRIANGLE", - } - - @schemas.classproperty - def ISOSCELES_TRIANGLE(cls): - return cls("IsoscelesTriangle") - __annotations__ = { - "triangleType": triangleType, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["triangleType"]) -> typing.Union[MetaOapg.properties.triangleType, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - triangleType: typing.Union[MetaOapg.properties.triangleType, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *args, - triangleType=triangleType, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - TriangleInterface, - cls.all_of_1, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'IsoscelesTriangle': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py deleted file mode 100644 index e90d419cc62c..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Mammal( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'className': { - 'Pig': Pig, - 'whale': Whale, - 'zebra': Zebra, - } - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Whale, - Zebra, - Pig, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Mammal': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.pig import Pig -from petstore_api.model.whale import Whale -from petstore_api.model.zebra import Zebra diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py deleted file mode 100644 index 031503142c6b..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py +++ /dev/null @@ -1,245 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class MapTest( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class map_map_of_string( - schemas.DictSchema - ): - - - class MetaOapg: - - - class additional_properties( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.StrSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'additional_properties': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ], - ) -> 'map_map_of_string': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - - - class map_of_enum_string( - schemas.DictSchema - ): - - - class MetaOapg: - - - class additional_properties( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "UPPER": "UPPER", - "lower": "LOWER", - } - - @schemas.classproperty - def UPPER(cls): - return cls("UPPER") - - @schemas.classproperty - def LOWER(cls): - return cls("lower") - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, str, ], - ) -> 'map_of_enum_string': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - - - class direct_map( - schemas.DictSchema - ): - - - class MetaOapg: - additional_properties = schemas.BoolSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], - ) -> 'direct_map': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - - @staticmethod - def indirect_map() -> typing.Type['StringBooleanMap']: - return StringBooleanMap - __annotations__ = { - "map_map_of_string": map_map_of_string, - "map_of_enum_string": map_of_enum_string, - "direct_map": direct_map, - "indirect_map": indirect_map, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_map_of_string"]) -> MetaOapg.properties.map_map_of_string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map_of_enum_string"]) -> MetaOapg.properties.map_of_enum_string: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["direct_map"]) -> MetaOapg.properties.direct_map: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["indirect_map"]) -> 'StringBooleanMap': ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["map_map_of_string", "map_of_enum_string", "direct_map", "indirect_map", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_map_of_string"]) -> typing.Union[MetaOapg.properties.map_map_of_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map_of_enum_string"]) -> typing.Union[MetaOapg.properties.map_of_enum_string, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["direct_map"]) -> typing.Union[MetaOapg.properties.direct_map, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["indirect_map"]) -> typing.Union['StringBooleanMap', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["map_map_of_string", "map_of_enum_string", "direct_map", "indirect_map", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - map_map_of_string: typing.Union[MetaOapg.properties.map_map_of_string, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - map_of_enum_string: typing.Union[MetaOapg.properties.map_of_enum_string, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - direct_map: typing.Union[MetaOapg.properties.direct_map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - indirect_map: typing.Union['StringBooleanMap', schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MapTest': - return super().__new__( - cls, - *args, - map_map_of_string=map_map_of_string, - map_of_enum_string=map_of_enum_string, - direct_map=direct_map, - indirect_map=indirect_map, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.string_boolean_map import StringBooleanMap diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py deleted file mode 100644 index b146d15b6a04..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class MixedPropertiesAndAdditionalPropertiesClass( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - uuid = schemas.UUIDSchema - dateTime = schemas.DateTimeSchema - - - class map( - schemas.DictSchema - ): - - - class MetaOapg: - - @staticmethod - def additional_properties() -> typing.Type['Animal']: - return Animal - - def __getitem__(self, name: typing.Union[str, ]) -> 'Animal': - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> 'Animal': - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: 'Animal', - ) -> 'map': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "uuid": uuid, - "dateTime": dateTime, - "map": map, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["uuid"]) -> MetaOapg.properties.uuid: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["map"]) -> MetaOapg.properties.map: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["uuid", "dateTime", "map", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["uuid"]) -> typing.Union[MetaOapg.properties.uuid, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["dateTime"]) -> typing.Union[MetaOapg.properties.dateTime, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["map"]) -> typing.Union[MetaOapg.properties.map, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["uuid", "dateTime", "map", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - uuid: typing.Union[MetaOapg.properties.uuid, str, uuid.UUID, schemas.Unset] = schemas.unset, - dateTime: typing.Union[MetaOapg.properties.dateTime, str, datetime, schemas.Unset] = schemas.unset, - map: typing.Union[MetaOapg.properties.map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'MixedPropertiesAndAdditionalPropertiesClass': - return super().__new__( - cls, - *args, - uuid=uuid, - dateTime=dateTime, - map=map, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py deleted file mode 100644 index 7cdc34c57688..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Model200Response( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - model with an invalid class name for python, starts with a number - """ - - - class MetaOapg: - - class properties: - name = schemas.Int32Schema - _class = schemas.StrSchema - __annotations__ = { - "name": name, - "class": _class, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["class"]) -> MetaOapg.properties._class: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "class", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["class"]) -> typing.Union[MetaOapg.properties._class, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "class", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - name: typing.Union[MetaOapg.properties.name, decimal.Decimal, int, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Model200Response': - return super().__new__( - cls, - *args, - name=name, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py deleted file mode 100644 index 1549dc1120d6..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py +++ /dev/null @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ModelReturn( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Model for testing reserved words - """ - - - class MetaOapg: - - class properties: - _return = schemas.Int32Schema - __annotations__ = { - "return": _return, - } - - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["return"]) -> MetaOapg.properties._return: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["return", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["return"]) -> typing.Union[MetaOapg.properties._return, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["return", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ModelReturn': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py deleted file mode 100644 index e67d017f241a..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Name( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Model for testing model name same as property name - """ - - - class MetaOapg: - required = { - "name", - } - - class properties: - name = schemas.Int32Schema - snake_case = schemas.Int32Schema - _property = schemas.StrSchema - __annotations__ = { - "name": name, - "snake_case": snake_case, - "property": _property, - } - - - name: MetaOapg.properties.name - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["snake_case"]) -> MetaOapg.properties.snake_case: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["property"]) -> MetaOapg.properties._property: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "snake_case", "property", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["snake_case"]) -> typing.Union[MetaOapg.properties.snake_case, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["property"]) -> typing.Union[MetaOapg.properties._property, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "snake_case", "property", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - name: typing.Union[MetaOapg.properties.name, decimal.Decimal, int, ], - snake_case: typing.Union[MetaOapg.properties.snake_case, decimal.Decimal, int, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Name': - return super().__new__( - cls, - *args, - name=name, - snake_case=snake_case, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py deleted file mode 100644 index 0d3c13b45761..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py +++ /dev/null @@ -1,576 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class NullableClass( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - - - class integer_prop( - schemas.IntBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneDecimalMixin - ): - - - def __new__( - cls, - *args: typing.Union[None, decimal.Decimal, int, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'integer_prop': - return super().__new__( - cls, - *args, - _configuration=_configuration, - ) - - - class number_prop( - schemas.NumberBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneDecimalMixin - ): - - - def __new__( - cls, - *args: typing.Union[None, decimal.Decimal, int, float, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'number_prop': - return super().__new__( - cls, - *args, - _configuration=_configuration, - ) - - - class boolean_prop( - schemas.BoolBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneBoolMixin - ): - - - def __new__( - cls, - *args: typing.Union[None, bool, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'boolean_prop': - return super().__new__( - cls, - *args, - _configuration=_configuration, - ) - - - class string_prop( - schemas.StrBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneStrMixin - ): - - - def __new__( - cls, - *args: typing.Union[None, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'string_prop': - return super().__new__( - cls, - *args, - _configuration=_configuration, - ) - - - class date_prop( - schemas.DateBase, - schemas.StrBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneStrMixin - ): - - - class MetaOapg: - format = 'date' - - - def __new__( - cls, - *args: typing.Union[None, str, date, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'date_prop': - return super().__new__( - cls, - *args, - _configuration=_configuration, - ) - - - class datetime_prop( - schemas.DateTimeBase, - schemas.StrBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneStrMixin - ): - - - class MetaOapg: - format = 'date-time' - - - def __new__( - cls, - *args: typing.Union[None, str, datetime, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'datetime_prop': - return super().__new__( - cls, - *args, - _configuration=_configuration, - ) - - - class array_nullable_prop( - schemas.ListBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneTupleMixin - ): - - - class MetaOapg: - items = schemas.DictSchema - - - def __new__( - cls, - *args: typing.Union[list, tuple, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_nullable_prop': - return super().__new__( - cls, - *args, - _configuration=_configuration, - ) - - - class array_and_items_nullable_prop( - schemas.ListBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneTupleMixin - ): - - - class MetaOapg: - - - class items( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'items': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - - - def __new__( - cls, - *args: typing.Union[list, tuple, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_and_items_nullable_prop': - return super().__new__( - cls, - *args, - _configuration=_configuration, - ) - - - class array_items_nullable( - schemas.ListSchema - ): - - - class MetaOapg: - - - class items( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'items': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - - def __new__( - cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, None, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, None, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'array_items_nullable': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - - - class object_nullable_prop( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - class MetaOapg: - additional_properties = schemas.DictSchema - - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ], - ) -> 'object_nullable_prop': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - - - class object_and_items_nullable_prop( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - class MetaOapg: - - - class additional_properties( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'additional_properties': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, None, ], - ) -> 'object_and_items_nullable_prop': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - - - class object_items_nullable( - schemas.DictSchema - ): - - - class MetaOapg: - - - class additional_properties( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'additional_properties': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, None, ], - ) -> 'object_items_nullable': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - __annotations__ = { - "integer_prop": integer_prop, - "number_prop": number_prop, - "boolean_prop": boolean_prop, - "string_prop": string_prop, - "date_prop": date_prop, - "datetime_prop": datetime_prop, - "array_nullable_prop": array_nullable_prop, - "array_and_items_nullable_prop": array_and_items_nullable_prop, - "array_items_nullable": array_items_nullable, - "object_nullable_prop": object_nullable_prop, - "object_and_items_nullable_prop": object_and_items_nullable_prop, - "object_items_nullable": object_items_nullable, - } - - - class additional_properties( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'additional_properties': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["integer_prop"]) -> MetaOapg.properties.integer_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["number_prop"]) -> MetaOapg.properties.number_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["boolean_prop"]) -> MetaOapg.properties.boolean_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["string_prop"]) -> MetaOapg.properties.string_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["date_prop"]) -> MetaOapg.properties.date_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["datetime_prop"]) -> MetaOapg.properties.datetime_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_nullable_prop"]) -> MetaOapg.properties.array_nullable_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_and_items_nullable_prop"]) -> MetaOapg.properties.array_and_items_nullable_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["array_items_nullable"]) -> MetaOapg.properties.array_items_nullable: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["object_nullable_prop"]) -> MetaOapg.properties.object_nullable_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["object_and_items_nullable_prop"]) -> MetaOapg.properties.object_and_items_nullable_prop: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["object_items_nullable"]) -> MetaOapg.properties.object_items_nullable: ... - - @typing.overload - def __getitem__(self, name: str) -> MetaOapg.additional_properties: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["integer_prop"], typing_extensions.Literal["number_prop"], typing_extensions.Literal["boolean_prop"], typing_extensions.Literal["string_prop"], typing_extensions.Literal["date_prop"], typing_extensions.Literal["datetime_prop"], typing_extensions.Literal["array_nullable_prop"], typing_extensions.Literal["array_and_items_nullable_prop"], typing_extensions.Literal["array_items_nullable"], typing_extensions.Literal["object_nullable_prop"], typing_extensions.Literal["object_and_items_nullable_prop"], typing_extensions.Literal["object_items_nullable"], str, ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["integer_prop"]) -> typing.Union[MetaOapg.properties.integer_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["number_prop"]) -> typing.Union[MetaOapg.properties.number_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["boolean_prop"]) -> typing.Union[MetaOapg.properties.boolean_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["string_prop"]) -> typing.Union[MetaOapg.properties.string_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["date_prop"]) -> typing.Union[MetaOapg.properties.date_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["datetime_prop"]) -> typing.Union[MetaOapg.properties.datetime_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_nullable_prop"]) -> typing.Union[MetaOapg.properties.array_nullable_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_and_items_nullable_prop"]) -> typing.Union[MetaOapg.properties.array_and_items_nullable_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["array_items_nullable"]) -> typing.Union[MetaOapg.properties.array_items_nullable, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["object_nullable_prop"]) -> typing.Union[MetaOapg.properties.object_nullable_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["object_and_items_nullable_prop"]) -> typing.Union[MetaOapg.properties.object_and_items_nullable_prop, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["object_items_nullable"]) -> typing.Union[MetaOapg.properties.object_items_nullable, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[MetaOapg.additional_properties, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["integer_prop"], typing_extensions.Literal["number_prop"], typing_extensions.Literal["boolean_prop"], typing_extensions.Literal["string_prop"], typing_extensions.Literal["date_prop"], typing_extensions.Literal["datetime_prop"], typing_extensions.Literal["array_nullable_prop"], typing_extensions.Literal["array_and_items_nullable_prop"], typing_extensions.Literal["array_items_nullable"], typing_extensions.Literal["object_nullable_prop"], typing_extensions.Literal["object_and_items_nullable_prop"], typing_extensions.Literal["object_items_nullable"], str, ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - integer_prop: typing.Union[MetaOapg.properties.integer_prop, None, decimal.Decimal, int, schemas.Unset] = schemas.unset, - number_prop: typing.Union[MetaOapg.properties.number_prop, None, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - boolean_prop: typing.Union[MetaOapg.properties.boolean_prop, None, bool, schemas.Unset] = schemas.unset, - string_prop: typing.Union[MetaOapg.properties.string_prop, None, str, schemas.Unset] = schemas.unset, - date_prop: typing.Union[MetaOapg.properties.date_prop, None, str, date, schemas.Unset] = schemas.unset, - datetime_prop: typing.Union[MetaOapg.properties.datetime_prop, None, str, datetime, schemas.Unset] = schemas.unset, - array_nullable_prop: typing.Union[MetaOapg.properties.array_nullable_prop, list, tuple, None, schemas.Unset] = schemas.unset, - array_and_items_nullable_prop: typing.Union[MetaOapg.properties.array_and_items_nullable_prop, list, tuple, None, schemas.Unset] = schemas.unset, - array_items_nullable: typing.Union[MetaOapg.properties.array_items_nullable, list, tuple, schemas.Unset] = schemas.unset, - object_nullable_prop: typing.Union[MetaOapg.properties.object_nullable_prop, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, - object_and_items_nullable_prop: typing.Union[MetaOapg.properties.object_and_items_nullable_prop, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, - object_items_nullable: typing.Union[MetaOapg.properties.object_items_nullable, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, None, ], - ) -> 'NullableClass': - return super().__new__( - cls, - *args, - integer_prop=integer_prop, - number_prop=number_prop, - boolean_prop=boolean_prop, - string_prop=string_prop, - date_prop=date_prop, - datetime_prop=datetime_prop, - array_nullable_prop=array_nullable_prop, - array_and_items_nullable_prop=array_and_items_nullable_prop, - array_items_nullable=array_items_nullable, - object_nullable_prop=object_nullable_prop, - object_and_items_nullable_prop=object_and_items_nullable_prop, - object_items_nullable=object_items_nullable, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py deleted file mode 100644 index e22e8d824e2d..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class NullableShape( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - The value may be a shape or the 'null' value. For a composed schema to validate a null payload, one of its chosen oneOf schemas must be type null or nullable (introduced in OAS schema >= 3.0) - """ - - - class MetaOapg: - one_of_2 = schemas.NoneSchema - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Triangle, - Quadrilateral, - cls.one_of_2, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'NullableShape': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.quadrilateral import Quadrilateral -from petstore_api.model.triangle import Triangle diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py deleted file mode 100644 index 91aaaa507b8a..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class NumberOnly( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - JustNumber = schemas.NumberSchema - __annotations__ = { - "JustNumber": JustNumber, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["JustNumber"]) -> MetaOapg.properties.JustNumber: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["JustNumber", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["JustNumber"]) -> typing.Union[MetaOapg.properties.JustNumber, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["JustNumber", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - JustNumber: typing.Union[MetaOapg.properties.JustNumber, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'NumberOnly': - return super().__new__( - cls, - *args, - JustNumber=JustNumber, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py deleted file mode 100644 index f8b63e35856f..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class NumberWithValidations( - schemas.NumberSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - inclusive_maximum = 20 - inclusive_minimum = 10 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py deleted file mode 100644 index 05dc6ddd5658..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 -ObjectInterface = schemas.DictSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py deleted file mode 100644 index e68caff8717c..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectModelWithRefProps( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations - """ - - - class MetaOapg: - - class properties: - - @staticmethod - def myNumber() -> typing.Type['NumberWithValidations']: - return NumberWithValidations - myString = schemas.StrSchema - myBoolean = schemas.BoolSchema - __annotations__ = { - "myNumber": myNumber, - "myString": myString, - "myBoolean": myBoolean, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["myNumber"]) -> 'NumberWithValidations': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["myString"]) -> MetaOapg.properties.myString: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["myBoolean"]) -> MetaOapg.properties.myBoolean: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["myNumber", "myString", "myBoolean", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["myNumber"]) -> typing.Union['NumberWithValidations', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["myString"]) -> typing.Union[MetaOapg.properties.myString, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["myBoolean"]) -> typing.Union[MetaOapg.properties.myBoolean, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["myNumber", "myString", "myBoolean", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - myNumber: typing.Union['NumberWithValidations', schemas.Unset] = schemas.unset, - myString: typing.Union[MetaOapg.properties.myString, str, schemas.Unset] = schemas.unset, - myBoolean: typing.Union[MetaOapg.properties.myBoolean, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectModelWithRefProps': - return super().__new__( - cls, - *args, - myNumber=myNumber, - myString=myString, - myBoolean=myBoolean, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.number_with_validations import NumberWithValidations diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py deleted file mode 100644 index 50c22698177a..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ObjectWithValidations( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - min_properties = 2 - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ObjectWithValidations': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py deleted file mode 100644 index 6d653b0ab07e..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Order( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - id = schemas.Int64Schema - petId = schemas.Int64Schema - quantity = schemas.Int32Schema - shipDate = schemas.DateTimeSchema - - - class status( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "placed": "PLACED", - "approved": "APPROVED", - "delivered": "DELIVERED", - } - - @schemas.classproperty - def PLACED(cls): - return cls("placed") - - @schemas.classproperty - def APPROVED(cls): - return cls("approved") - - @schemas.classproperty - def DELIVERED(cls): - return cls("delivered") - complete = schemas.BoolSchema - __annotations__ = { - "id": id, - "petId": petId, - "quantity": quantity, - "shipDate": shipDate, - "status": status, - "complete": complete, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["petId"]) -> MetaOapg.properties.petId: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["quantity"]) -> MetaOapg.properties.quantity: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["shipDate"]) -> MetaOapg.properties.shipDate: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["status"]) -> MetaOapg.properties.status: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["complete"]) -> MetaOapg.properties.complete: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "petId", "quantity", "shipDate", "status", "complete", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["petId"]) -> typing.Union[MetaOapg.properties.petId, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["quantity"]) -> typing.Union[MetaOapg.properties.quantity, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["shipDate"]) -> typing.Union[MetaOapg.properties.shipDate, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["status"]) -> typing.Union[MetaOapg.properties.status, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["complete"]) -> typing.Union[MetaOapg.properties.complete, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "petId", "quantity", "shipDate", "status", "complete", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, - petId: typing.Union[MetaOapg.properties.petId, decimal.Decimal, int, schemas.Unset] = schemas.unset, - quantity: typing.Union[MetaOapg.properties.quantity, decimal.Decimal, int, schemas.Unset] = schemas.unset, - shipDate: typing.Union[MetaOapg.properties.shipDate, str, datetime, schemas.Unset] = schemas.unset, - status: typing.Union[MetaOapg.properties.status, str, schemas.Unset] = schemas.unset, - complete: typing.Union[MetaOapg.properties.complete, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Order': - return super().__new__( - cls, - *args, - id=id, - petId=petId, - quantity=quantity, - shipDate=shipDate, - status=status, - complete=complete, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py deleted file mode 100644 index 178eab4e5a13..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ParentPet( - schemas.ComposedBase, - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'pet_type': { - 'ChildCat': ChildCat, - } - } - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - GrandparentAnimal, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ParentPet': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.child_cat import ChildCat -from petstore_api.model.grandparent_animal import GrandparentAnimal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py deleted file mode 100644 index 5b1b6b8275e2..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py +++ /dev/null @@ -1,215 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Pet( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Pet object that needs to be added to the store - """ - - - class MetaOapg: - required = { - "photoUrls", - "name", - } - - class properties: - name = schemas.StrSchema - - - class photoUrls( - schemas.ListSchema - ): - - - class MetaOapg: - items = schemas.StrSchema - - def __new__( - cls, - arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'photoUrls': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> MetaOapg.items: - return super().__getitem__(i) - id = schemas.Int64Schema - - @staticmethod - def category() -> typing.Type['Category']: - return Category - - - class tags( - schemas.ListSchema - ): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['Tag']: - return Tag - - def __new__( - cls, - arg: typing.Union[typing.Tuple['Tag'], typing.List['Tag']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'tags': - return super().__new__( - cls, - arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'Tag': - return super().__getitem__(i) - - - class status( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "available": "AVAILABLE", - "pending": "PENDING", - "sold": "SOLD", - } - - @schemas.classproperty - def AVAILABLE(cls): - return cls("available") - - @schemas.classproperty - def PENDING(cls): - return cls("pending") - - @schemas.classproperty - def SOLD(cls): - return cls("sold") - __annotations__ = { - "name": name, - "photoUrls": photoUrls, - "id": id, - "category": category, - "tags": tags, - "status": status, - } - - photoUrls: MetaOapg.properties.photoUrls - name: MetaOapg.properties.name - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["photoUrls"]) -> MetaOapg.properties.photoUrls: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["category"]) -> 'Category': ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["tags"]) -> MetaOapg.properties.tags: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["status"]) -> MetaOapg.properties.status: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "photoUrls", "id", "category", "tags", "status", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["photoUrls"]) -> MetaOapg.properties.photoUrls: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["category"]) -> typing.Union['Category', schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["tags"]) -> typing.Union[MetaOapg.properties.tags, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["status"]) -> typing.Union[MetaOapg.properties.status, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "photoUrls", "id", "category", "tags", "status", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - photoUrls: typing.Union[MetaOapg.properties.photoUrls, list, tuple, ], - name: typing.Union[MetaOapg.properties.name, str, ], - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, - category: typing.Union['Category', schemas.Unset] = schemas.unset, - tags: typing.Union[MetaOapg.properties.tags, list, tuple, schemas.Unset] = schemas.unset, - status: typing.Union[MetaOapg.properties.status, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Pet': - return super().__new__( - cls, - *args, - photoUrls=photoUrls, - name=name, - id=id, - category=category, - tags=tags, - status=status, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.category import Category -from petstore_api.model.tag import Tag diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py deleted file mode 100644 index db4887c110ed..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Pig( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'className': { - 'BasquePig': BasquePig, - 'DanishPig': DanishPig, - } - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - BasquePig, - DanishPig, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Pig': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.basque_pig import BasquePig -from petstore_api.model.danish_pig import DanishPig diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py deleted file mode 100644 index 6a9b08fa1fd0..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Quadrilateral( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'quadrilateralType': { - 'ComplexQuadrilateral': ComplexQuadrilateral, - 'SimpleQuadrilateral': SimpleQuadrilateral, - } - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - SimpleQuadrilateral, - ComplexQuadrilateral, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Quadrilateral': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral -from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py deleted file mode 100644 index 90c85c2388f7..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class QuadrilateralInterface( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "shapeType", - "quadrilateralType", - } - - class properties: - - - class shapeType( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "Quadrilateral": "QUADRILATERAL", - } - - @schemas.classproperty - def QUADRILATERAL(cls): - return cls("Quadrilateral") - quadrilateralType = schemas.StrSchema - __annotations__ = { - "shapeType": shapeType, - "quadrilateralType": quadrilateralType, - } - - - shapeType: MetaOapg.properties.shapeType - quadrilateralType: MetaOapg.properties.quadrilateralType - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["shapeType", "quadrilateralType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["shapeType", "quadrilateralType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - shapeType: typing.Union[MetaOapg.properties.shapeType, str, ], - quadrilateralType: typing.Union[MetaOapg.properties.quadrilateralType, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'QuadrilateralInterface': - return super().__new__( - cls, - *args, - shapeType=shapeType, - quadrilateralType=quadrilateralType, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py deleted file mode 100644 index c849de19067f..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ReadOnlyFirst( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - bar = schemas.StrSchema - baz = schemas.StrSchema - __annotations__ = { - "bar": bar, - "baz": baz, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["baz"]) -> MetaOapg.properties.baz: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", "baz", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["baz"]) -> typing.Union[MetaOapg.properties.baz, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", "baz", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, - baz: typing.Union[MetaOapg.properties.baz, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ReadOnlyFirst': - return super().__new__( - cls, - *args, - bar=bar, - baz=baz, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py deleted file mode 100644 index 46083ad56443..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ScaleneTriangle( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class triangleType( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "ScaleneTriangle": "SCALENE_TRIANGLE", - } - - @schemas.classproperty - def SCALENE_TRIANGLE(cls): - return cls("ScaleneTriangle") - __annotations__ = { - "triangleType": triangleType, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["triangleType"]) -> typing.Union[MetaOapg.properties.triangleType, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - triangleType: typing.Union[MetaOapg.properties.triangleType, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *args, - triangleType=triangleType, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - TriangleInterface, - cls.all_of_1, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ScaleneTriangle': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py deleted file mode 100644 index bab6e983c847..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Shape( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'shapeType': { - 'Quadrilateral': Quadrilateral, - 'Triangle': Triangle, - } - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - Triangle, - Quadrilateral, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Shape': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.quadrilateral import Quadrilateral -from petstore_api.model.triangle import Triangle diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py deleted file mode 100644 index 10342b8d037f..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py +++ /dev/null @@ -1,81 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class ShapeOrNull( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'shapeType': { - 'Quadrilateral': Quadrilateral, - 'Triangle': Triangle, - } - } - one_of_0 = schemas.NoneSchema - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - cls.one_of_0, - Triangle, - Quadrilateral, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'ShapeOrNull': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.quadrilateral import Quadrilateral -from petstore_api.model.triangle import Triangle diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py deleted file mode 100644 index 93d3c1f9325a..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class SimpleQuadrilateral( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - - class all_of_1( - schemas.DictSchema - ): - - - class MetaOapg: - - class properties: - - - class quadrilateralType( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "SimpleQuadrilateral": "SIMPLE_QUADRILATERAL", - } - - @schemas.classproperty - def SIMPLE_QUADRILATERAL(cls): - return cls("SimpleQuadrilateral") - __annotations__ = { - "quadrilateralType": quadrilateralType, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["quadrilateralType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["quadrilateralType"]) -> typing.Union[MetaOapg.properties.quadrilateralType, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["quadrilateralType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - quadrilateralType: typing.Union[MetaOapg.properties.quadrilateralType, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'all_of_1': - return super().__new__( - cls, - *args, - quadrilateralType=quadrilateralType, - _configuration=_configuration, - **kwargs, - ) - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - QuadrilateralInterface, - cls.all_of_1, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SimpleQuadrilateral': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.quadrilateral_interface import QuadrilateralInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py deleted file mode 100644 index 3ce8eab0b42d..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class SomeObject( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @classmethod - @functools.lru_cache() - def all_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - ObjectInterface, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SomeObject': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.object_interface import ObjectInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py deleted file mode 100644 index ca1f5c6ab848..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class SpecialModelName( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - model with an invalid class name for python - """ - - - class MetaOapg: - - class properties: - a = schemas.StrSchema - __annotations__ = { - "a": a, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["a"]) -> MetaOapg.properties.a: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["a", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["a"]) -> typing.Union[MetaOapg.properties.a, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["a", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - a: typing.Union[MetaOapg.properties.a, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'SpecialModelName': - return super().__new__( - cls, - *args, - a=a, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py deleted file mode 100644 index 9d4a6136b554..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class StringBooleanMap( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - additional_properties = schemas.BoolSchema - - def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - # dict_instance[name] accessor - return super().__getitem__(name) - - def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], - ) -> 'StringBooleanMap': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py deleted file mode 100644 index abc1696bc148..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class StringEnum( - schemas.EnumBase, - schemas.StrBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneStrMixin -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - "placed": "PLACED", - "approved": "APPROVED", - "delivered": "DELIVERED", - "single quoted": "SINGLE_QUOTED", - "multiple\nlines": "MULTIPLE_LINES", - "double quote \n with newline": "DOUBLE_QUOTE_WITH_NEWLINE", - schemas.NoneClass.NONE: "NONE", - } - - @schemas.classproperty - def PLACED(cls): - return cls("placed") - - @schemas.classproperty - def APPROVED(cls): - return cls("approved") - - @schemas.classproperty - def DELIVERED(cls): - return cls("delivered") - - @schemas.classproperty - def SINGLE_QUOTED(cls): - return cls("single quoted") - - @schemas.classproperty - def MULTIPLE_LINES(cls): - return cls("multiple\nlines") - - @schemas.classproperty - def DOUBLE_QUOTE_WITH_NEWLINE(cls): - return cls("double quote \n with newline") - - @schemas.classproperty - def NONE(cls): - return cls(None) - - - def __new__( - cls, - *args: typing.Union[None, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'StringEnum': - return super().__new__( - cls, - *args, - _configuration=_configuration, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py deleted file mode 100644 index 852600965552..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class StringEnumWithDefaultValue( - schemas.EnumBase, - schemas.StrSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - enum_value_to_name = { - "placed": "PLACED", - "approved": "APPROVED", - "delivered": "DELIVERED", - } - - @schemas.classproperty - def PLACED(cls): - return cls("placed") - - @schemas.classproperty - def APPROVED(cls): - return cls("approved") - - @schemas.classproperty - def DELIVERED(cls): - return cls("delivered") diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py deleted file mode 100644 index a0176eead362..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Tag( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - id = schemas.Int64Schema - name = schemas.StrSchema - __annotations__ = { - "id": id, - "name": name, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "name", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "name", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, - name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Tag': - return super().__new__( - cls, - *args, - id=id, - name=name, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py deleted file mode 100644 index 0701b6d51113..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Triangle( - schemas.ComposedSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - @staticmethod - def discriminator(): - return { - 'triangleType': { - 'EquilateralTriangle': EquilateralTriangle, - 'IsoscelesTriangle': IsoscelesTriangle, - 'ScaleneTriangle': ScaleneTriangle, - } - } - - @classmethod - @functools.lru_cache() - def one_of(cls): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return [ - EquilateralTriangle, - IsoscelesTriangle, - ScaleneTriangle, - ] - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Triangle': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - -from petstore_api.model.equilateral_triangle import EquilateralTriangle -from petstore_api.model.isosceles_triangle import IsoscelesTriangle -from petstore_api.model.scalene_triangle import ScaleneTriangle diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py deleted file mode 100644 index 7ac28c0031c6..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class TriangleInterface( - schemas.AnyTypeSchema, -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "shapeType", - "triangleType", - } - - class properties: - - - class shapeType( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "Triangle": "TRIANGLE", - } - - @schemas.classproperty - def TRIANGLE(cls): - return cls("Triangle") - triangleType = schemas.StrSchema - __annotations__ = { - "shapeType": shapeType, - "triangleType": triangleType, - } - - - shapeType: MetaOapg.properties.shapeType - triangleType: MetaOapg.properties.triangleType - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["shapeType", "triangleType", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["shapeType", "triangleType", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - shapeType: typing.Union[MetaOapg.properties.shapeType, str, ], - triangleType: typing.Union[MetaOapg.properties.triangleType, str, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'TriangleInterface': - return super().__new__( - cls, - *args, - shapeType=shapeType, - triangleType=triangleType, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py deleted file mode 100644 index c8beb19d8258..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py +++ /dev/null @@ -1,241 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class User( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - id = schemas.Int64Schema - username = schemas.StrSchema - firstName = schemas.StrSchema - lastName = schemas.StrSchema - email = schemas.StrSchema - password = schemas.StrSchema - phone = schemas.StrSchema - userStatus = schemas.Int32Schema - objectWithNoDeclaredProps = schemas.DictSchema - - - class objectWithNoDeclaredPropsNullable( - schemas.DictBase, - schemas.NoneBase, - schemas.Schema, - schemas.NoneFrozenDictMixin - ): - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, None, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'objectWithNoDeclaredPropsNullable': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - anyTypeProp = schemas.AnyTypeSchema - - - class anyTypeExceptNullProp( - schemas.ComposedSchema, - ): - - - class MetaOapg: - not_schema = schemas.NoneSchema - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'anyTypeExceptNullProp': - return super().__new__( - cls, - *args, - _configuration=_configuration, - **kwargs, - ) - anyTypePropNullable = schemas.AnyTypeSchema - __annotations__ = { - "id": id, - "username": username, - "firstName": firstName, - "lastName": lastName, - "email": email, - "password": password, - "phone": phone, - "userStatus": userStatus, - "objectWithNoDeclaredProps": objectWithNoDeclaredProps, - "objectWithNoDeclaredPropsNullable": objectWithNoDeclaredPropsNullable, - "anyTypeProp": anyTypeProp, - "anyTypeExceptNullProp": anyTypeExceptNullProp, - "anyTypePropNullable": anyTypePropNullable, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["username"]) -> MetaOapg.properties.username: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["firstName"]) -> MetaOapg.properties.firstName: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["lastName"]) -> MetaOapg.properties.lastName: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["email"]) -> MetaOapg.properties.email: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["password"]) -> MetaOapg.properties.password: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["phone"]) -> MetaOapg.properties.phone: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["userStatus"]) -> MetaOapg.properties.userStatus: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["objectWithNoDeclaredProps"]) -> MetaOapg.properties.objectWithNoDeclaredProps: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["objectWithNoDeclaredPropsNullable"]) -> MetaOapg.properties.objectWithNoDeclaredPropsNullable: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["anyTypeProp"]) -> MetaOapg.properties.anyTypeProp: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["anyTypeExceptNullProp"]) -> MetaOapg.properties.anyTypeExceptNullProp: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["anyTypePropNullable"]) -> MetaOapg.properties.anyTypePropNullable: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus", "objectWithNoDeclaredProps", "objectWithNoDeclaredPropsNullable", "anyTypeProp", "anyTypeExceptNullProp", "anyTypePropNullable", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["username"]) -> typing.Union[MetaOapg.properties.username, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["firstName"]) -> typing.Union[MetaOapg.properties.firstName, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["lastName"]) -> typing.Union[MetaOapg.properties.lastName, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["email"]) -> typing.Union[MetaOapg.properties.email, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["password"]) -> typing.Union[MetaOapg.properties.password, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["phone"]) -> typing.Union[MetaOapg.properties.phone, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["userStatus"]) -> typing.Union[MetaOapg.properties.userStatus, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["objectWithNoDeclaredProps"]) -> typing.Union[MetaOapg.properties.objectWithNoDeclaredProps, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["objectWithNoDeclaredPropsNullable"]) -> typing.Union[MetaOapg.properties.objectWithNoDeclaredPropsNullable, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["anyTypeProp"]) -> typing.Union[MetaOapg.properties.anyTypeProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["anyTypeExceptNullProp"]) -> typing.Union[MetaOapg.properties.anyTypeExceptNullProp, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["anyTypePropNullable"]) -> typing.Union[MetaOapg.properties.anyTypePropNullable, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus", "objectWithNoDeclaredProps", "objectWithNoDeclaredPropsNullable", "anyTypeProp", "anyTypeExceptNullProp", "anyTypePropNullable", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, - username: typing.Union[MetaOapg.properties.username, str, schemas.Unset] = schemas.unset, - firstName: typing.Union[MetaOapg.properties.firstName, str, schemas.Unset] = schemas.unset, - lastName: typing.Union[MetaOapg.properties.lastName, str, schemas.Unset] = schemas.unset, - email: typing.Union[MetaOapg.properties.email, str, schemas.Unset] = schemas.unset, - password: typing.Union[MetaOapg.properties.password, str, schemas.Unset] = schemas.unset, - phone: typing.Union[MetaOapg.properties.phone, str, schemas.Unset] = schemas.unset, - userStatus: typing.Union[MetaOapg.properties.userStatus, decimal.Decimal, int, schemas.Unset] = schemas.unset, - objectWithNoDeclaredProps: typing.Union[MetaOapg.properties.objectWithNoDeclaredProps, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, - objectWithNoDeclaredPropsNullable: typing.Union[MetaOapg.properties.objectWithNoDeclaredPropsNullable, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, - anyTypeProp: typing.Union[MetaOapg.properties.anyTypeProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - anyTypeExceptNullProp: typing.Union[MetaOapg.properties.anyTypeExceptNullProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - anyTypePropNullable: typing.Union[MetaOapg.properties.anyTypePropNullable, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'User': - return super().__new__( - cls, - *args, - id=id, - username=username, - firstName=firstName, - lastName=lastName, - email=email, - password=password, - phone=phone, - userStatus=userStatus, - objectWithNoDeclaredProps=objectWithNoDeclaredProps, - objectWithNoDeclaredPropsNullable=objectWithNoDeclaredPropsNullable, - anyTypeProp=anyTypeProp, - anyTypeExceptNullProp=anyTypeExceptNullProp, - anyTypePropNullable=anyTypePropNullable, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py deleted file mode 100644 index b645789bd151..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Whale( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "className", - } - - class properties: - - - class className( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "whale": "WHALE", - } - - @schemas.classproperty - def WHALE(cls): - return cls("whale") - hasBaleen = schemas.BoolSchema - hasTeeth = schemas.BoolSchema - __annotations__ = { - "className": className, - "hasBaleen": hasBaleen, - "hasTeeth": hasTeeth, - } - - className: MetaOapg.properties.className - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["hasBaleen"]) -> MetaOapg.properties.hasBaleen: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["hasTeeth"]) -> MetaOapg.properties.hasTeeth: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["className", "hasBaleen", "hasTeeth", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["hasBaleen"]) -> typing.Union[MetaOapg.properties.hasBaleen, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["hasTeeth"]) -> typing.Union[MetaOapg.properties.hasTeeth, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className", "hasBaleen", "hasTeeth", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - className: typing.Union[MetaOapg.properties.className, str, ], - hasBaleen: typing.Union[MetaOapg.properties.hasBaleen, bool, schemas.Unset] = schemas.unset, - hasTeeth: typing.Union[MetaOapg.properties.hasTeeth, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'Whale': - return super().__new__( - cls, - *args, - className=className, - hasBaleen=hasBaleen, - hasTeeth=hasTeeth, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py deleted file mode 100644 index 960a43f5921e..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from petstore_api import schemas # noqa: F401 - - -class Zebra( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "className", - } - - class properties: - - - class className( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "zebra": "ZEBRA", - } - - @schemas.classproperty - def ZEBRA(cls): - return cls("zebra") - - - class type( - schemas.EnumBase, - schemas.StrSchema - ): - - - class MetaOapg: - enum_value_to_name = { - "plains": "PLAINS", - "mountain": "MOUNTAIN", - "grevys": "GREVYS", - } - - @schemas.classproperty - def PLAINS(cls): - return cls("plains") - - @schemas.classproperty - def MOUNTAIN(cls): - return cls("mountain") - - @schemas.classproperty - def GREVYS(cls): - return cls("grevys") - __annotations__ = { - "className": className, - "type": type, - } - additional_properties = schemas.AnyTypeSchema - - className: MetaOapg.properties.className - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["type"]) -> MetaOapg.properties.type: ... - - @typing.overload - def __getitem__(self, name: str) -> MetaOapg.additional_properties: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["className"], typing_extensions.Literal["type"], str, ]): - # dict_instance[name] accessor - return super().__getitem__(name) - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["type"]) -> typing.Union[MetaOapg.properties.type, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[MetaOapg.additional_properties, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className"], typing_extensions.Literal["type"], str, ]): - return super().get_item_oapg(name) - - def __new__( - cls, - *args: typing.Union[dict, frozendict.frozendict, ], - className: typing.Union[MetaOapg.properties.className, str, ], - type: typing.Union[MetaOapg.properties.type, str, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], - ) -> 'Zebra': - return super().__new__( - cls, - *args, - className=className, - type=type, - _configuration=_configuration, - **kwargs, - ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py deleted file mode 100644 index 40e35989f9af..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py +++ /dev/null @@ -1,253 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 logging -import ssl -from urllib.parse import urlencode -import typing - -import certifi -import urllib3 -from urllib3._collections import HTTPHeaderDict - -from petstore_api.exceptions import ApiException, ApiValueError - - -logger = logging.getLogger(__name__) - - -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 - - # ca_certs - if configuration.ssl_ca_cert: - ca_certs = configuration.ssl_ca_cert - else: - # if not set certificate file, use Mozilla's root certificates. - ca_certs = certifi.where() - - 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=ca_certs, - 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=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request( - self, - method: str, - url: str, - headers: typing.Optional[HTTPHeaderDict] = None, - fields: typing.Optional[typing.Tuple[typing.Tuple[str, typing.Any], ...]] = None, - body: typing.Optional[typing.Union[str, bytes]] = None, - stream: bool = False, - timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - ) -> urllib3.HTTPResponse: - """Perform requests. - - :param method: http request method - :param url: http request url - :param headers: http request headers - :param body: request body, for other types - :param fields: request parameters for - `application/x-www-form-urlencoded` - or `multipart/form-data` - :param stream: if True, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is False. - :param 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 fields and body: - raise ApiValueError( - "body parameter cannot be used with fields parameter." - ) - - fields = fields or {} - headers = headers or {} - - if timeout: - if isinstance(timeout, (int, float)): # noqa: E501,F821 - timeout = urllib3.Timeout(total=timeout) - elif (isinstance(timeout, tuple) and - len(timeout) == 2): - timeout = urllib3.Timeout(connect=timeout[0], read=timeout[1]) - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if 'Content-Type' not in headers and body is None: - r = self.pool_manager.request( - method, - url, - preload_content=not stream, - timeout=timeout, - headers=headers - ) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - r = self.pool_manager.request( - method, url, - fields=fields, - encode_multipart=False, - preload_content=not stream, - 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=fields, - encode_multipart=True, - preload_content=not stream, - 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=not stream, - 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, - preload_content=not stream, - 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 not stream: - # log response body - logger.debug("response body: %s", r.data) - - return r - - def GET(self, url, headers=None, stream=False, - timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("GET", url, - headers=headers, - stream=stream, - timeout=timeout, - fields=fields) - - def HEAD(self, url, headers=None, stream=False, - timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("HEAD", url, - headers=headers, - stream=stream, - timeout=timeout, - fields=fields) - - def OPTIONS(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("OPTIONS", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def DELETE(self, url, headers=None, body=None, - stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("DELETE", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def POST(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("POST", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def PUT(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("PUT", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) - - def PATCH(self, url, headers=None, - body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: - return self.request("PATCH", url, - headers=headers, - stream=stream, - timeout=timeout, - body=body, fields=fields) diff --git a/samples/openapi3/client/petstore/python-experimental/requirements.txt b/samples/openapi3/client/petstore/python-experimental/requirements.txt deleted file mode 100644 index c9227e58a1be..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -certifi >= 14.05.14 -frozendict >= 2.0.3 -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.15.1 diff --git a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt deleted file mode 100644 index 36d9b4fa7a8c..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -pytest~=4.6.7 # needed for python 3.4 -pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 3.4 -pycryptodome>=3.9.0 diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_deserialization.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_deserialization.py deleted file mode 100644 index 7c0300fbcd1d..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_deserialization.py +++ /dev/null @@ -1,458 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd OpenAPIPetstore-python -$ nosetests -v -""" -from collections import namedtuple -from decimal import Decimal -import json -import typing -import unittest - -import urllib3 - -import petstore_api -from petstore_api import api_client -from petstore_api.schemas import NoneClass - - -MockResponse = namedtuple('MockResponse', 'data') - - -class DeserializationTests(unittest.TestCase): - json_content_type = 'application/json' - json_content_type_headers = {'content-type': json_content_type} - configuration = petstore_api.Configuration() - - @classmethod - def __response(cls, data: typing.Any) -> urllib3.HTTPResponse: - return urllib3.HTTPResponse( - json.dumps(data).encode('utf-8'), - headers=cls.json_content_type_headers - ) - - def test_deserialize_shape(self): - """ - - deserialize Shape to an instance of: - - EquilateralTriangle - - IsoscelesTriangle - - IsoscelesTriangle - - ScaleneTriangle - - ComplexQuadrilateral - - SimpleQuadrilateral - by traveling through 2 discriminators - """ - from petstore_api.model import shape, equilateral_triangle - _response_for_200 = api_client.OpenApiResponse( - content={ - self.json_content_type: api_client.MediaType(schema=shape.Shape), - }, - ) - data = { - 'shapeType': 'Triangle', - 'triangleType': 'EquilateralTriangle', - } - response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) - body = deserialized.body - self.assertTrue(isinstance(body, equilateral_triangle.EquilateralTriangle)) - self.assertEqual(body['shapeType'], 'Triangle') - self.assertEqual(body['triangleType'], 'EquilateralTriangle') - - # invalid quadrilateralType, second discriminator value - data = { - 'shapeType': 'Quadrilateral', - 'quadrilateralType': 'Triangle', - } - response = self.__response(data) - - err_msg = ( - r"Invalid discriminator value was passed in to Quadrilateral.quadrilateralType Only the values " - r"\['ComplexQuadrilateral', 'SimpleQuadrilateral'\] are allowed at \('args\[0\]', 'quadrilateralType'\)" - ) - with self.assertRaisesRegex(petstore_api.ApiValueError, err_msg): - _response_for_200.deserialize(response, self.configuration) - - def test_deserialize_animal(self): - """ - deserialize Animal to a Dog instance - Animal uses a discriminator which has a map built of child classes - that inherrit from Animal - This is the swagger (v2) way of doing something like oneOf composition - """ - from petstore_api.model import animal, dog - _response_for_200 = api_client.OpenApiResponse( - content={ - self.json_content_type: api_client.MediaType(schema=animal.Animal), - }, - ) - data = { - 'className': 'Dog', - 'color': 'white', - 'breed': 'Jack Russel Terrier' - } - response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) - body = deserialized.body - self.assertTrue(isinstance(body, dog.Dog)) - self.assertEqual(body['className'], 'Dog') - self.assertEqual(body['color'], 'white') - self.assertEqual(body['breed'], 'Jack Russel Terrier') - - def test_regex_constraint(self): - """ - Test regex pattern validation. - """ - from petstore_api.model import apple - - # Test with valid regex pattern. - inst = apple.Apple( - cultivar="Akane" - ) - assert isinstance(inst, apple.Apple) - - inst = apple.Apple( - cultivar="Golden Delicious", - origin="cHiLe" - ) - assert isinstance(inst, apple.Apple) - - # Test with invalid regex pattern. - err_regex = r"Invalid value `.+?`, must match regular expression `.+?` at \('args\[0\]', 'cultivar'\)" - with self.assertRaisesRegex( - petstore_api.ApiValueError, - err_regex - ): - inst = apple.Apple( - cultivar="!@#%@$#Akane" - ) - - err_regex = r"Invalid value `.+?`, must match regular expression `.+?` at \('args\[0\]', 'origin'\)" - with self.assertRaisesRegex( - petstore_api.ApiValueError, - err_regex - ): - inst = apple.Apple( - cultivar="Golden Delicious", - origin="!@#%@$#Chile" - ) - - def test_deserialize_mammal(self): - """ - deserialize mammal - mammal is a oneOf composed schema model with discriminator - """ - - # whale test - from petstore_api.model import mammal, zebra, whale - _response_for_200 = api_client.OpenApiResponse( - content={ - self.json_content_type: api_client.MediaType(schema=mammal.Mammal), - }, - ) - has_baleen = True - has_teeth = False - class_name = 'whale' - data = { - 'hasBaleen': has_baleen, - 'hasTeeth': has_teeth, - 'className': class_name - } - response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) - body = deserialized.body - self.assertTrue(isinstance(body, whale.Whale)) - self.assertEqual(bool(body['hasBaleen']), has_baleen) - self.assertEqual(bool(body['hasTeeth']), has_teeth) - self.assertEqual(body.className, class_name) - - # zebra test - zebra_type = 'plains' - class_name = 'zebra' - data = { - 'type': zebra_type, - 'className': class_name - } - response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) - body = deserialized.body - self.assertTrue(isinstance(body, zebra.Zebra)) - self.assertEqual(body['type'], zebra_type) - self.assertEqual(body.className, class_name) - - def test_deserialize_float_value(self): - """ - Deserialize floating point values. - """ - from petstore_api.model import banana - _response_for_200 = api_client.OpenApiResponse( - content={ - self.json_content_type: api_client.MediaType(schema=banana.Banana), - }, - ) - data = { - 'lengthCm': 3.1415 - } - response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) - body = deserialized.body - self.assertTrue(isinstance(body, banana.Banana)) - self.assertTrue(isinstance(body.lengthCm, Decimal)) - self.assertEqual(body.lengthCm, 3.1415) - - """ - Float value is serialized without decimal point - The client receive it as an integer, which work because Banana.lengthCm is type number without format - Which accepts int AND float - """ - data = { - 'lengthCm': 3 - } - response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) - body = deserialized.body - self.assertTrue(isinstance(body, banana.Banana)) - self.assertTrue(isinstance(body.lengthCm, Decimal)) - self.assertEqual(body.lengthCm, 3) - - def test_deserialize_fruit_null_value(self): - """ - deserialize fruit with null value. - fruitReq is a oneOf composed schema model with discriminator, including 'null' type. - """ - from petstore_api.model import fruit_req - _response_for_200 = api_client.OpenApiResponse( - content={ - self.json_content_type: api_client.MediaType(schema=fruit_req.FruitReq), - }, - ) - data = None - response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) - self.assertTrue(isinstance(deserialized.body, fruit_req.FruitReq)) - self.assertTrue(isinstance(deserialized.body, NoneClass)) - - def test_deserialize_with_additional_properties(self): - """ - Deserialize data with schemas that have the additionalProperties keyword. - Test conditions when additional properties are allowed, not allowed, have - specific types... - """ - - # Dog is allOf with two child schemas. - # The OAS document for Dog does not specify the 'additionalProperties' keyword, - # which means that by default, the Dog schema must allow undeclared properties. - # The additionalProperties keyword is used to control the handling of extra stuff, - # that is, properties whose names are not listed in the properties keyword. - # By default any additional properties are allowed. - from petstore_api.model import dog, mammal, zebra, banana_req - data = { - 'className': 'Dog', - 'color': 'brown', - 'breed': 'golden retriever', - # Below are additional, undeclared properties. - 'group': 'Terrier Group', - 'size': 'medium', - } - response = self.__response(data) - _response_for_200 = api_client.OpenApiResponse( - content={ - self.json_content_type: api_client.MediaType(schema=dog.Dog), - }, - ) - deserialized = _response_for_200.deserialize(response, self.configuration) - body = deserialized.body - self.assertTrue(isinstance(body, dog.Dog)) - self.assertEqual(body['className'], 'Dog') - self.assertEqual(body['color'], 'brown') - self.assertEqual(body['breed'], 'golden retriever') - self.assertEqual(body['group'], 'Terrier Group') - self.assertEqual(body['size'], 'medium') - - # The 'zebra' schema allows additional properties by explicitly setting - # additionalProperties: true. - # This is equivalent to 'additionalProperties' not being present. - data = { - 'className': 'zebra', - 'type': 'plains', - # Below are additional, undeclared properties - 'group': 'abc', - 'size': 3, - 'p1': True, - 'p2': ['a', 'b', 123], - } - response = self.__response(data) - _response_for_200 = api_client.OpenApiResponse( - content={ - self.json_content_type: api_client.MediaType(schema=mammal.Mammal), - }, - ) - deserialized = _response_for_200.deserialize(response, self.configuration) - body = deserialized.body - self.assertTrue(isinstance(body, zebra.Zebra)) - self.assertEqual(body['className'], 'zebra') - self.assertEqual(body['type'], 'plains') - self.assertEqual(bool(body['p1']), True) - - # The 'bananaReq' schema disallows additional properties by explicitly setting - # additionalProperties: false - _response_for_200 = api_client.OpenApiResponse( - content={ - self.json_content_type: api_client.MediaType(schema=banana_req.BananaReq), - }, - ) - with self.assertRaisesRegex( - petstore_api.exceptions.ApiTypeError, - r"BananaReq was passed 1 invalid argument: \['unknown-group'\]" - ): - data = { - 'lengthCm': 21.2, - 'sweet': False, - # Below are additional, undeclared properties. They are not allowed, - # an exception must be raised. - 'unknown-group': 'abc', - } - response = self.__response(data) - _response_for_200.deserialize(response, self.configuration) - - def test_deserialize_with_additional_properties_and_reference(self): - """ - Deserialize data with schemas that has the additionalProperties keyword - and the schema is specified as a reference ($ref). - """ - from petstore_api.model import drawing - _response_for_200 = api_client.OpenApiResponse( - content={ - self.json_content_type: api_client.MediaType(schema=drawing.Drawing), - }, - ) - data = { - 'mainShape': { - 'shapeType': 'Triangle', - 'triangleType': 'EquilateralTriangle', - }, - 'shapes': [ - { - 'shapeType': 'Triangle', - 'triangleType': 'IsoscelesTriangle', - }, - { - 'shapeType': 'Quadrilateral', - 'quadrilateralType': 'ComplexQuadrilateral', - }, - ], - 'an_additional_prop': { - 'lengthCm': 4, - 'color': 'yellow' - } - } - response = self.__response(data) - _response_for_200.deserialize(response, self.configuration) - - def test_deserialize_NumberWithValidations(self): - from petstore_api.model.number_with_validations import NumberWithValidations - from petstore_api.paths.fake_refs_number.post import _response_for_200 - - # make sure that an exception is thrown on an invalid type value - with self.assertRaises(petstore_api.ApiTypeError): - response = self.__response('test str') - _response_for_200.deserialize(response, self.configuration) - - # make sure that an exception is thrown on an invalid value - with self.assertRaises(petstore_api.ApiValueError): - response = self.__response(21.0) - _response_for_200.deserialize(response, self.configuration) - - # valid value works - number_val = 11.0 - response = self.__response(number_val) - response = _response_for_200.deserialize(response, self.configuration) - self.assertTrue(isinstance(response.body, NumberWithValidations)) - self.assertEqual(response.body, number_val) - - def test_array_of_enums(self): - from petstore_api.model.array_of_enums import ArrayOfEnums - from petstore_api.paths.fake_refs_array_of_enums.post import _response_for_200 - from petstore_api.model import string_enum - data = ["placed", None] - response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) - assert isinstance(deserialized.body, ArrayOfEnums) - expected_results = ArrayOfEnums([string_enum.StringEnum(v) for v in data]) - assert expected_results == deserialized.body - - def test_multiple_of_deserialization(self): - data = { - 'byte': '3', - 'date': '1970-01-01', - 'password': "abcdefghijkl", - 'integer': 30, - 'number': 65.0, - 'float': 62.4, - } - from petstore_api.model import format_test - _response_for_200 = api_client.OpenApiResponse( - content={ - self.json_content_type: api_client.MediaType(schema=format_test.FormatTest), - }, - ) - response = self.__response(data) - deserialized = _response_for_200.deserialize(response, self.configuration) - self.assertTrue(isinstance(deserialized.body, format_test.FormatTest)) - - with self.assertRaisesRegex( - petstore_api.exceptions.ApiValueError, - r"Invalid value `31`, value must be a multiple of `2` at \('args\[0\]', 'integer'\)" - ): - data = { - 'byte': '3', - 'date': '1970-01-01', - 'password': "abcdefghijkl", - 'integer': 31, # Value is supposed to be multiple of '2'. An error must be raised - 'number': 65.0, - 'float': 62.4, - } - response = self.__response(data) - _response_for_200.deserialize(response, self.configuration) - - # Disable JSON schema validation. No error should be raised during deserialization. - configuration = petstore_api.Configuration() - configuration.disabled_client_side_validations = "multipleOf" - - data = { - 'byte': '3', - 'date': '1970-01-01', - 'password': "abcdefghijkl", - 'integer': 31, # Value is supposed to be multiple of '2' - 'number': 65.0, - 'float': 62.4, - } - response = self.__response(data) - deserialized = _response_for_200.deserialize(response, configuration) - self.assertTrue(isinstance(deserialized.body, format_test.FormatTest)) - - # Disable JSON schema validation but for a different keyword. - # An error should be raised during deserialization. - configuration = petstore_api.Configuration() - configuration.disabled_client_side_validations = "maxItems" - - with self.assertRaisesRegex( - petstore_api.exceptions.ApiValueError, - r"Invalid value `31`, value must be a multiple of `2` at \('args\[0\]', 'integer'\)" - ): - data = { - 'byte': '3', - 'date': '1970-01-01', - 'password': "abcdefghijkl", - 'integer': 31, # Value is supposed to be multiple of '2' - 'number': 65.0, - 'float': 62.4, - } - response = self.__response(data) - _response_for_200.deserialize(response, configuration) diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_discard_unknown_properties.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_discard_unknown_properties.py deleted file mode 100644 index 97d850d56b68..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_discard_unknown_properties.py +++ /dev/null @@ -1,157 +0,0 @@ -# # 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 -# """ -# from collections import namedtuple -# import json -# import re -# import unittest -# -# import petstore_api -# from petstore_api.model import cat, dog, isosceles_triangle, banana_req -# from petstore_api import Configuration, signing -# -# from petstore_api.schemas import ( -# file_type, -# model_to_dict, -# ) -# -# MockResponse = namedtuple('MockResponse', 'data') -# -# class DiscardUnknownPropertiesTests(unittest.TestCase): -# -# def test_deserialize_banana_req_do_not_discard_unknown_properties(self): -# """ -# deserialize bananaReq with unknown properties. -# Strict validation is enabled. -# Simple (non-composed) schema scenario. -# """ -# config = Configuration(discard_unknown_keys=False) -# api_client = petstore_api.ApiClient(config) -# data = { -# 'lengthCm': 21.3, -# 'sweet': False, -# # Below is an unknown property not explicitly declared in the OpenAPI document. -# # It should not be in the payload because additional properties (undeclared) are -# # not allowed in the bananaReq schema (additionalProperties: false). -# 'unknown_property': 'a-value' -# } -# response = MockResponse(data=json.dumps(data)) -# -# # Deserializing with strict validation raises an exception because the 'unknown_property' -# # is undeclared. -# with self.assertRaises(petstore_api.exceptions.ApiAttributeError) as cm: -# deserialized = api_client.deserialize(response, ((banana_req.BananaReq),), True) -# self.assertTrue(re.match("BananaReq has no attribute 'unknown_property' at.*", str(cm.exception)), -# 'Exception message: {0}'.format(str(cm.exception))) -# -# -# def test_deserialize_isosceles_triangle_do_not_discard_unknown_properties(self): -# """ -# deserialize IsoscelesTriangle with unknown properties. -# Strict validation is enabled. -# Composed schema scenario. -# """ -# config = Configuration(discard_unknown_keys=False) -# api_client = petstore_api.ApiClient(config) -# data = { -# 'shape_type': 'Triangle', -# 'triangle_type': 'EquilateralTriangle', -# # Below is an unknown property not explicitly declared in the OpenAPI document. -# # It should not be in the payload because additional properties (undeclared) are -# # not allowed in the schema (additionalProperties: false). -# 'unknown_property': 'a-value' -# } -# response = MockResponse(data=json.dumps(data)) -# -# # Deserializing with strict validation raises an exception because the 'unknown_property' -# # is undeclared. -# with self.assertRaises(petstore_api.ApiValueError) as cm: -# deserialized = api_client.deserialize(response, ((isosceles_triangle.IsoscelesTriangle),), True) -# self.assertTrue(re.match('.*Not all inputs were used.*unknown_property.*', str(cm.exception)), -# 'Exception message: {0}'.format(str(cm.exception))) -# -# -# def test_deserialize_banana_req_discard_unknown_properties(self): -# """ -# Deserialize bananaReq with unknown properties. -# Discard unknown properties. -# """ -# config = Configuration(discard_unknown_keys=True) -# api_client = petstore_api.ApiClient(config) -# data = { -# 'lengthCm': 21.3, -# 'sweet': False, -# # Below are additional (undeclared) properties not specified in the bananaReq schema. -# 'unknown_property': 'a-value', -# 'more-unknown': [ -# 'a' -# ] -# } -# # The 'unknown_property' is undeclared, which would normally raise an exception, but -# # when discard_unknown_keys is set to True, the unknown properties are discarded. -# response = MockResponse(data=json.dumps(data)) -# deserialized = api_client.deserialize(response, ((banana_req.BananaReq),), True) -# self.assertTrue(isinstance(deserialized, banana_req.BananaReq)) -# # Check the 'unknown_property' and 'more-unknown' properties are not present in the -# # output. -# self.assertIn("length_cm", deserialized.to_dict().keys()) -# self.assertNotIn("unknown_property", deserialized.to_dict().keys()) -# self.assertNotIn("more-unknown", deserialized.to_dict().keys()) -# -# def test_deserialize_cat_do_not_discard_unknown_properties(self): -# """ -# Deserialize Cat with unknown properties. -# Strict validation is enabled. -# """ -# config = Configuration(discard_unknown_keys=False) -# api_client = petstore_api.ApiClient(config) -# data = { -# "class_name": "Cat", -# "color": "black", -# "declawed": True, -# "dynamic-property": 12345, -# } -# response = MockResponse(data=json.dumps(data)) -# -# # Deserializing with strict validation does not raise an exception because the even though -# # the 'dynamic-property' is undeclared, the 'Cat' schema defines the additionalProperties -# # attribute. -# deserialized = api_client.deserialize(response, ((cat.Cat),), True) -# self.assertTrue(isinstance(deserialized, cat.Cat)) -# self.assertIn('color', deserialized.to_dict()) -# self.assertEqual(deserialized['color'], 'black') -# -# def test_deserialize_cat_discard_unknown_properties(self): -# """ -# Deserialize Cat with unknown properties. -# Request to discard unknown properties, but Cat is composed schema -# with one inner schema that has 'additionalProperties' set to true. -# """ -# config = Configuration(discard_unknown_keys=True) -# api_client = petstore_api.ApiClient(config) -# data = { -# "class_name": "Cat", -# "color": "black", -# "declawed": True, -# # Below are additional (undeclared) properties. -# "my_additional_property": 123, -# } -# # The 'my_additional_property' is undeclared, but 'Cat' has a 'Address' type through -# # the allOf: [ $ref: '#/components/schemas/Address' ]. -# response = MockResponse(data=json.dumps(data)) -# deserialized = api_client.deserialize(response, ((cat.Cat),), True) -# self.assertTrue(isinstance(deserialized, cat.Cat)) -# # Check the 'unknown_property' and 'more-unknown' properties are not present in the -# # output. -# self.assertIn("declawed", deserialized.to_dict().keys()) -# self.assertIn("my_additional_property", deserialized.to_dict().keys()) -# diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_drawing.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_drawing.py deleted file mode 100644 index 2febc75e3625..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_drawing.py +++ /dev/null @@ -1,165 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 sys -import unittest - -import petstore_api -from petstore_api.schemas import NoneClass -from petstore_api.model import shape -from petstore_api.model import shape_or_null -from petstore_api.model.drawing import Drawing - - -class TestDrawing(unittest.TestCase): - """Drawing unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def test_create_instances(self): - """ - Validate instance can be created - """ - - inst = shape.Shape( - shapeType="Triangle", - triangleType="IsoscelesTriangle" - ) - from petstore_api.model.isosceles_triangle import IsoscelesTriangle - assert isinstance(inst, IsoscelesTriangle) - - def test_deserialize_oneof_reference(self): - """ - Validate the scenario when the type of a OAS property is 'oneOf', and the 'oneOf' - schema is specified as a reference ($ref), not an inline 'oneOf' schema. - """ - isosceles_triangle = shape.Shape( - shapeType="Triangle", - triangleType="IsoscelesTriangle" - ) - from petstore_api.model.isosceles_triangle import IsoscelesTriangle - assert isinstance(isosceles_triangle, IsoscelesTriangle) - from petstore_api.model.equilateral_triangle import EquilateralTriangle - - inst = Drawing( - mainShape=isosceles_triangle, - shapes=[ - shape.Shape( - shapeType="Triangle", - triangleType="EquilateralTriangle" - ), - shape.Shape( - shapeType="Triangle", - triangleType="IsoscelesTriangle" - ), - shape.Shape( - shapeType="Triangle", - triangleType="EquilateralTriangle" - ), - shape.Shape( - shapeType="Quadrilateral", - quadrilateralType="ComplexQuadrilateral" - ) - ], - ) - assert isinstance(inst, Drawing) - assert isinstance(inst["mainShape"], IsoscelesTriangle) - self.assertEqual(len(inst["shapes"]), 4) - from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral - assert isinstance(inst["shapes"][0], EquilateralTriangle) - assert isinstance(inst["shapes"][1], IsoscelesTriangle) - assert isinstance(inst["shapes"][2], EquilateralTriangle) - assert isinstance(inst["shapes"][3], ComplexQuadrilateral) - - # Validate we cannot assign the None value to mainShape because the 'null' type - # is not one of the allowed types in the 'Shape' schema. - err_msg = (r"Invalid inputs given to generate an instance of .+?Shape.+? " - r"None of the oneOf schemas matched the input data.") - with self.assertRaisesRegex( - petstore_api.ApiValueError, - err_msg - ): - Drawing( - # 'mainShape' has type 'Shape', which is a oneOf [triangle, quadrilateral] - # So the None value should not be allowed and an exception should be raised. - mainShape=None, - ) - - """ - We can pass in a Triangle instance in shapes - Under the hood it is converted into a dict, and that dict payload - does validate as a Shape, so this works - """ - from petstore_api.model.triangle import Triangle - inst = Drawing( - mainShape=isosceles_triangle, - shapes=[ - Triangle( - shapeType="Triangle", - triangleType="EquilateralTriangle" - ) - ] - ) - self.assertEqual(len(inst["shapes"]), 1) - from petstore_api.model.triangle_interface import TriangleInterface - shapes = inst["shapes"] - assert isinstance(shapes[0], shape.Shape) - assert isinstance(shapes[0], Triangle) - assert isinstance(shapes[0], EquilateralTriangle) - assert isinstance(shapes[0], TriangleInterface) - - def test_deserialize_oneof_reference_with_null_type(self): - """ - Validate the scenario when the type of a OAS property is 'oneOf', and the 'oneOf' - schema is specified as a reference ($ref), not an inline 'oneOf' schema. - Further, the 'oneOf' schema has a 'null' type child schema (as introduced in - OpenAPI 3.1). - """ - - # Validate we can assign the None value to shape_or_null, because the 'null' type - # is one of the allowed types in the 'ShapeOrNull' schema. - inst = Drawing( - # 'shapeOrNull' has type 'ShapeOrNull', which is a oneOf [null, triangle, quadrilateral] - shapeOrNull=None, - ) - assert isinstance(inst, Drawing) - self.assertFalse('mainShape' in inst) - self.assertTrue('shapeOrNull' in inst) - self.assertTrue(isinstance(inst["shapeOrNull"], NoneClass)) - - def test_deserialize_oneof_reference_with_nullable_type(self): - """ - Validate the scenario when the type of a OAS property is 'oneOf', and the 'oneOf' - schema is specified as a reference ($ref), not an inline 'oneOf' schema. - Further, the 'oneOf' schema has the 'nullable' attribute (as introduced in - OpenAPI 3.0 and deprecated in 3.1). - """ - - # Validate we can assign the None value to nullableShape, because the NullableShape - # has the 'nullable: true' attribute. - inst = Drawing( - # 'nullableShape' has type 'NullableShape', which is a oneOf [triangle, quadrilateral] - # and the 'nullable: true' attribute. - nullableShape=None, - ) - assert isinstance(inst, Drawing) - self.assertFalse('mainShape' in inst) - self.assertTrue('nullableShape' in inst) - self.assertTrue(isinstance(inst["nullableShape"], NoneClass)) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py deleted file mode 100644 index 4c2132ae3d85..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py +++ /dev/null @@ -1,805 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" -from email.mime import multipart -from email.mime import nonmultipart -import io -import sys -import unittest -import typing -from unittest.mock import patch - -import urllib3 -import petstore_api -from petstore_api import api_client, schemas, exceptions -from petstore_api.apis.tags.fake_api import FakeApi # noqa: E501 -from petstore_api.rest import RESTClientObject - -from . import ApiTestMixin - - -class MIMEFormdata(nonmultipart.MIMENonMultipart): - def __init__(self, keyname, *args, **kwargs): - super(MIMEFormdata, self).__init__(*args, **kwargs) - self.add_header( - "Content-Disposition", "form-data; name=\"%s\"" % keyname) - - -class TestFakeApi(ApiTestMixin): - """FakeApi unit test stubs""" - configuration = petstore_api.Configuration() - api = FakeApi(api_client=api_client.ApiClient(configuration=configuration)) - - def test_array_model(self): - from petstore_api.model import animal_farm, animal - - # serialization + deserialization works - with patch.object(RESTClientObject, 'request') as mock_request: - json_data = [{"className": "Cat", "color": "black"}] - mock_request.return_value = self.response( - self.json_bytes(json_data) - ) - - cat = animal.Animal(className="Cat", color="black") - body = animal_farm.AnimalFarm([cat]) - api_response = self.api.array_model(body=body) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/refs/arraymodel', - body=self.json_bytes(json_data) - ) - - assert isinstance(api_response.body, animal_farm.AnimalFarm) - assert api_response.body == body - - def test_recursionlimit(self): - """Test case for recursionlimit - - """ - assert sys.getrecursionlimit() == 1234 - - def test_array_of_enums(self): - from petstore_api.model import array_of_enums, string_enum - - # serialization + deserialization works - with patch.object(RESTClientObject, 'request') as mock_request: - value = [string_enum.StringEnum("placed")] - body = array_of_enums.ArrayOfEnums(value) - value_simple = ["placed"] - mock_request.return_value = self.response( - self.json_bytes(value_simple) - ) - - api_response = self.api.array_of_enums(body=body) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/refs/array-of-enums', - body=self.json_bytes(value_simple) - ) - - assert isinstance(api_response.body, array_of_enums.ArrayOfEnums) - assert api_response.body == body - - def test_number_with_validations(self): - from petstore_api.model import number_with_validations - - # serialization + deserialization works - with patch.object(RESTClientObject, 'request') as mock_request: - value = 10.0 - body = number_with_validations.NumberWithValidations(value) - mock_request.return_value = self.response( - self.json_bytes(value) - ) - - api_response = self.api.number_with_validations(body=body) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/refs/number', - body=self.json_bytes(value) - ) - - assert isinstance(api_response.body, number_with_validations.NumberWithValidations) - assert api_response.body == value - - def test_composed_one_of_different_types(self): - from petstore_api.model import composed_one_of_different_types - - # serialization + deserialization works - number = composed_one_of_different_types.ComposedOneOfDifferentTypes(10.0) - cat = composed_one_of_different_types.ComposedOneOfDifferentTypes( - className="Cat", color="black" - ) - none_instance = composed_one_of_different_types.ComposedOneOfDifferentTypes(None) - date_instance = composed_one_of_different_types.ComposedOneOfDifferentTypes('1970-01-01') - cast_to_simple_value = [ - (number, 10.0), - (cat, {"className": "Cat", "color": "black"}), - (none_instance, None), - (date_instance, '1970-01-01'), - ] - for (body, value_simple) in cast_to_simple_value: - with patch.object(RESTClientObject, 'request') as mock_request: - mock_request.return_value = self.response( - self.json_bytes(value_simple) - ) - - api_response = self.api.composed_one_of_different_types(body=body) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/refs/composed_one_of_number_with_validations', - body=self.json_bytes(value_simple) - ) - - assert isinstance(api_response.body, composed_one_of_different_types.ComposedOneOfDifferentTypes) - assert api_response.body == body - - # inputting the uncast values into the endpoint also works - for (body, value_simple) in cast_to_simple_value: - with patch.object(RESTClientObject, 'request') as mock_request: - mock_request.return_value = self.response( - self.json_bytes(value_simple) - ) - - api_response = self.api.composed_one_of_different_types(body=value_simple) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/refs/composed_one_of_number_with_validations', - body=self.json_bytes(value_simple) - ) - - assert isinstance(api_response.body, composed_one_of_different_types.ComposedOneOfDifferentTypes) - assert api_response.body == body - - def test_string(self): - # serialization + deserialization works - with patch.object(RESTClientObject, 'request') as mock_request: - body = "blah" - value_simple = body - mock_request.return_value = self.response( - self.json_bytes(value_simple) - ) - - api_response = self.api.string(body=body) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/refs/string', - body=self.json_bytes(value_simple) - ) - - assert isinstance(api_response.body, str) - assert api_response.body == value_simple - - def test_string_enum(self): - from petstore_api.model import string_enum - # serialization + deserialization works - with patch.object(RESTClientObject, 'request') as mock_request: - value = "placed" - body = string_enum.StringEnum(value) - mock_request.return_value = self.response( - self.json_bytes(value) - ) - - api_response = self.api.string_enum(body=body) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/refs/enum', - body=self.json_bytes(value) - ) - - assert isinstance(api_response.body, string_enum.StringEnum) - assert api_response.body == value - - def test_mammal(self): - # serialization + deserialization works - from petstore_api.model.mammal import Mammal - with patch.object(RESTClientObject, 'request') as mock_request: - body = Mammal(className="BasquePig") - value_simple = dict(className='BasquePig') - mock_request.return_value = self.response( - self.json_bytes(value_simple) - ) - - api_response = self.api.mammal(body=body) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/refs/mammal', - body=self.json_bytes(value_simple) - ) - - assert isinstance(api_response.body, Mammal) - assert api_response.body == value_simple - - def test_missing_or_unset_required_body(self): - # missing required body - with self.assertRaises(TypeError): - self.api.mammal() - # required body may not be unset - with self.assertRaises(petstore_api.ApiValueError): - self.api.mammal(body=schemas.unset) - - def test_missing_or_unset_required_query_parameter(self): - from petstore_api.model.user import User - user = User({}) - # missing required query param - with self.assertRaises(petstore_api.ApiTypeError): - self.api.body_with_query_params(body=user) - # required query param may not be unset - with self.assertRaises(petstore_api.ApiValueError): - self.api.body_with_query_params(body=schemas.unset, query_params=dict(query=schemas.unset)) - - def test_body_with_query_params(self): - from petstore_api.model import user - with patch.object(RESTClientObject, 'request') as mock_request: - - value_simple = dict( - id=1, - username='first last', - firstName='first', - lastName='last' - ) - body = user.User(**value_simple) - mock_request.return_value = self.response( - b'' - ) - - api_response = self.api.body_with_query_params( - body=body, - query_params=dict(query='hi there') - ) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/body-with-query-params?query=hi%20there', - method='PUT', - body=self.json_bytes(value_simple), - accept_content_type=None - ) - - assert isinstance(api_response.body, api_client.Unset) - assert api_response.response.status == 200 - - def test_upload_download_file_tx_bytes_and_file(self): - """Test case for upload_download_file - uploads a file and downloads a file using application/octet-stream # noqa: E501 - """ - import os - test_file_dir = os.path.realpath( - os.path.join(os.path.dirname(__file__), "..", "testfiles")) - file_name = '1px_pic1.png' - file_path1 = os.path.join(test_file_dir, file_name) - - with open(file_path1, "rb") as some_file: - file_bytes = some_file.read() - file1 = open(file_path1, "rb") - mock_response = self.response( - file_bytes, - content_type='application/octet-stream' - ) - try: - with patch.object(RESTClientObject, 'request') as mock_request: - mock_request.return_value = mock_response - api_response = self.api.upload_download_file(body=file1) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/uploadDownloadFile', - body=file_bytes, - content_type='application/octet-stream', - accept_content_type='application/octet-stream' - ) - self.assertTrue(isinstance(api_response.body, schemas.BinarySchema)) - self.assertTrue(isinstance(api_response.body, schemas.BytesSchema)) - self.assertTrue(isinstance(api_response.body, bytes)) - self.assertEqual(api_response.body, file_bytes) - except petstore_api.ApiException as e: - self.fail("upload_file() raised {0} unexpectedly".format(type(e))) - finally: - file1.close() - - # sending just bytes works also - with patch.object(RESTClientObject, 'request') as mock_request: - mock_request.return_value = mock_response - api_response = self.api.upload_download_file(body=file_bytes) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/uploadDownloadFile', - body=file_bytes, - content_type='application/octet-stream', - accept_content_type='application/octet-stream' - ) - self.assertEqual(api_response.body, file_bytes) - - def test_upload_download_file_rx_file(self): - import os - test_file_dir = os.path.realpath( - os.path.join(os.path.dirname(__file__), "..", "testfiles")) - file_name = '1px_pic1.png' - file_path1 = os.path.join(test_file_dir, file_name) - - with open(file_path1, "rb") as some_file: - file_bytes = some_file.read() - - # passing in file1 as the response body simulates a streamed response - file1 = open(file_path1, "rb") - - class StreamableBody: - """ - This class simulates http.client.HTTPResponse for a streamable response - """ - def __init__(self, file: io.BufferedReader): - self.fp = file - - def read(self, *args, **kwargs): - return self.fp.read(*args, **kwargs) - - def close(self): - self.fp.close() - - streamable_body = StreamableBody(file1) - - mock_response = self.response( - streamable_body, - content_type='application/octet-stream', - preload_content=False - ) - with patch.object(RESTClientObject, 'request') as mock_request: - mock_request.return_value = mock_response - api_response = self.api.upload_download_file(body=file_bytes, stream=True) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/uploadDownloadFile', - body=file_bytes, - content_type='application/octet-stream', - accept_content_type='application/octet-stream', - stream=True - ) - self.assertTrue(file1.closed) - self.assertTrue(isinstance(api_response.body, schemas.BinarySchema)) - self.assertTrue(isinstance(api_response.body, schemas.FileSchema)) - self.assertTrue(isinstance(api_response.body, schemas.FileIO)) - self.assertEqual(api_response.body.read(), file_bytes) - api_response.body.close() - os.unlink(api_response.body.name) - - file1 = open(file_path1, "rb") - streamable_body = StreamableBody(file1) - saved_file_name = "fileName.abc" - - """ - when streaming is used and the response contains the content disposition header with a filename - that filename is used when saving the file locally - """ - mock_response = self.response( - streamable_body, - content_type='application/octet-stream', - headers={'content-disposition': f'attachment; filename="{saved_file_name}"'}, - preload_content=False - ) - with patch.object(RESTClientObject, 'request') as mock_request: - mock_request.return_value = mock_response - api_response = self.api.upload_download_file(body=file_bytes, stream=True) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/uploadDownloadFile', - body=file_bytes, - content_type='application/octet-stream', - accept_content_type='application/octet-stream', - stream=True - ) - self.assertTrue(file1.closed) - self.assertTrue(isinstance(api_response.body, schemas.BinarySchema)) - self.assertTrue(isinstance(api_response.body, schemas.FileSchema)) - self.assertTrue(isinstance(api_response.body, schemas.FileIO)) - self.assertTrue(api_response.body.name.endswith(saved_file_name)) - self.assertEqual(api_response.body.read(), file_bytes) - api_response.body.close() - os.unlink(api_response.body.name) - - """ - when streaming is used and the response contains the content disposition header without a filename - the url of response is used to extract the filename. - """ - file1 = open(file_path1, "rb") - streamable_body = StreamableBody(file1) - expected_filename = "the_file.ext" - - no_filename_mock_response = self.response( - streamable_body, - content_type='application/octet-stream', - headers={'content-disposition': 'attachment'}, - preload_content=False - ) - - with patch.object(RESTClientObject, 'request') as mock_request: - no_filename_mock_response.geturl = lambda: f'http://foo.bar/{expected_filename}' - mock_request.return_value = no_filename_mock_response - api_response = self.api.upload_download_file(body=file_bytes, stream=True) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/uploadDownloadFile', - body=file_bytes, - content_type='application/octet-stream', - accept_content_type='application/octet-stream', - stream=True - ) - self.assertTrue(file1.closed) - self.assertTrue(isinstance(api_response.body, schemas.BinarySchema)) - self.assertTrue(isinstance(api_response.body, schemas.FileSchema)) - self.assertTrue(isinstance(api_response.body, schemas.FileIO)) - self.assertTrue(api_response.body.name.endswith(expected_filename)) - self.assertEqual(api_response.body.read(), file_bytes) - api_response.body.close() - os.unlink(api_response.body.name) - - def test_upload_file(self): - """Test case for upload_file - uploads a file using multipart/form-data # noqa: E501 - """ - import os - test_file_dir = os.path.realpath( - os.path.join(os.path.dirname(__file__), "..", "testfiles")) - file_name = '1px_pic1.png' - file_path1 = os.path.join(test_file_dir, file_name) - - with open(file_path1, "rb") as some_file: - file_bytes = some_file.read() - file1 = open(file_path1, "rb") - response_json = { - 'code': 200, - 'type': 'blah', - 'message': 'file upload succeeded' - } - try: - with patch.object(RESTClientObject, 'request') as mock_request: - mock_request.return_value = self.response( - self.json_bytes(response_json) - ) - api_response = self.api.upload_file(body={'file': file1}) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/uploadFile', - fields=( - api_client.RequestField( - name='file', - data=file_bytes, - filename=file_name, - headers={'Content-Type': 'application/octet-stream'} - ), - ), - content_type='multipart/form-data' - ) - self.assertEqual(api_response.body, response_json) - except petstore_api.ApiException as e: - self.fail("upload_file() raised {0} unexpectedly".format(type(e))) - finally: - file1.close() - - # sending just bytes works also - with patch.object(RESTClientObject, 'request') as mock_request: - mock_request.return_value = self.response( - self.json_bytes(response_json) - ) - api_response = self.api.upload_file(body={'file': file_bytes}) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/uploadFile', - fields=( - api_client.RequestField( - name='file', - data=file_bytes, - headers={'Content-Type': 'application/octet-stream'} - ), - ), - content_type='multipart/form-data' - ) - self.assertEqual(api_response.body, response_json) - - # passing in an array of files to when file only allows one - # raises an exceptions - try: - file = open(file_path1, "rb") - with self.assertRaises(petstore_api.ApiTypeError): - self.api.upload_file(body={'file': [file]}) - finally: - file.close() - - # passing in a closed file raises an exception - with self.assertRaises(ValueError): - file = open(file_path1, "rb") - file.close() - self.api.upload_file(body={'file': file}) - - def test_upload_files(self): - """Test case for upload_files - uploads files using multipart/form-data # noqa: E501 - """ - import os - test_file_dir = os.path.realpath( - os.path.join(os.path.dirname(__file__), "..", "testfiles")) - file_name = '1px_pic1.png' - file_path1 = os.path.join(test_file_dir, file_name) - - with open(file_path1, "rb") as some_file: - file_bytes = some_file.read() - file1 = open(file_path1, "rb") - file2 = open(file_path1, "rb") - response_json = { - 'code': 200, - 'type': 'blah', - 'message': 'file upload succeeded' - } - try: - with patch.object(RESTClientObject, 'request') as mock_request: - mock_request.return_value = self.response( - self.json_bytes(response_json) - ) - api_response = self.api.upload_files(body={'files': [file1, file2]}) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/uploadFiles', - fields=( - api_client.RequestField( - name='files', - data=file_bytes, - filename=file_name, - headers={'Content-Type': 'application/octet-stream'} - ), - api_client.RequestField( - name='files', - data=file_bytes, - filename=file_name, - headers={'Content-Type': 'application/octet-stream'} - ), - ), - content_type='multipart/form-data' - ) - self.assertEqual(api_response.body, response_json) - except petstore_api.ApiException as e: - self.fail("upload_file() raised {0} unexpectedly".format(type(e))) - finally: - file1.close() - file2.close() - - # sending just bytes works also - with patch.object(RESTClientObject, 'request') as mock_request: - mock_request.return_value = self.response( - self.json_bytes(response_json) - ) - api_response = self.api.upload_files(body={'files': [file_bytes, file_bytes]}) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/uploadFiles', - fields=( - api_client.RequestField( - name='files', - data=file_bytes, - headers={'Content-Type': 'application/octet-stream'} - ), - api_client.RequestField( - name='files', - data=file_bytes, - headers={'Content-Type': 'application/octet-stream'} - ), - ), - content_type='multipart/form-data' - ) - self.assertEqual(api_response.body, response_json) - - @staticmethod - def __encode_multipart_formdata(fields: typing.Dict[str, typing.Any]) -> multipart.MIMEMultipart: - m = multipart.MIMEMultipart("form-data") - - for field, value in fields.items(): - data = MIMEFormdata(field, "text", "plain") - # data.set_payload(value, charset='us-ascii') - data.set_payload(value) - m.attach(data) - - return m - - @patch.object(RESTClientObject, 'request') - def test_inline_composition(self, mock_request): - """Test case for inline_composition - - testing composed schemas at inline locations # noqa: E501 - """ - single_char_str = 'a' - json_bytes = self.json_bytes(single_char_str) - - # tx and rx json with composition at root level of schema for request + response body - content_type = 'application/json' - mock_request.return_value = self.response( - json_bytes - ) - api_response = self.api.inline_composition( - body=single_char_str, - query_params={ - 'compositionAtRoot': single_char_str, - 'compositionInProperty': {'someProp': single_char_str} - }, - accept_content_types=(content_type,) - ) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/inlineComposition/?compositionAtRoot=a&someProp=a', - accept_content_type=content_type, - content_type=content_type, - body=json_bytes - ) - self.assertEqual(api_response.body, single_char_str) - self.assertTrue(isinstance(api_response.body, schemas.StrSchema)) - - # tx and rx json with composition at property level of schema for request + response body - content_type = 'multipart/form-data' - multipart_response = self.__encode_multipart_formdata(fields={'someProp': single_char_str}) - mock_request.return_value = self.response( - bytes(multipart_response), - content_type=multipart_response.get_content_type() - ) - api_response = self.api.inline_composition( - body={'someProp': single_char_str}, - query_params={ - 'compositionAtRoot': single_char_str, - 'compositionInProperty': {'someProp': single_char_str} - }, - content_type=content_type, - accept_content_types=(content_type,) - ) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/inlineComposition/?compositionAtRoot=a&someProp=a', - accept_content_type=content_type, - content_type=content_type, - fields=( - api_client.RequestField( - name='someProp', - data=single_char_str, - headers={'Content-Type': 'text/plain'} - ), - ), - ) - self.assertEqual(api_response.body, {'someProp': single_char_str}) - self.assertTrue(isinstance(api_response.body["someProp"], schemas.StrSchema)) - - # error thrown when a str is input which doesn't meet the composed schema length constraint - invalid_value = '' - variable_locations = 4 - for invalid_index in range(variable_locations): - values = [single_char_str]*variable_locations - values[invalid_index] = invalid_value - with self.assertRaises(exceptions.ApiValueError): - multipart_response = self.__encode_multipart_formdata(fields={'someProp': values[0]}) - mock_request.return_value = self.response( - bytes(multipart_response), - content_type=multipart_response.get_content_type() - ) - self.api.inline_composition( - body={'someProp': values[1]}, - query_params={ - 'compositionAtRoot': values[2], - 'compositionInProperty': {'someProp': values[3]} - }, - content_type=content_type, - accept_content_types=(content_type,) - ) - - def test_json_with_charset(self): - # serialization + deserialization of json with charset works - with patch.object(RESTClientObject, 'request') as mock_request: - body = None - content_type_with_charset = 'application/json; charset=utf-8' - mock_request.return_value = self.response( - self.json_bytes(body), - content_type=content_type_with_charset - ) - - api_response = self.api.json_with_charset(body=body) - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/jsonWithCharset', - body=self.json_bytes(body), - content_type=content_type_with_charset, - accept_content_type=content_type_with_charset - ) - - assert isinstance(api_response.body, schemas.AnyTypeSchema) - assert isinstance(api_response.body, schemas.NoneClass) - assert api_response.body.is_none_oapg() - - def test_response_without_schema(self): - # received response is not loaded into body because there is no deserialization schema defined - with patch.object(RESTClientObject, 'request') as mock_request: - body = None - content_type = 'application/json' - mock_request.return_value = self.response( - self.json_bytes(body), - ) - - api_response = self.api.response_without_schema() - self.assert_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/responseWithoutSchema', - method='GET', - accept_content_type='application/json, application/xml', - content_type=None - ) - - assert isinstance(api_response.body, schemas.Unset) - - - with patch.object(RESTClientObject, 'request') as mock_request: - mock_request.return_value = self.response( - 'blah', - content_type='text/plain' - ) - - # when an incorrect content-type is sent back, and exception is raised - with self.assertRaises(exceptions.ApiValueError): - self.api.response_without_schema() - - def test_delete_endpoint_without_request_body(self): - with patch.object(urllib3.PoolManager, 'request') as mock_request: - - body = None - mock_request.return_value = self.response( - self.json_bytes(body), - ) - - api_response = self.api.delete_coffee(path_params=dict(id='1')) - self.assert_pool_manager_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/deleteCoffee/1', - method='DELETE', - content_type=None, - accept_content_type=None, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - assert isinstance(api_response.headers, schemas.Unset) - - def test_json_patch(self): - with patch.object(urllib3.PoolManager, 'request') as mock_request: - from petstore_api.model import json_patch_request - from petstore_api.model import json_patch_request_add_replace_test - - mock_request.return_value = self.response("") - body = json_patch_request.JSONPatchRequest( - [ - json_patch_request_add_replace_test.JSONPatchRequestAddReplaceTest( - op='add', - path='/a/b/c', - value='foo', - ) - ] - ) - api_response = self.api.json_patch(body) - json_body = [ - { - 'op': 'add', - 'path': '/a/b/c', - 'value': 'foo' - } - ] - self.assert_pool_manager_request_called_with( - mock_request, - 'http://petstore.swagger.io:80/v2/fake/jsonPatch', - body=self.json_bytes(json_body), - method='PATCH', - content_type='application/json-patch+json', - accept_content_type=None, - ) - - assert isinstance(api_response.response, urllib3.HTTPResponse) - assert isinstance(api_response.body, schemas.Unset) - assert isinstance(api_response.headers, schemas.Unset) - assert api_response.response.status == 200 - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fruit.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fruit.py deleted file mode 100644 index 6f1a22655534..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fruit.py +++ /dev/null @@ -1,134 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 unittest - -import petstore_api -from petstore_api.model import apple -from petstore_api.model import banana -from petstore_api.model.fruit import Fruit -from petstore_api import schemas - - -class TestFruit(unittest.TestCase): - """Fruit unit test stubs""" - - def testFruit(self): - """Test Fruit""" - - # make an instance of Fruit, a composed schema oneOf model - # banana test - length_cm = 20.3 - color = 'yellow' - fruit = Fruit(lengthCm=length_cm, color=color) - # check its properties - self.assertEqual(fruit['lengthCm'], length_cm) - self.assertEqual(fruit.get('lengthCm'), length_cm) - self.assertEqual(fruit['color'], color) - self.assertEqual(fruit.get('color'), color) - - # check the dict representation - self.assertEqual( - fruit, - { - 'lengthCm': length_cm, - 'color': color - } - ) - # setting values after instance creation is not allowed - with self.assertRaises(TypeError): - fruit['color'] = 'some value' - - # getting a value that doesn't exist raises an exception - # with a key - with self.assertRaises(KeyError): - assert fruit['cultivar'] - assert fruit.get_item_oapg('cultivar') is schemas.unset - - # make sure that the ModelComposed class properties are correct - self.assertEqual( - Fruit.MetaOapg.one_of(), - [ - apple.Apple, - banana.Banana, - ], - ) - - """ - including extra parameters does not raise an exception - because objects support additional properties by default - """ - kwargs = dict( - color=color, - lengthCm=length_cm, - additional_string='some value', - additional_date='2021-01-02', - ) - - fruit = Fruit.from_openapi_data_oapg(**kwargs) - self.assertEqual( - fruit, - kwargs - ) - - fruit = Fruit(**kwargs) - self.assertEqual( - fruit, - kwargs - ) - - # including input parameters for two oneOf instances raise an exception - with self.assertRaises(petstore_api.ApiValueError): - Fruit( - lengthCm=length_cm, - cultivar='granny smith' - ) - - # make an instance of Fruit, a composed schema oneOf model - # apple test - color = 'red' - cultivar = 'golden delicious' - fruit = Fruit(color=color, cultivar=cultivar) - # check its properties - self.assertEqual(fruit['color'], color) - self.assertEqual(fruit['cultivar'], cultivar) - # check the dict representation - self.assertEqual( - fruit, - { - 'color': color, - 'cultivar': cultivar - } - ) - - def testFruitNullValue(self): - # Since 'apple' is nullable, validate we can create an apple with the 'null' value. - fruit = apple.Apple(None) - assert isinstance(fruit, schemas.Singleton) - assert isinstance(fruit, apple.Apple) - assert fruit.is_none_oapg() is True - - # 'banana' is not nullable. - # TODO cast this into ApiTypeError? - with self.assertRaises(TypeError): - banana.Banana(None) - - # Since 'fruit' has oneOf 'apple', 'banana' and 'apple' is nullable, - # validate we can create a fruit with the 'null' value. - fruit = Fruit(None) - assert isinstance(fruit, schemas.Singleton) - assert isinstance(fruit, apple.Apple) - assert isinstance(fruit, Fruit) - assert fruit.is_none_oapg() is True - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fruit_req.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fruit_req.py deleted file mode 100644 index bdabb193648a..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fruit_req.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 unittest - -import petstore_api -from petstore_api.model import apple_req -from petstore_api.model import banana_req -from petstore_api.model.fruit_req import FruitReq -from petstore_api import schemas - - -class TestFruitReq(unittest.TestCase): - """FruitReq unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFruitReq(self): - """Test FruitReq""" - - # make an instance of Fruit, a composed schema oneOf model - # banana test - length_cm = 20.3 - fruit = FruitReq(lengthCm=length_cm) - # check its properties - self.assertEqual(fruit.lengthCm, length_cm) - self.assertEqual(fruit['lengthCm'], length_cm) - self.assertEqual(getattr(fruit, 'lengthCm'), length_cm) - # check the dict representation - self.assertEqual( - fruit, - { - 'lengthCm': length_cm, - } - ) - # setting values after instance creation is not allowed - with self.assertRaises(TypeError): - fruit['lengthCm'] = 'some value' - - # setting values after instance creation is not allowed - with self.assertRaises(AttributeError): - setattr(fruit, 'lengthCm', 'some value') - - # getting a value that doesn't exist raises an exception - # with a key - with self.assertRaises(KeyError): - fruit['cultivar'] - with self.assertRaises(AttributeError): - fruit.cultivar - assert fruit.get_item_oapg('cultivar') is schemas.unset - - # with getattr - self.assertEqual(getattr(fruit, 'cultivar', 'some value'), 'some value') - - with self.assertRaises(AttributeError): - getattr(fruit, 'cultivar') - - # make sure that the ModelComposed class properties are correct - self.assertEqual( - FruitReq.MetaOapg.one_of(), - [ - schemas.NoneSchema, - apple_req.AppleReq, - banana_req.BananaReq, - ], - ) - - # including extra parameters raises an exception - with self.assertRaises(petstore_api.ApiValueError): - FruitReq( - length_cm=length_cm, - unknown_property='some value' - ) - - # including input parameters for two oneOf instances raise an exception - with self.assertRaises(petstore_api.ApiValueError): - FruitReq( - length_cm=length_cm, - cultivar='granny smith' - ) - - # make an instance of Fruit, a composed schema oneOf model - # apple test - cultivar = 'golden delicious' - fruit = FruitReq(cultivar=cultivar) - # check its properties - self.assertEqual(fruit.cultivar, cultivar) - self.assertEqual(fruit['cultivar'], cultivar) - self.assertEqual(getattr(fruit, 'cultivar'), cultivar) - # check the dict representation - self.assertEqual( - fruit, - { - 'cultivar': cultivar - } - ) - - # we can pass in None - fruit = FruitReq(None) - assert isinstance(fruit, schemas.Singleton) - assert isinstance(fruit, FruitReq) - assert isinstance(fruit, schemas.NoneSchema) - assert fruit.is_none_oapg() is True - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_gm_fruit.py deleted file mode 100644 index ad650460a4cf..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_gm_fruit.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 unittest - -import frozendict - -from petstore_api.model import apple -from petstore_api.model import banana -from petstore_api.model.gm_fruit import GmFruit -from petstore_api import schemas - -class TestGmFruit(unittest.TestCase): - """GmFruit unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testGmFruit(self): - """Test GmFruit""" - - # make an instance of GmFruit, a composed schema anyOf model - # banana test - length_cm = 20.3 - color = 'yellow' - cultivar = 'banaple' - fruit = GmFruit(lengthCm=length_cm, color=color, cultivar=cultivar) - assert isinstance(fruit, banana.Banana) - assert isinstance(fruit, apple.Apple) - assert isinstance(fruit, frozendict.frozendict) - assert isinstance(fruit, GmFruit) - # check its properties - self.assertEqual(fruit['lengthCm'], length_cm) - self.assertEqual(fruit['color'], color) - - # check the dict representation - self.assertEqual( - fruit, - { - 'lengthCm': length_cm, - 'color': color, - 'cultivar': cultivar - } - ) - - # unset key access raises KeyError - with self.assertRaises(KeyError): - fruit["origin"] - with self.assertRaises(AttributeError): - fruit.origin - assert fruit.get_item_oapg("origin") is schemas.unset - - with self.assertRaises(KeyError): - fruit['unknown_variable'] - assert fruit.get_item_oapg("unknown_variable") is schemas.unset - # with getattr - self.assertTrue(getattr(fruit, 'origin', 'some value'), 'some value') - - # make sure that the ModelComposed class properties are correct - self.assertEqual( - GmFruit.MetaOapg.any_of(), - [ - apple.Apple, - banana.Banana, - ], - ) - - # including extra parameters works - GmFruit( - color=color, - length_cm=length_cm, - cultivar=cultivar, - unknown_property='some value' - ) - - # including input parameters for both anyOf instances works - color = 'orange' - fruit = GmFruit( - color=color, - cultivar=cultivar, - length_cm=length_cm - ) - self.assertEqual(fruit['color'], color) - self.assertEqual(fruit['cultivar'], cultivar) - self.assertEqual(fruit['length_cm'], length_cm) - - # make an instance of GmFruit, a composed schema anyOf model - # apple test - color = 'red' - cultivar = 'golden delicious' - origin = 'California' - fruit = GmFruit(color=color, cultivar=cultivar, origin=origin) - # check its properties - self.assertEqual(fruit['color'], color) - self.assertEqual(fruit['cultivar'], cultivar) - self.assertEqual(fruit['origin'], origin) - - # check the dict representation - self.assertEqual( - fruit, - { - 'color': color, - 'cultivar': cultivar, - 'origin': origin, - } - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_http_signature.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_http_signature.py deleted file mode 100644 index 1db56c65dd2d..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_http_signature.py +++ /dev/null @@ -1,518 +0,0 @@ -# # 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 -# """ -# -# 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.model import category, tag, pet -# from petstore_api.apis.tags.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 = category.Category() -# cls.category.id = id_gen() -# cls.category.name = "dog" -# cls.tag = tag.Tag() -# cls.tag.id = id_gen() -# cls.tag.name = "python-pet-tag" -# cls.pet = pet.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 acces_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)), -# 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 acces_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)), -# 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 acces_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)), -# 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 acces_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)), -# 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 acces_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)), -# 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-experimental/tests_manual/test_integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_integer_enum_one_value.py deleted file mode 100644 index a5d92cd0833e..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_integer_enum_one_value.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 sys -import unittest - -import petstore_api -from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue - - -class TestIntegerEnumOneValue(unittest.TestCase): - """IntegerEnumOneValue unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testIntegerEnumOneValue(self): - """Test IntegerEnumOneValue""" - - with self.assertRaises(TypeError): - """ - a value must be passed in - We cannot auto assign values because that would break composition if - received payloads included this with no inputs and we the 0 value to the data to the incoming payload - One is not allowed to mutate incoming payloads because then: - - order of composed schema ingestion matters - - one can have default value collisions - - the added data will make expected schemas not match payloads - """ - model = IntegerEnumOneValue() - - model = IntegerEnumOneValue(0) - assert model == 0, "We can also pass in the value as a positional arg" - - # one cannot pass the value with the value keyword - with self.assertRaises(TypeError): - model = IntegerEnumOneValue(value=0) - - # one can pass in the enum value - model = IntegerEnumOneValue(IntegerEnumOneValue.POSITIVE_0) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_model_with_ref_props.py deleted file mode 100644 index 42fc674cd2dd..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_model_with_ref_props.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 unittest - -import frozendict - -from petstore_api.schemas import BoolClass -from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps -from petstore_api.model.number_with_validations import NumberWithValidations - - -class TestObjectModelWithRefProps(unittest.TestCase): - """ObjectModelWithRefProps unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testObjectModelWithRefProps(self): - """Test ObjectModelWithRefProps""" - inst = ObjectModelWithRefProps(myNumber=15.0, myString="a", myBoolean=True) - assert isinstance(inst, ObjectModelWithRefProps) - assert isinstance(inst, frozendict.frozendict) - assert set(inst.keys()) == {"myNumber", "myString", "myBoolean"} - assert inst["myNumber"] == 15.0 - assert isinstance(inst["myNumber"], NumberWithValidations) - assert inst["myString"] == 'a' - assert isinstance(inst["myString"], ObjectModelWithRefProps.MetaOapg.properties.myString) - assert bool(inst["myBoolean"]) is True - assert isinstance(inst["myBoolean"], ObjectModelWithRefProps.MetaOapg.properties.myBoolean) - assert isinstance(inst["myBoolean"], BoolClass) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py deleted file mode 100644 index 80bab5b805b1..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 sys -import unittest - -import frozendict - -import petstore_api -from petstore_api.schemas import Singleton -from petstore_api.model.shape import Shape -from petstore_api.model import complex_quadrilateral -from petstore_api.model import simple_quadrilateral -from petstore_api.model import triangle -from petstore_api.model import triangle_interface -from petstore_api.model import equilateral_triangle -from petstore_api.model import isosceles_triangle -from petstore_api.model import scalene_triangle - - -class TestShape(unittest.TestCase): - """Shape unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def test_recursionlimit(self): - """Test case for recursionlimit - - """ - assert sys.getrecursionlimit() == 1234 - - def testShape(self): - """Test Shape""" - - tri = Shape( - shapeType="Triangle", - triangleType="EquilateralTriangle" - ) - assert isinstance(tri, equilateral_triangle.EquilateralTriangle) - assert isinstance(tri, triangle.Triangle) - assert isinstance(tri, triangle_interface.TriangleInterface) - assert isinstance(tri, Shape) - assert isinstance(tri, frozendict.frozendict) - assert isinstance(tri.shapeType, str) - assert isinstance(tri.shapeType, Singleton) - - tri = Shape( - shapeType="Triangle", - triangleType="IsoscelesTriangle" - ) - assert isinstance(tri, isosceles_triangle.IsoscelesTriangle) - - tri = Shape( - shapeType="Triangle", - triangleType="ScaleneTriangle" - ) - assert isinstance(tri, scalene_triangle.ScaleneTriangle) - - quad = Shape( - shapeType="Quadrilateral", - quadrilateralType="ComplexQuadrilateral" - ) - assert isinstance(quad, complex_quadrilateral.ComplexQuadrilateral) - - quad = Shape( - shapeType="Quadrilateral", - quadrilateralType="SimpleQuadrilateral" - ) - assert isinstance(quad, simple_quadrilateral.SimpleQuadrilateral) - - # data missing - with self.assertRaisesRegex( - petstore_api.exceptions.ApiValueError, - r"Cannot deserialize input data due to missing discriminator. The discriminator " - r"property 'shapeType' is missing at path: \('args\[0\]',\)" - ): - Shape({}) - - # invalid shape_type (first discriminator). 'Circle' does not exist in the model. - err_msg = ( - r"Invalid discriminator value was passed in to Shape.shapeType Only the values " - r"\['Quadrilateral', 'Triangle'\] are allowed at \('args\[0\]', 'shapeType'\)" - ) - with self.assertRaisesRegex( - petstore_api.ApiValueError, - err_msg - ): - Shape(shapeType="Circle") - - # invalid quadrilateral_type (second discriminator) - err_msg = ( - r"Invalid discriminator value was passed in to Quadrilateral.quadrilateralType Only the values " - r"\['ComplexQuadrilateral', 'SimpleQuadrilateral'\] are allowed at \('args\[0\]', 'quadrilateralType'\)" - ) - with self.assertRaisesRegex( - petstore_api.ApiValueError, - err_msg - ): - Shape( - shapeType="Quadrilateral", - quadrilateralType="Triangle" - ) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_triangle.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_triangle.py deleted file mode 100644 index 3d19a8d65fa7..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_triangle.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 unittest - -import frozendict - -from petstore_api.model.equilateral_triangle import EquilateralTriangle -from petstore_api.model.isosceles_triangle import IsoscelesTriangle -from petstore_api.model.scalene_triangle import ScaleneTriangle -from petstore_api.model.triangle import Triangle -from petstore_api.model.triangle_interface import TriangleInterface - - -class TestTriangle(unittest.TestCase): - """Triangle unit test stubs""" - - def testTriangle(self): - """Test Triangle""" - tri_classes = [EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle] - for tri_class in tri_classes: - tri = Triangle(shapeType="Triangle", triangleType=tri_class.__name__) - assert isinstance(tri, tri_class) - assert isinstance(tri, Triangle) - assert isinstance(tri, TriangleInterface) - assert isinstance(tri, frozendict.frozendict) - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/.gitignore b/samples/openapi3/client/petstore/python-prior/.gitignore similarity index 96% rename from samples/openapi3/client/petstore/python-experimental/.gitignore rename to samples/openapi3/client/petstore/python-prior/.gitignore index a62e8aba43f8..43995bd42fa2 100644 --- a/samples/openapi3/client/petstore/python-experimental/.gitignore +++ b/samples/openapi3/client/petstore/python-prior/.gitignore @@ -33,7 +33,6 @@ var/ # Installer logs pip-log.txt pip-delete-this-directory.txt -dev-requirements.txt.log # Unit test / coverage reports htmlcov/ diff --git a/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-prior/.gitlab-ci.yml similarity index 91% rename from samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml rename to samples/openapi3/client/petstore/python-prior/.gitlab-ci.yml index 611e425676ee..9e84f5176163 100644 --- a/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml +++ b/samples/openapi3/client/petstore/python-prior/.gitlab-ci.yml @@ -10,9 +10,6 @@ stages: - pip install -r test-requirements.txt - pytest --cov=petstore_api -test-3.5: - extends: .tests - image: python:3.5-alpine test-3.6: extends: .tests image: python:3.6-alpine @@ -22,3 +19,6 @@ test-3.7: test-3.8: extends: .tests image: python:3.8-alpine +test-3.9: + extends: .tests + image: python:3.9-alpine diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore b/samples/openapi3/client/petstore/python-prior/.openapi-generator-ignore similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore rename to samples/openapi3/client/petstore/python-prior/.openapi-generator-ignore diff --git a/samples/openapi3/client/petstore/python-prior/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-prior/.openapi-generator/FILES new file mode 100644 index 000000000000..aa32ba2deeb9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/.openapi-generator/FILES @@ -0,0 +1,236 @@ +.gitignore +.gitlab-ci.yml +.travis.yml +README.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesWithArrayOfEnums.md +docs/Address.md +docs/Animal.md +docs/AnimalFarm.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/Apple.md +docs/AppleReq.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfEnums.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Banana.md +docs/BananaReq.md +docs/BasquePig.md +docs/BooleanEnum.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ChildCat.md +docs/ChildCatAllOf.md +docs/ClassModel.md +docs/Client.md +docs/ComplexQuadrilateral.md +docs/ComposedOneOfNumberWithValidations.md +docs/ComposedSchemaWithPropsAndNoAddProps.md +docs/DanishPig.md +docs/DefaultApi.md +docs/Dog.md +docs/DogAllOf.md +docs/Drawing.md +docs/EgressThresholdOptions.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/EquilateralTriangle.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FooGetDefaultResponse.md +docs/FooObject.md +docs/FormatTest.md +docs/Fruit.md +docs/FruitReq.md +docs/GmFruit.md +docs/GmFruitNoProperties.md +docs/GrandparentAnimal.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/InlineAdditionalPropertiesRefPayload.md +docs/IntegerEnum.md +docs/IntegerEnumOneValue.md +docs/IntegerEnumWithDefaultValue.md +docs/IsoscelesTriangle.md +docs/Legs.md +docs/List.md +docs/Mammal.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Mole.md +docs/Name.md +docs/NullableClass.md +docs/NullableShape.md +docs/NumberOnly.md +docs/NumberWithValidations.md +docs/ObjectInterface.md +docs/ObjectModelWithRefProps.md +docs/ObjectWithValidations.md +docs/Order.md +docs/ParentPet.md +docs/Pet.md +docs/PetApi.md +docs/Pig.md +docs/PostInlineAdditionalPropertiesPayloadRequest.md +docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md +docs/PublishOptions.md +docs/PublishOptionsPublish.md +docs/Quadrilateral.md +docs/QuadrilateralInterface.md +docs/ReadOnlyFirst.md +docs/Readonly.md +docs/ScaleneTriangle.md +docs/Shape.md +docs/ShapeInterface.md +docs/ShapeOrNull.md +docs/SimpleQuadrilateral.md +docs/SomeObject.md +docs/SomeObjectWithSelfAttr.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/StreamOptions.md +docs/StringBooleanMap.md +docs/StringEnum.md +docs/StringEnumWithDefaultValue.md +docs/Tag.md +docs/Triangle.md +docs/TriangleInterface.md +docs/User.md +docs/UserApi.md +docs/Whale.md +docs/Zebra.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/apis/__init__.py +petstore_api/configuration.py +petstore_api/exceptions.py +petstore_api/model/__init__.py +petstore_api/model/additional_properties_class.py +petstore_api/model/additional_properties_with_array_of_enums.py +petstore_api/model/address.py +petstore_api/model/animal.py +petstore_api/model/animal_farm.py +petstore_api/model/api_response.py +petstore_api/model/apple.py +petstore_api/model/apple_req.py +petstore_api/model/array_of_array_of_number_only.py +petstore_api/model/array_of_enums.py +petstore_api/model/array_of_number_only.py +petstore_api/model/array_test.py +petstore_api/model/banana.py +petstore_api/model/banana_req.py +petstore_api/model/basque_pig.py +petstore_api/model/boolean_enum.py +petstore_api/model/capitalization.py +petstore_api/model/cat.py +petstore_api/model/cat_all_of.py +petstore_api/model/category.py +petstore_api/model/child_cat.py +petstore_api/model/child_cat_all_of.py +petstore_api/model/class_model.py +petstore_api/model/client.py +petstore_api/model/complex_quadrilateral.py +petstore_api/model/composed_one_of_number_with_validations.py +petstore_api/model/composed_schema_with_props_and_no_add_props.py +petstore_api/model/danish_pig.py +petstore_api/model/dog.py +petstore_api/model/dog_all_of.py +petstore_api/model/drawing.py +petstore_api/model/egress_threshold_options.py +petstore_api/model/enum_arrays.py +petstore_api/model/enum_class.py +petstore_api/model/enum_test.py +petstore_api/model/equilateral_triangle.py +petstore_api/model/file.py +petstore_api/model/file_schema_test_class.py +petstore_api/model/foo.py +petstore_api/model/foo_get_default_response.py +petstore_api/model/foo_object.py +petstore_api/model/format_test.py +petstore_api/model/fruit.py +petstore_api/model/fruit_req.py +petstore_api/model/gm_fruit.py +petstore_api/model/gm_fruit_no_properties.py +petstore_api/model/grandparent_animal.py +petstore_api/model/has_only_read_only.py +petstore_api/model/health_check_result.py +petstore_api/model/inline_additional_properties_ref_payload.py +petstore_api/model/integer_enum.py +petstore_api/model/integer_enum_one_value.py +petstore_api/model/integer_enum_with_default_value.py +petstore_api/model/isosceles_triangle.py +petstore_api/model/legs.py +petstore_api/model/list.py +petstore_api/model/mammal.py +petstore_api/model/map_test.py +petstore_api/model/mixed_properties_and_additional_properties_class.py +petstore_api/model/model200_response.py +petstore_api/model/model_return.py +petstore_api/model/mole.py +petstore_api/model/name.py +petstore_api/model/nullable_class.py +petstore_api/model/nullable_shape.py +petstore_api/model/number_only.py +petstore_api/model/number_with_validations.py +petstore_api/model/object_interface.py +petstore_api/model/object_model_with_ref_props.py +petstore_api/model/object_with_validations.py +petstore_api/model/order.py +petstore_api/model/parent_pet.py +petstore_api/model/pet.py +petstore_api/model/pig.py +petstore_api/model/post_inline_additional_properties_payload_request.py +petstore_api/model/post_inline_additional_properties_payload_request_array_data_inner.py +petstore_api/model/publish_options.py +petstore_api/model/publish_options_publish.py +petstore_api/model/quadrilateral.py +petstore_api/model/quadrilateral_interface.py +petstore_api/model/read_only_first.py +petstore_api/model/readonly.py +petstore_api/model/scalene_triangle.py +petstore_api/model/shape.py +petstore_api/model/shape_interface.py +petstore_api/model/shape_or_null.py +petstore_api/model/simple_quadrilateral.py +petstore_api/model/some_object.py +petstore_api/model/some_object_with_self_attr.py +petstore_api/model/special_model_name.py +petstore_api/model/stream_options.py +petstore_api/model/string_boolean_map.py +petstore_api/model/string_enum.py +petstore_api/model/string_enum_with_default_value.py +petstore_api/model/tag.py +petstore_api/model/triangle.py +petstore_api/model/triangle_interface.py +petstore_api/model/user.py +petstore_api/model/whale.py +petstore_api/model/zebra.py +petstore_api/model_utils.py +petstore_api/models/__init__.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-experimental/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-prior/.openapi-generator/VERSION similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION rename to samples/openapi3/client/petstore/python-prior/.openapi-generator/VERSION diff --git a/samples/openapi3/client/petstore/python-experimental/.travis.yml b/samples/openapi3/client/petstore/python-prior/.travis.yml similarity index 96% rename from samples/openapi3/client/petstore/python-experimental/.travis.yml rename to samples/openapi3/client/petstore/python-prior/.travis.yml index f931f0f74b96..1fcc4b155964 100644 --- a/samples/openapi3/client/petstore/python-experimental/.travis.yml +++ b/samples/openapi3/client/petstore/python-prior/.travis.yml @@ -1,10 +1,10 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "3.5" - "3.6" - "3.7" - "3.8" + - "3.9" # command to install dependencies install: - "pip install -r requirements.txt" diff --git a/samples/openapi3/client/petstore/python-prior/Makefile b/samples/openapi3/client/petstore/python-prior/Makefile new file mode 100644 index 000000000000..f8957d5ed65d --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/Makefile @@ -0,0 +1,16 @@ +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_python.sh diff --git a/samples/openapi3/client/petstore/python-prior/README.md b/samples/openapi3/client/petstore/python-prior/README.md new file mode 100644 index 000000000000..0b59228e6f19 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/README.md @@ -0,0 +1,306 @@ +# 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.PythonPriorClientCodegen + +## Requirements. + +Python >=3.6 + +## 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 +import datetime +import time +import petstore_api +from pprint import pprint +from petstore_api.api import another_fake_api +from petstore_api.model.client import Client +# 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 = another_fake_api.AnotherFakeApi(api_client) + client = Client( + client="client_example", + ) # Client | client model + + try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(client) + pprint(api_response) + except petstore_api.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* | [**additional_properties_with_array_of_enums**](docs/FakeApi.md#additional_properties_with_array_of_enums) | **GET** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums +*FakeApi* | [**array_model**](docs/FakeApi.md#array_model) | **POST** /fake/refs/arraymodel | +*FakeApi* | [**array_of_enums**](docs/FakeApi.md#array_of_enums) | **POST** /fake/refs/array-of-enums | Array of Enums +*FakeApi* | [**boolean**](docs/FakeApi.md#boolean) | **POST** /fake/refs/boolean | +*FakeApi* | [**composed_one_of_number_with_validations**](docs/FakeApi.md#composed_one_of_number_with_validations) | **POST** /fake/refs/composed_one_of_number_with_validations | +*FakeApi* | [**download_attachment**](docs/FakeApi.md#download_attachment) | **GET** /{fileName} | downloads a file using Content-Disposition +*FakeApi* | [**enum_test**](docs/FakeApi.md#enum_test) | **POST** /fake/refs/enum-test | Object contains enum properties and array properties containing enums +*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**mammal**](docs/FakeApi.md#mammal) | **POST** /fake/refs/mammal | +*FakeApi* | [**number_with_validations**](docs/FakeApi.md#number_with_validations) | **POST** /fake/refs/number | +*FakeApi* | [**object_model_with_ref_props**](docs/FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props | +*FakeApi* | [**post_inline_additional_properties_payload**](docs/FakeApi.md#post_inline_additional_properties_payload) | **POST** /fake/postInlineAdditionalPropertiesPayload | +*FakeApi* | [**post_inline_additional_properties_ref_payload**](docs/FakeApi.md#post_inline_additional_properties_ref_payload) | **POST** /fake/postInlineAdditionalPropertiesRefPayload | +*FakeApi* | [**string**](docs/FakeApi.md#string) | **POST** /fake/refs/string | +*FakeApi* | [**string_enum**](docs/FakeApi.md#string_enum) | **POST** /fake/refs/enum | +*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_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum 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 | +*FakeApi* | [**tx_rx_all_of_model**](docs/FakeApi.md#tx_rx_all_of_model) | **POST** /fake/TxRxAllOfModel | +*FakeApi* | [**tx_rx_any_of_model**](docs/FakeApi.md#tx_rx_any_of_model) | **POST** /fake/TxRxAnyOfModel | +*FakeApi* | [**upload_download_file**](docs/FakeApi.md#upload_download_file) | **POST** /fake/uploadDownloadFile | uploads a file and downloads a file using application/octet-stream +*FakeApi* | [**upload_file**](docs/FakeApi.md#upload_file) | **POST** /fake/uploadFile | uploads a file using multipart/form-data +*FakeApi* | [**upload_files**](docs/FakeApi.md#upload_files) | **POST** /fake/uploadFiles | uploads files using multipart/form-data +*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 +*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) + - [AdditionalPropertiesWithArrayOfEnums](docs/AdditionalPropertiesWithArrayOfEnums.md) + - [Address](docs/Address.md) + - [Animal](docs/Animal.md) + - [AnimalFarm](docs/AnimalFarm.md) + - [ApiResponse](docs/ApiResponse.md) + - [Apple](docs/Apple.md) + - [AppleReq](docs/AppleReq.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfEnums](docs/ArrayOfEnums.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Banana](docs/Banana.md) + - [BananaReq](docs/BananaReq.md) + - [BasquePig](docs/BasquePig.md) + - [BooleanEnum](docs/BooleanEnum.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [CatAllOf](docs/CatAllOf.md) + - [Category](docs/Category.md) + - [ChildCat](docs/ChildCat.md) + - [ChildCatAllOf](docs/ChildCatAllOf.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [ComplexQuadrilateral](docs/ComplexQuadrilateral.md) + - [ComposedOneOfNumberWithValidations](docs/ComposedOneOfNumberWithValidations.md) + - [ComposedSchemaWithPropsAndNoAddProps](docs/ComposedSchemaWithPropsAndNoAddProps.md) + - [DanishPig](docs/DanishPig.md) + - [Dog](docs/Dog.md) + - [DogAllOf](docs/DogAllOf.md) + - [Drawing](docs/Drawing.md) + - [EgressThresholdOptions](docs/EgressThresholdOptions.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [EquilateralTriangle](docs/EquilateralTriangle.md) + - [File](docs/File.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Foo](docs/Foo.md) + - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md) + - [FooObject](docs/FooObject.md) + - [FormatTest](docs/FormatTest.md) + - [Fruit](docs/Fruit.md) + - [FruitReq](docs/FruitReq.md) + - [GmFruit](docs/GmFruit.md) + - [GmFruitNoProperties](docs/GmFruitNoProperties.md) + - [GrandparentAnimal](docs/GrandparentAnimal.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/HealthCheckResult.md) + - [InlineAdditionalPropertiesRefPayload](docs/InlineAdditionalPropertiesRefPayload.md) + - [IntegerEnum](docs/IntegerEnum.md) + - [IntegerEnumOneValue](docs/IntegerEnumOneValue.md) + - [IntegerEnumWithDefaultValue](docs/IntegerEnumWithDefaultValue.md) + - [IsoscelesTriangle](docs/IsoscelesTriangle.md) + - [Legs](docs/Legs.md) + - [List](docs/List.md) + - [Mammal](docs/Mammal.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelReturn](docs/ModelReturn.md) + - [Mole](docs/Mole.md) + - [Name](docs/Name.md) + - [NullableClass](docs/NullableClass.md) + - [NullableShape](docs/NullableShape.md) + - [NumberOnly](docs/NumberOnly.md) + - [NumberWithValidations](docs/NumberWithValidations.md) + - [ObjectInterface](docs/ObjectInterface.md) + - [ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) + - [ObjectWithValidations](docs/ObjectWithValidations.md) + - [Order](docs/Order.md) + - [ParentPet](docs/ParentPet.md) + - [Pet](docs/Pet.md) + - [Pig](docs/Pig.md) + - [PostInlineAdditionalPropertiesPayloadRequest](docs/PostInlineAdditionalPropertiesPayloadRequest.md) + - [PostInlineAdditionalPropertiesPayloadRequestArrayDataInner](docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md) + - [PublishOptions](docs/PublishOptions.md) + - [PublishOptionsPublish](docs/PublishOptionsPublish.md) + - [Quadrilateral](docs/Quadrilateral.md) + - [QuadrilateralInterface](docs/QuadrilateralInterface.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Readonly](docs/Readonly.md) + - [ScaleneTriangle](docs/ScaleneTriangle.md) + - [Shape](docs/Shape.md) + - [ShapeInterface](docs/ShapeInterface.md) + - [ShapeOrNull](docs/ShapeOrNull.md) + - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) + - [SomeObject](docs/SomeObject.md) + - [SomeObjectWithSelfAttr](docs/SomeObjectWithSelfAttr.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [StreamOptions](docs/StreamOptions.md) + - [StringBooleanMap](docs/StringBooleanMap.md) + - [StringEnum](docs/StringEnum.md) + - [StringEnumWithDefaultValue](docs/StringEnumWithDefaultValue.md) + - [Tag](docs/Tag.md) + - [Triangle](docs/Triangle.md) + - [TriangleInterface](docs/TriangleInterface.md) + - [User](docs/User.md) + - [Whale](docs/Whale.md) + - [Zebra](docs/Zebra.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 + +- **Type**: HTTP signature authentication + + +## petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + + +## Author + + + + +## Notes for Large OpenAPI documents +If the OpenAPI document is large, imports in petstore_api.apis and petstore_api.models may fail with a +RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: + +Solution 1: +Use specific imports for apis and models like: +- `from petstore_api.api.default_api import DefaultApi` +- `from petstore_api.model.pet import Pet` + +Solution 2: +Before importing the package, adjust the maximum recursion limit as shown below: +``` +import sys +sys.setrecursionlimit(1500) +import petstore_api +from petstore_api.apis import * +from petstore_api.models import * +``` + diff --git a/samples/openapi3/client/petstore/python-experimental/dev-requirements.txt b/samples/openapi3/client/petstore/python-prior/dev-requirements.txt similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/dev-requirements.txt rename to samples/openapi3/client/petstore/python-prior/dev-requirements.txt diff --git a/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-prior/docs/AdditionalPropertiesClass.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/AdditionalPropertiesClass.md rename to samples/openapi3/client/petstore/python-prior/docs/AdditionalPropertiesClass.md diff --git a/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesWithArrayOfEnums.md b/samples/openapi3/client/petstore/python-prior/docs/AdditionalPropertiesWithArrayOfEnums.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/AdditionalPropertiesWithArrayOfEnums.md rename to samples/openapi3/client/petstore/python-prior/docs/AdditionalPropertiesWithArrayOfEnums.md diff --git a/samples/openapi3/client/petstore/python/docs/Address.md b/samples/openapi3/client/petstore/python-prior/docs/Address.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Address.md rename to samples/openapi3/client/petstore/python-prior/docs/Address.md diff --git a/samples/openapi3/client/petstore/python/docs/Animal.md b/samples/openapi3/client/petstore/python-prior/docs/Animal.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Animal.md rename to samples/openapi3/client/petstore/python-prior/docs/Animal.md diff --git a/samples/openapi3/client/petstore/python/docs/AnimalFarm.md b/samples/openapi3/client/petstore/python-prior/docs/AnimalFarm.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/AnimalFarm.md rename to samples/openapi3/client/petstore/python-prior/docs/AnimalFarm.md diff --git a/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-prior/docs/AnotherFakeApi.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md rename to samples/openapi3/client/petstore/python-prior/docs/AnotherFakeApi.md diff --git a/samples/openapi3/client/petstore/python/docs/ApiResponse.md b/samples/openapi3/client/petstore/python-prior/docs/ApiResponse.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ApiResponse.md rename to samples/openapi3/client/petstore/python-prior/docs/ApiResponse.md diff --git a/samples/openapi3/client/petstore/python/docs/Apple.md b/samples/openapi3/client/petstore/python-prior/docs/Apple.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Apple.md rename to samples/openapi3/client/petstore/python-prior/docs/Apple.md diff --git a/samples/openapi3/client/petstore/python/docs/AppleReq.md b/samples/openapi3/client/petstore/python-prior/docs/AppleReq.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/AppleReq.md rename to samples/openapi3/client/petstore/python-prior/docs/AppleReq.md diff --git a/samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-prior/docs/ArrayOfArrayOfNumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md rename to samples/openapi3/client/petstore/python-prior/docs/ArrayOfArrayOfNumberOnly.md diff --git a/samples/openapi3/client/petstore/python/docs/ArrayOfEnums.md b/samples/openapi3/client/petstore/python-prior/docs/ArrayOfEnums.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ArrayOfEnums.md rename to samples/openapi3/client/petstore/python-prior/docs/ArrayOfEnums.md diff --git a/samples/openapi3/client/petstore/python/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-prior/docs/ArrayOfNumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ArrayOfNumberOnly.md rename to samples/openapi3/client/petstore/python-prior/docs/ArrayOfNumberOnly.md diff --git a/samples/openapi3/client/petstore/python/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-prior/docs/ArrayTest.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ArrayTest.md rename to samples/openapi3/client/petstore/python-prior/docs/ArrayTest.md diff --git a/samples/openapi3/client/petstore/python/docs/Banana.md b/samples/openapi3/client/petstore/python-prior/docs/Banana.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Banana.md rename to samples/openapi3/client/petstore/python-prior/docs/Banana.md diff --git a/samples/openapi3/client/petstore/python/docs/BananaReq.md b/samples/openapi3/client/petstore/python-prior/docs/BananaReq.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/BananaReq.md rename to samples/openapi3/client/petstore/python-prior/docs/BananaReq.md diff --git a/samples/openapi3/client/petstore/python/docs/BasquePig.md b/samples/openapi3/client/petstore/python-prior/docs/BasquePig.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/BasquePig.md rename to samples/openapi3/client/petstore/python-prior/docs/BasquePig.md diff --git a/samples/openapi3/client/petstore/python/docs/BooleanEnum.md b/samples/openapi3/client/petstore/python-prior/docs/BooleanEnum.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/BooleanEnum.md rename to samples/openapi3/client/petstore/python-prior/docs/BooleanEnum.md diff --git a/samples/openapi3/client/petstore/python/docs/Capitalization.md b/samples/openapi3/client/petstore/python-prior/docs/Capitalization.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Capitalization.md rename to samples/openapi3/client/petstore/python-prior/docs/Capitalization.md diff --git a/samples/openapi3/client/petstore/python/docs/Cat.md b/samples/openapi3/client/petstore/python-prior/docs/Cat.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Cat.md rename to samples/openapi3/client/petstore/python-prior/docs/Cat.md diff --git a/samples/openapi3/client/petstore/python/docs/CatAllOf.md b/samples/openapi3/client/petstore/python-prior/docs/CatAllOf.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/CatAllOf.md rename to samples/openapi3/client/petstore/python-prior/docs/CatAllOf.md diff --git a/samples/openapi3/client/petstore/python/docs/Category.md b/samples/openapi3/client/petstore/python-prior/docs/Category.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Category.md rename to samples/openapi3/client/petstore/python-prior/docs/Category.md diff --git a/samples/openapi3/client/petstore/python/docs/ChildCat.md b/samples/openapi3/client/petstore/python-prior/docs/ChildCat.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ChildCat.md rename to samples/openapi3/client/petstore/python-prior/docs/ChildCat.md diff --git a/samples/openapi3/client/petstore/python/docs/ChildCatAllOf.md b/samples/openapi3/client/petstore/python-prior/docs/ChildCatAllOf.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ChildCatAllOf.md rename to samples/openapi3/client/petstore/python-prior/docs/ChildCatAllOf.md diff --git a/samples/openapi3/client/petstore/python/docs/ClassModel.md b/samples/openapi3/client/petstore/python-prior/docs/ClassModel.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ClassModel.md rename to samples/openapi3/client/petstore/python-prior/docs/ClassModel.md diff --git a/samples/openapi3/client/petstore/python/docs/Client.md b/samples/openapi3/client/petstore/python-prior/docs/Client.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Client.md rename to samples/openapi3/client/petstore/python-prior/docs/Client.md diff --git a/samples/openapi3/client/petstore/python/docs/ComplexQuadrilateral.md b/samples/openapi3/client/petstore/python-prior/docs/ComplexQuadrilateral.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ComplexQuadrilateral.md rename to samples/openapi3/client/petstore/python-prior/docs/ComplexQuadrilateral.md diff --git a/samples/openapi3/client/petstore/python/docs/ComposedOneOfNumberWithValidations.md b/samples/openapi3/client/petstore/python-prior/docs/ComposedOneOfNumberWithValidations.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ComposedOneOfNumberWithValidations.md rename to samples/openapi3/client/petstore/python-prior/docs/ComposedOneOfNumberWithValidations.md diff --git a/samples/openapi3/client/petstore/python/docs/ComposedSchemaWithPropsAndNoAddProps.md b/samples/openapi3/client/petstore/python-prior/docs/ComposedSchemaWithPropsAndNoAddProps.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ComposedSchemaWithPropsAndNoAddProps.md rename to samples/openapi3/client/petstore/python-prior/docs/ComposedSchemaWithPropsAndNoAddProps.md diff --git a/samples/openapi3/client/petstore/python/docs/DanishPig.md b/samples/openapi3/client/petstore/python-prior/docs/DanishPig.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/DanishPig.md rename to samples/openapi3/client/petstore/python-prior/docs/DanishPig.md diff --git a/samples/openapi3/client/petstore/python/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-prior/docs/DefaultApi.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/DefaultApi.md rename to samples/openapi3/client/petstore/python-prior/docs/DefaultApi.md diff --git a/samples/openapi3/client/petstore/python/docs/Dog.md b/samples/openapi3/client/petstore/python-prior/docs/Dog.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Dog.md rename to samples/openapi3/client/petstore/python-prior/docs/Dog.md diff --git a/samples/openapi3/client/petstore/python/docs/DogAllOf.md b/samples/openapi3/client/petstore/python-prior/docs/DogAllOf.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/DogAllOf.md rename to samples/openapi3/client/petstore/python-prior/docs/DogAllOf.md diff --git a/samples/openapi3/client/petstore/python/docs/Drawing.md b/samples/openapi3/client/petstore/python-prior/docs/Drawing.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Drawing.md rename to samples/openapi3/client/petstore/python-prior/docs/Drawing.md diff --git a/samples/openapi3/client/petstore/python/docs/EgressThresholdOptions.md b/samples/openapi3/client/petstore/python-prior/docs/EgressThresholdOptions.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/EgressThresholdOptions.md rename to samples/openapi3/client/petstore/python-prior/docs/EgressThresholdOptions.md diff --git a/samples/openapi3/client/petstore/python/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-prior/docs/EnumArrays.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/EnumArrays.md rename to samples/openapi3/client/petstore/python-prior/docs/EnumArrays.md diff --git a/samples/openapi3/client/petstore/python/docs/EnumClass.md b/samples/openapi3/client/petstore/python-prior/docs/EnumClass.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/EnumClass.md rename to samples/openapi3/client/petstore/python-prior/docs/EnumClass.md diff --git a/samples/openapi3/client/petstore/python/docs/EnumTest.md b/samples/openapi3/client/petstore/python-prior/docs/EnumTest.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/EnumTest.md rename to samples/openapi3/client/petstore/python-prior/docs/EnumTest.md diff --git a/samples/openapi3/client/petstore/python/docs/EquilateralTriangle.md b/samples/openapi3/client/petstore/python-prior/docs/EquilateralTriangle.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/EquilateralTriangle.md rename to samples/openapi3/client/petstore/python-prior/docs/EquilateralTriangle.md diff --git a/samples/openapi3/client/petstore/python/docs/FakeApi.md b/samples/openapi3/client/petstore/python-prior/docs/FakeApi.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/FakeApi.md rename to samples/openapi3/client/petstore/python-prior/docs/FakeApi.md diff --git a/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-prior/docs/FakeClassnameTags123Api.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md rename to samples/openapi3/client/petstore/python-prior/docs/FakeClassnameTags123Api.md diff --git a/samples/openapi3/client/petstore/python/docs/FakePostInlineAdditionalPropertiesPayloadArrayData.md b/samples/openapi3/client/petstore/python-prior/docs/FakePostInlineAdditionalPropertiesPayloadArrayData.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/FakePostInlineAdditionalPropertiesPayloadArrayData.md rename to samples/openapi3/client/petstore/python-prior/docs/FakePostInlineAdditionalPropertiesPayloadArrayData.md diff --git a/samples/openapi3/client/petstore/python/docs/File.md b/samples/openapi3/client/petstore/python-prior/docs/File.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/File.md rename to samples/openapi3/client/petstore/python-prior/docs/File.md diff --git a/samples/openapi3/client/petstore/python/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-prior/docs/FileSchemaTestClass.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/FileSchemaTestClass.md rename to samples/openapi3/client/petstore/python-prior/docs/FileSchemaTestClass.md diff --git a/samples/openapi3/client/petstore/python/docs/Foo.md b/samples/openapi3/client/petstore/python-prior/docs/Foo.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Foo.md rename to samples/openapi3/client/petstore/python-prior/docs/Foo.md diff --git a/samples/openapi3/client/petstore/python/docs/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/python-prior/docs/FooGetDefaultResponse.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/FooGetDefaultResponse.md rename to samples/openapi3/client/petstore/python-prior/docs/FooGetDefaultResponse.md diff --git a/samples/openapi3/client/petstore/python/docs/FooObject.md b/samples/openapi3/client/petstore/python-prior/docs/FooObject.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/FooObject.md rename to samples/openapi3/client/petstore/python-prior/docs/FooObject.md diff --git a/samples/openapi3/client/petstore/python/docs/FormatTest.md b/samples/openapi3/client/petstore/python-prior/docs/FormatTest.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/FormatTest.md rename to samples/openapi3/client/petstore/python-prior/docs/FormatTest.md diff --git a/samples/openapi3/client/petstore/python/docs/Fruit.md b/samples/openapi3/client/petstore/python-prior/docs/Fruit.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Fruit.md rename to samples/openapi3/client/petstore/python-prior/docs/Fruit.md diff --git a/samples/openapi3/client/petstore/python/docs/FruitReq.md b/samples/openapi3/client/petstore/python-prior/docs/FruitReq.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/FruitReq.md rename to samples/openapi3/client/petstore/python-prior/docs/FruitReq.md diff --git a/samples/openapi3/client/petstore/python/docs/GmFruit.md b/samples/openapi3/client/petstore/python-prior/docs/GmFruit.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/GmFruit.md rename to samples/openapi3/client/petstore/python-prior/docs/GmFruit.md diff --git a/samples/openapi3/client/petstore/python/docs/GmFruitNoProperties.md b/samples/openapi3/client/petstore/python-prior/docs/GmFruitNoProperties.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/GmFruitNoProperties.md rename to samples/openapi3/client/petstore/python-prior/docs/GmFruitNoProperties.md diff --git a/samples/openapi3/client/petstore/python/docs/GrandparentAnimal.md b/samples/openapi3/client/petstore/python-prior/docs/GrandparentAnimal.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/GrandparentAnimal.md rename to samples/openapi3/client/petstore/python-prior/docs/GrandparentAnimal.md diff --git a/samples/openapi3/client/petstore/python/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-prior/docs/HasOnlyReadOnly.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/HasOnlyReadOnly.md rename to samples/openapi3/client/petstore/python-prior/docs/HasOnlyReadOnly.md diff --git a/samples/openapi3/client/petstore/python/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-prior/docs/HealthCheckResult.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/HealthCheckResult.md rename to samples/openapi3/client/petstore/python-prior/docs/HealthCheckResult.md diff --git a/samples/openapi3/client/petstore/python/docs/InlineAdditionalPropertiesRefPayload.md b/samples/openapi3/client/petstore/python-prior/docs/InlineAdditionalPropertiesRefPayload.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/InlineAdditionalPropertiesRefPayload.md rename to samples/openapi3/client/petstore/python-prior/docs/InlineAdditionalPropertiesRefPayload.md diff --git a/samples/openapi3/client/petstore/python/docs/InlineObject.md b/samples/openapi3/client/petstore/python-prior/docs/InlineObject.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/InlineObject.md rename to samples/openapi3/client/petstore/python-prior/docs/InlineObject.md diff --git a/samples/openapi3/client/petstore/python/docs/InlineObject1.md b/samples/openapi3/client/petstore/python-prior/docs/InlineObject1.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/InlineObject1.md rename to samples/openapi3/client/petstore/python-prior/docs/InlineObject1.md diff --git a/samples/openapi3/client/petstore/python/docs/InlineObject2.md b/samples/openapi3/client/petstore/python-prior/docs/InlineObject2.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/InlineObject2.md rename to samples/openapi3/client/petstore/python-prior/docs/InlineObject2.md diff --git a/samples/openapi3/client/petstore/python/docs/InlineObject3.md b/samples/openapi3/client/petstore/python-prior/docs/InlineObject3.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/InlineObject3.md rename to samples/openapi3/client/petstore/python-prior/docs/InlineObject3.md diff --git a/samples/openapi3/client/petstore/python/docs/InlineObject4.md b/samples/openapi3/client/petstore/python-prior/docs/InlineObject4.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/InlineObject4.md rename to samples/openapi3/client/petstore/python-prior/docs/InlineObject4.md diff --git a/samples/openapi3/client/petstore/python/docs/InlineObject5.md b/samples/openapi3/client/petstore/python-prior/docs/InlineObject5.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/InlineObject5.md rename to samples/openapi3/client/petstore/python-prior/docs/InlineObject5.md diff --git a/samples/openapi3/client/petstore/python/docs/InlineObject6.md b/samples/openapi3/client/petstore/python-prior/docs/InlineObject6.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/InlineObject6.md rename to samples/openapi3/client/petstore/python-prior/docs/InlineObject6.md diff --git a/samples/openapi3/client/petstore/python/docs/InlineResponse200.md b/samples/openapi3/client/petstore/python-prior/docs/InlineResponse200.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/InlineResponse200.md rename to samples/openapi3/client/petstore/python-prior/docs/InlineResponse200.md diff --git a/samples/openapi3/client/petstore/python/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/python-prior/docs/InlineResponseDefault.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/InlineResponseDefault.md rename to samples/openapi3/client/petstore/python-prior/docs/InlineResponseDefault.md diff --git a/samples/openapi3/client/petstore/python/docs/IntegerEnum.md b/samples/openapi3/client/petstore/python-prior/docs/IntegerEnum.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/IntegerEnum.md rename to samples/openapi3/client/petstore/python-prior/docs/IntegerEnum.md diff --git a/samples/openapi3/client/petstore/python/docs/IntegerEnumOneValue.md b/samples/openapi3/client/petstore/python-prior/docs/IntegerEnumOneValue.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/IntegerEnumOneValue.md rename to samples/openapi3/client/petstore/python-prior/docs/IntegerEnumOneValue.md diff --git a/samples/openapi3/client/petstore/python/docs/IntegerEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python-prior/docs/IntegerEnumWithDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/IntegerEnumWithDefaultValue.md rename to samples/openapi3/client/petstore/python-prior/docs/IntegerEnumWithDefaultValue.md diff --git a/samples/openapi3/client/petstore/python/docs/IsoscelesTriangle.md b/samples/openapi3/client/petstore/python-prior/docs/IsoscelesTriangle.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/IsoscelesTriangle.md rename to samples/openapi3/client/petstore/python-prior/docs/IsoscelesTriangle.md diff --git a/samples/openapi3/client/petstore/python/docs/Legs.md b/samples/openapi3/client/petstore/python-prior/docs/Legs.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Legs.md rename to samples/openapi3/client/petstore/python-prior/docs/Legs.md diff --git a/samples/openapi3/client/petstore/python/docs/List.md b/samples/openapi3/client/petstore/python-prior/docs/List.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/List.md rename to samples/openapi3/client/petstore/python-prior/docs/List.md diff --git a/samples/openapi3/client/petstore/python/docs/Mammal.md b/samples/openapi3/client/petstore/python-prior/docs/Mammal.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Mammal.md rename to samples/openapi3/client/petstore/python-prior/docs/Mammal.md diff --git a/samples/openapi3/client/petstore/python/docs/MapTest.md b/samples/openapi3/client/petstore/python-prior/docs/MapTest.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/MapTest.md rename to samples/openapi3/client/petstore/python-prior/docs/MapTest.md diff --git a/samples/openapi3/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-prior/docs/MixedPropertiesAndAdditionalPropertiesClass.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md rename to samples/openapi3/client/petstore/python-prior/docs/MixedPropertiesAndAdditionalPropertiesClass.md diff --git a/samples/openapi3/client/petstore/python/docs/Model200Response.md b/samples/openapi3/client/petstore/python-prior/docs/Model200Response.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Model200Response.md rename to samples/openapi3/client/petstore/python-prior/docs/Model200Response.md diff --git a/samples/openapi3/client/petstore/python/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-prior/docs/ModelReturn.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ModelReturn.md rename to samples/openapi3/client/petstore/python-prior/docs/ModelReturn.md diff --git a/samples/openapi3/client/petstore/python/docs/Model_200Response.md b/samples/openapi3/client/petstore/python-prior/docs/Model_200Response.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Model_200Response.md rename to samples/openapi3/client/petstore/python-prior/docs/Model_200Response.md diff --git a/samples/openapi3/client/petstore/python/docs/Model_Return.md b/samples/openapi3/client/petstore/python-prior/docs/Model_Return.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Model_Return.md rename to samples/openapi3/client/petstore/python-prior/docs/Model_Return.md diff --git a/samples/openapi3/client/petstore/python/docs/Mole.md b/samples/openapi3/client/petstore/python-prior/docs/Mole.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Mole.md rename to samples/openapi3/client/petstore/python-prior/docs/Mole.md diff --git a/samples/openapi3/client/petstore/python/docs/Name.md b/samples/openapi3/client/petstore/python-prior/docs/Name.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Name.md rename to samples/openapi3/client/petstore/python-prior/docs/Name.md diff --git a/samples/openapi3/client/petstore/python/docs/NullableClass.md b/samples/openapi3/client/petstore/python-prior/docs/NullableClass.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/NullableClass.md rename to samples/openapi3/client/petstore/python-prior/docs/NullableClass.md diff --git a/samples/openapi3/client/petstore/python/docs/NullableShape.md b/samples/openapi3/client/petstore/python-prior/docs/NullableShape.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/NullableShape.md rename to samples/openapi3/client/petstore/python-prior/docs/NullableShape.md diff --git a/samples/openapi3/client/petstore/python/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-prior/docs/NumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/NumberOnly.md rename to samples/openapi3/client/petstore/python-prior/docs/NumberOnly.md diff --git a/samples/openapi3/client/petstore/python/docs/NumberWithValidations.md b/samples/openapi3/client/petstore/python-prior/docs/NumberWithValidations.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/NumberWithValidations.md rename to samples/openapi3/client/petstore/python-prior/docs/NumberWithValidations.md diff --git a/samples/openapi3/client/petstore/python/docs/ObjectInterface.md b/samples/openapi3/client/petstore/python-prior/docs/ObjectInterface.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ObjectInterface.md rename to samples/openapi3/client/petstore/python-prior/docs/ObjectInterface.md diff --git a/samples/openapi3/client/petstore/python/docs/ObjectModelWithRefProps.md b/samples/openapi3/client/petstore/python-prior/docs/ObjectModelWithRefProps.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ObjectModelWithRefProps.md rename to samples/openapi3/client/petstore/python-prior/docs/ObjectModelWithRefProps.md diff --git a/samples/openapi3/client/petstore/python/docs/ObjectWithValidations.md b/samples/openapi3/client/petstore/python-prior/docs/ObjectWithValidations.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ObjectWithValidations.md rename to samples/openapi3/client/petstore/python-prior/docs/ObjectWithValidations.md diff --git a/samples/openapi3/client/petstore/python/docs/Order.md b/samples/openapi3/client/petstore/python-prior/docs/Order.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Order.md rename to samples/openapi3/client/petstore/python-prior/docs/Order.md diff --git a/samples/openapi3/client/petstore/python/docs/ParentPet.md b/samples/openapi3/client/petstore/python-prior/docs/ParentPet.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ParentPet.md rename to samples/openapi3/client/petstore/python-prior/docs/ParentPet.md diff --git a/samples/openapi3/client/petstore/python/docs/Pet.md b/samples/openapi3/client/petstore/python-prior/docs/Pet.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Pet.md rename to samples/openapi3/client/petstore/python-prior/docs/Pet.md diff --git a/samples/openapi3/client/petstore/python/docs/PetApi.md b/samples/openapi3/client/petstore/python-prior/docs/PetApi.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/PetApi.md rename to samples/openapi3/client/petstore/python-prior/docs/PetApi.md diff --git a/samples/openapi3/client/petstore/python/docs/Pig.md b/samples/openapi3/client/petstore/python-prior/docs/Pig.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Pig.md rename to samples/openapi3/client/petstore/python-prior/docs/Pig.md diff --git a/samples/openapi3/client/petstore/python/docs/PostInlineAdditionalPropertiesPayloadRequest.md b/samples/openapi3/client/petstore/python-prior/docs/PostInlineAdditionalPropertiesPayloadRequest.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/PostInlineAdditionalPropertiesPayloadRequest.md rename to samples/openapi3/client/petstore/python-prior/docs/PostInlineAdditionalPropertiesPayloadRequest.md diff --git a/samples/openapi3/client/petstore/python/docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md b/samples/openapi3/client/petstore/python-prior/docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md rename to samples/openapi3/client/petstore/python-prior/docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md diff --git a/samples/openapi3/client/petstore/python/docs/PublishOptions.md b/samples/openapi3/client/petstore/python-prior/docs/PublishOptions.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/PublishOptions.md rename to samples/openapi3/client/petstore/python-prior/docs/PublishOptions.md diff --git a/samples/openapi3/client/petstore/python/docs/PublishOptionsPublish.md b/samples/openapi3/client/petstore/python-prior/docs/PublishOptionsPublish.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/PublishOptionsPublish.md rename to samples/openapi3/client/petstore/python-prior/docs/PublishOptionsPublish.md diff --git a/samples/openapi3/client/petstore/python/docs/Quadrilateral.md b/samples/openapi3/client/petstore/python-prior/docs/Quadrilateral.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Quadrilateral.md rename to samples/openapi3/client/petstore/python-prior/docs/Quadrilateral.md diff --git a/samples/openapi3/client/petstore/python/docs/QuadrilateralInterface.md b/samples/openapi3/client/petstore/python-prior/docs/QuadrilateralInterface.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/QuadrilateralInterface.md rename to samples/openapi3/client/petstore/python-prior/docs/QuadrilateralInterface.md diff --git a/samples/openapi3/client/petstore/python/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-prior/docs/ReadOnlyFirst.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ReadOnlyFirst.md rename to samples/openapi3/client/petstore/python-prior/docs/ReadOnlyFirst.md diff --git a/samples/openapi3/client/petstore/python/docs/Readonly.md b/samples/openapi3/client/petstore/python-prior/docs/Readonly.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Readonly.md rename to samples/openapi3/client/petstore/python-prior/docs/Readonly.md diff --git a/samples/openapi3/client/petstore/python/docs/ScaleneTriangle.md b/samples/openapi3/client/petstore/python-prior/docs/ScaleneTriangle.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ScaleneTriangle.md rename to samples/openapi3/client/petstore/python-prior/docs/ScaleneTriangle.md diff --git a/samples/openapi3/client/petstore/python/docs/Shape.md b/samples/openapi3/client/petstore/python-prior/docs/Shape.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Shape.md rename to samples/openapi3/client/petstore/python-prior/docs/Shape.md diff --git a/samples/openapi3/client/petstore/python/docs/ShapeInterface.md b/samples/openapi3/client/petstore/python-prior/docs/ShapeInterface.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ShapeInterface.md rename to samples/openapi3/client/petstore/python-prior/docs/ShapeInterface.md diff --git a/samples/openapi3/client/petstore/python/docs/ShapeOrNull.md b/samples/openapi3/client/petstore/python-prior/docs/ShapeOrNull.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/ShapeOrNull.md rename to samples/openapi3/client/petstore/python-prior/docs/ShapeOrNull.md diff --git a/samples/openapi3/client/petstore/python/docs/SimpleQuadrilateral.md b/samples/openapi3/client/petstore/python-prior/docs/SimpleQuadrilateral.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/SimpleQuadrilateral.md rename to samples/openapi3/client/petstore/python-prior/docs/SimpleQuadrilateral.md diff --git a/samples/openapi3/client/petstore/python/docs/SomeObject.md b/samples/openapi3/client/petstore/python-prior/docs/SomeObject.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/SomeObject.md rename to samples/openapi3/client/petstore/python-prior/docs/SomeObject.md diff --git a/samples/openapi3/client/petstore/python/docs/SomeObjectWithSelfAttr.md b/samples/openapi3/client/petstore/python-prior/docs/SomeObjectWithSelfAttr.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/SomeObjectWithSelfAttr.md rename to samples/openapi3/client/petstore/python-prior/docs/SomeObjectWithSelfAttr.md diff --git a/samples/openapi3/client/petstore/python/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-prior/docs/SpecialModelName.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/SpecialModelName.md rename to samples/openapi3/client/petstore/python-prior/docs/SpecialModelName.md diff --git a/samples/openapi3/client/petstore/python/docs/StoreApi.md b/samples/openapi3/client/petstore/python-prior/docs/StoreApi.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/StoreApi.md rename to samples/openapi3/client/petstore/python-prior/docs/StoreApi.md diff --git a/samples/openapi3/client/petstore/python/docs/StreamOptions.md b/samples/openapi3/client/petstore/python-prior/docs/StreamOptions.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/StreamOptions.md rename to samples/openapi3/client/petstore/python-prior/docs/StreamOptions.md diff --git a/samples/openapi3/client/petstore/python/docs/StringBooleanMap.md b/samples/openapi3/client/petstore/python-prior/docs/StringBooleanMap.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/StringBooleanMap.md rename to samples/openapi3/client/petstore/python-prior/docs/StringBooleanMap.md diff --git a/samples/openapi3/client/petstore/python/docs/StringEnum.md b/samples/openapi3/client/petstore/python-prior/docs/StringEnum.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/StringEnum.md rename to samples/openapi3/client/petstore/python-prior/docs/StringEnum.md diff --git a/samples/openapi3/client/petstore/python/docs/StringEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python-prior/docs/StringEnumWithDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/StringEnumWithDefaultValue.md rename to samples/openapi3/client/petstore/python-prior/docs/StringEnumWithDefaultValue.md diff --git a/samples/openapi3/client/petstore/python/docs/Tag.md b/samples/openapi3/client/petstore/python-prior/docs/Tag.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Tag.md rename to samples/openapi3/client/petstore/python-prior/docs/Tag.md diff --git a/samples/openapi3/client/petstore/python/docs/Triangle.md b/samples/openapi3/client/petstore/python-prior/docs/Triangle.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Triangle.md rename to samples/openapi3/client/petstore/python-prior/docs/Triangle.md diff --git a/samples/openapi3/client/petstore/python/docs/TriangleInterface.md b/samples/openapi3/client/petstore/python-prior/docs/TriangleInterface.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/TriangleInterface.md rename to samples/openapi3/client/petstore/python-prior/docs/TriangleInterface.md diff --git a/samples/openapi3/client/petstore/python/docs/User.md b/samples/openapi3/client/petstore/python-prior/docs/User.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/User.md rename to samples/openapi3/client/petstore/python-prior/docs/User.md diff --git a/samples/openapi3/client/petstore/python/docs/UserApi.md b/samples/openapi3/client/petstore/python-prior/docs/UserApi.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/UserApi.md rename to samples/openapi3/client/petstore/python-prior/docs/UserApi.md diff --git a/samples/openapi3/client/petstore/python/docs/Whale.md b/samples/openapi3/client/petstore/python-prior/docs/Whale.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Whale.md rename to samples/openapi3/client/petstore/python-prior/docs/Whale.md diff --git a/samples/openapi3/client/petstore/python/docs/Zebra.md b/samples/openapi3/client/petstore/python-prior/docs/Zebra.md similarity index 100% rename from samples/openapi3/client/petstore/python/docs/Zebra.md rename to samples/openapi3/client/petstore/python-prior/docs/Zebra.md diff --git a/samples/openapi3/client/petstore/python-experimental/git_push.sh b/samples/openapi3/client/petstore/python-prior/git_push.sh similarity index 87% rename from samples/openapi3/client/petstore/python-experimental/git_push.sh rename to samples/openapi3/client/petstore/python-prior/git_push.sh index ced3be2b0c7b..f53a75d4fabe 100644 --- a/samples/openapi3/client/petstore/python-experimental/git_push.sh +++ b/samples/openapi3/client/petstore/python-prior/git_push.sh @@ -1,7 +1,7 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 @@ -38,14 +38,14 @@ git add . git commit -m "$release_note" # Sets the new remote -git_remote=`git 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 + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -55,4 +55,3 @@ 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-experimental/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-prior/petstore_api/__init__.py similarity index 98% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/__init__.py index 26b0467759de..e79f5c78b220 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/__init__.py @@ -1,5 +1,3 @@ -# coding: utf-8 - # flake8: noqa """ @@ -11,6 +9,7 @@ Generated by: https://openapi-generator.tech """ + __version__ = "1.0.0" # import ApiClient diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/api/__init__.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/api/__init__.py diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api/another_fake_api.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/api/another_fake_api.py diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api/default_api.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/api/default_api.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/api/default_api.py diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api/fake_api.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/api/fake_api.py diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api/fake_classname_tags123_api.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/api/fake_classname_tags123_api.py diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api/fake_classname_tags_123_api.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/api/fake_classname_tags_123_api.py diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api/pet_api.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/api/pet_api.py diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api/store_api.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/api/store_api.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/api/store_api.py diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api/user_api.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/api/user_api.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/api/user_api.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-prior/petstore_api/api_client.py new file mode 100644 index 000000000000..c14f1d0f1bca --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/api_client.py @@ -0,0 +1,903 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 json +import atexit +import mimetypes +from multiprocessing.pool import ThreadPool +import io +import os +import re +import typing +from urllib.parse import quote +from urllib3.fields import RequestField + + +from petstore_api import rest +from petstore_api.configuration import Configuration +from petstore_api.exceptions import ApiTypeError, ApiValueError, ApiException +from petstore_api.model_utils import ( + ModelNormal, + ModelSimple, + ModelComposed, + check_allowed_values, + check_validations, + date, + datetime, + deserialize_file, + file_type, + model_to_dict, + none_type, + validate_and_convert_types +) + + +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. + """ + + _pool = None + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None, pool_threads=1): + if configuration is None: + configuration = Configuration.get_default_copy() + 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' + + 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 + + def __call_api( + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + body: typing.Optional[typing.Any] = None, + post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, + response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + _return_http_data_only: typing.Optional[bool] = None, + collection_formats: typing.Optional[typing.Dict[str, str]] = None, + _preload_content: bool = True, + _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, + _host: typing.Optional[str] = None, + _check_type: typing.Optional[bool] = None, + _content_type: typing.Optional[str] = None, + _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = 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) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # 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)) + if header_params['Content-Type'].startswith("multipart"): + post_params = self.parameters_to_multipart(post_params, + (dict)) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # auth setting + self.update_params_for_auth(header_params, query_params, + auth_settings, resource_path, method, body, + request_auths=_request_auths) + + # 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 + + 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: + 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) + return return_data + + # deserialize response data + if response_type: + if response_type != (file_type,): + encoding = "utf-8" + 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) + if match: + encoding = match.group(1) + response_data.data = response_data.data.decode(encoding) + + return_data = self.deserialize( + response_data, + response_type, + _check_type + ) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def parameters_to_multipart(self, params, collection_types): + """Get parameters as list of tuples, formatting as json if value is collection_types + + :param params: Parameters as list of two-tuples + :param dict collection_types: Parameter collection types + :return: Parameters as list of tuple or urllib3.fields.RequestField + """ + new_params = [] + if collection_types is None: + collection_types = (dict) + for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + if isinstance( + v, collection_types): # v is instance of collection_type, formatting as application/json + v = json.dumps(v, ensure_ascii=False).encode("utf-8") + field = RequestField(k, v) + field.make_multipart(content_type="application/json; charset=utf-8") + new_params.append(field) + else: + new_params.append((k, v)) + return new_params + + @classmethod + def sanitize_for_serialization(cls, obj): + """Prepares data for transmission before it is sent with the rest client + 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. + If obj is io.IOBase, return the bytes + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if isinstance(obj, (ModelNormal, ModelComposed)): + return { + key: cls.sanitize_for_serialization(val) for key, + val in model_to_dict( + obj, + serialize=True).items()} + elif isinstance(obj, io.IOBase): + return cls.get_file_data_and_close_file(obj) + elif isinstance(obj, (str, int, float, none_type, bool)): + return obj + elif isinstance(obj, (datetime, date)): + return obj.isoformat() + elif isinstance(obj, ModelSimple): + return cls.sanitize_for_serialization(obj.value) + elif isinstance(obj, (list, tuple)): + return [cls.sanitize_for_serialization(item) for item in obj] + if isinstance(obj, dict): + return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} + raise ApiValueError( + 'Unable to prepare type {} for serialization'.format( + obj.__class__.__name__)) + + def deserialize(self, response, response_type, _check_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: For the response, a tuple containing: + valid classes + a list containing valid classes (for list schemas) + a dict containing a tuple of valid classes as the value + Example values: + (str,) + (Pet,) + (float, none_type) + ([int, none_type],) + ({str: (bool, str, int, float, date, datetime, str, none_type)},) + :param _check_type: boolean, whether to check the types of the data + received from the server + :type _check_type: bool + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == (file_type,): + content_disposition = response.getheader("Content-Disposition") + return deserialize_file(response.data, self.configuration, + content_disposition=content_disposition) + + # fetch data from response object + try: + received_data = json.loads(response.data) + except ValueError: + received_data = response.data + + # store our data under the key of 'received_data' so users have some + # context if they are deserializing a string and the data type is wrong + deserialized_data = validate_and_convert_types( + received_data, + response_type, + ['received_data'], + True, + _check_type, + configuration=self.configuration + ) + return deserialized_data + + def call_api( + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + body: typing.Optional[typing.Any] = None, + post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, + response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + async_req: typing.Optional[bool] = None, + _return_http_data_only: typing.Optional[bool] = None, + collection_formats: typing.Optional[typing.Dict[str, str]] = None, + _preload_content: bool = True, + _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, + _host: typing.Optional[str] = None, + _check_type: typing.Optional[bool] = None, + _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = 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_type: For the response, a tuple containing: + valid classes + a list containing valid classes (for list schemas) + a dict containing a tuple of valid classes as the value + Example values: + (str,) + (Pet,) + (float, none_type) + ([int, none_type],) + ({str: (bool, str, int, float, date, datetime, str, none_type)},) + :param files: key -> field name, value -> a list of open file + objects for `multipart/form-data`. + :type files: dict + :param async_req bool: execute 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 collection_formats: dict of collection formats for path, query, + header, and post parameters. + :type collection_formats: dict, 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 _check_type: boolean describing if the data back from the server + should have its type checked. + :type _check_type: bool, optional + :param _request_auths: 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_auths: list, 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_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout, _host, + _check_type, _request_auths=_request_auths) + + return self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, + query_params, + header_params, body, + post_params, files, + response_type, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, _check_type, None, _request_auths)) + + 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(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(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(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(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(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 + + @staticmethod + def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: + file_data = file_instance.read() + file_instance.close() + return file_data + + def files_parameters(self, + files: typing.Optional[typing.Dict[str, + typing.List[io.IOBase]]] = None): + """Builds form parameters. + + :param files: None or a dict with key=param_name and + value is a list of open file objects + :return: List of tuples of form parameters with file data + """ + if files is None: + return [] + + params = [] + for param_name, file_instances in files.items(): + if file_instances is None: + # if the file field is nullable, skip None values + continue + for file_instance in file_instances: + if file_instance is None: + # if the file field is nullable, skip None values + continue + if file_instance.closed is True: + raise ApiValueError( + "Cannot read a closed file. The passed in file_type " + "for %s must be open." % param_name + ) + filename = os.path.basename(file_instance.name) + filedata = self.get_file_data_and_close_file(file_instance) + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([param_name, 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 + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types, method=None, body=None): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + content_types = [x.lower() for x in content_types] + + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, queries, auth_settings, + resource_path, method, body, request_auths=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. + :param resource_path: A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method. + :param body: A object representing the body of the HTTP request. + The object type is the return value of _encoder.default(). + :param request_auths: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auths: + for auth_setting in request_auths: + self._apply_auth_params( + headers, queries, resource_path, method, body, auth_setting) + 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): + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['key'] + "=" + 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`' + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type', + '_content_type', + '_spec_property_naming', + '_request_auths' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (none_type, int), + '_preload_content': (bool,), + '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,), + '_spec_property_naming': (bool,), + '_content_type': (none_type, str), + '_request_auths': (none_type, list) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param], + configuration=self.api_client.configuration + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in kwargs.items(): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + kwargs['_spec_property_naming'], + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in kwargs.items(): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][base_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][base_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + + api_instance = AnotherFakeApi() + api_instance.call_123_test_special_tags # this is an instance of the class Endpoint + api_instance.call_123_test_special_tags() # this invokes api_instance.call_123_test_special_tags.__call__() + which then invokes the callable functions stored in that endpoint at + api_instance.call_123_test_special_tags.callable or self.callable in this class + + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + index = self.api_client.configuration.server_operation_index.get( + self.settings['operation_id'], self.api_client.configuration.server_index + ) if kwargs['_host_index'] is None else kwargs['_host_index'] + server_variables = self.api_client.configuration.server_operation_variables.get( + self.settings['operation_id'], self.api_client.configuration.server_variables + ) + _host = self.api_client.configuration.get_host_from_settings( + index, variables=server_variables, servers=self.settings['servers'] + ) + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in kwargs.items(): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + if kwargs.get('_content_type'): + params['header']['Content-Type'] = kwargs['_content_type'] + else: + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + if params['body'] != "": + content_types_list = self.api_client.select_header_content_type( + content_type_headers_list, self.settings['http_method'], + params['body']) + if content_types_list: + params['header']['Content-Type'] = content_types_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + _request_auths=kwargs['_request_auths'], + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/apis/__init__.py b/samples/openapi3/client/petstore/python-prior/petstore_api/apis/__init__.py new file mode 100644 index 000000000000..381ad9572b17 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/apis/__init__.py @@ -0,0 +1,23 @@ + +# flake8: noqa + +# Import all APIs into this package. +# If you have many APIs here with many many models used in each API this may +# raise a `RecursionError`. +# In order to avoid this, import only the API that you directly need like: +# +# from petstore_api.api.another_fake_api import AnotherFakeApi +# +# or import this package, but before doing it, use: +# +# import sys +# sys.setrecursionlimit(n) + +# 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-experimental/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-prior/petstore_api/configuration.py similarity index 97% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/configuration.py index f7c2a3ff91eb..0c4db4c52afd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/configuration.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ OpenAPI Petstore @@ -9,6 +7,7 @@ Generated by: https://openapi-generator.tech """ + import copy import logging import multiprocessing @@ -22,8 +21,7 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems', - 'uniqueItems', 'maxProperties', 'minProperties', + 'minLength', 'pattern', 'maxItems', 'minItems' } class Configuration(object): @@ -77,6 +75,8 @@ class Configuration(object): :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: @@ -131,7 +131,7 @@ class Configuration(object): '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 beccause explicit proxies, transparent proxies, TLS termination endpoints or + 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. @@ -159,12 +159,14 @@ class Configuration(object): def __init__(self, host=None, api_key=None, api_key_prefix=None, + access_token=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 """ @@ -183,6 +185,7 @@ def __init__(self, host=None, """Temp file folder for downloading files """ # Authentication Settings + self.access_token = access_token self.api_key = {} if api_key: self.api_key = api_key @@ -209,9 +212,6 @@ def __init__(self, host=None, self.signing_info = signing_info """The HTTP signing configuration """ - self.access_token = None - """access token for OAuth/Bearer - """ self.logger = {} """Logging Settings """ @@ -238,7 +238,7 @@ def __init__(self, host=None, Set this to false to skip verifying SSL certificate when calling API from https server. """ - self.ssl_ca_cert = None + self.ssl_ca_cert = ssl_ca_cert """Set this to customize the certificate file to verify the peer. """ self.cert_file = None @@ -262,6 +262,9 @@ def __init__(self, host=None, self.proxy = None """Proxy URL """ + self.no_proxy = None + """bypass proxy for host in the no_proxy list. + """ self.proxy_headers = None """Proxy headers """ @@ -301,7 +304,7 @@ def __setattr__(self, name, value): "Invalid keyword: '{0}''".format(v)) self._disabled_client_side_validations = s if name == "signing_info" and value is not None: - # Ensure the host paramater from signing info is the same as + # Ensure the host parameter from signing info is the same as # Configuration.host. value.host = self.host @@ -532,7 +535,7 @@ def get_host_settings(self): "qa-petstore", "dev-petstore" ] - }, + }, 'port': { 'description': "No description provided", 'default_value': "80", @@ -540,8 +543,8 @@ def get_host_settings(self): "80", "8080" ] - } } + } }, { 'url': "https://localhost:8080/{version}", @@ -554,8 +557,8 @@ def get_host_settings(self): "v1", "v2" ] - } } + } } ] diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-prior/petstore_api/exceptions.py similarity index 79% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/exceptions.py index ed422fd2d0e2..d223cb4876ce 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/exceptions.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ OpenAPI Petstore @@ -99,12 +97,12 @@ def __init__(self, msg, path_to_item=None): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, api_response: 'petstore_api.api_client.ApiResponse' = None): - if api_response: - self.status = api_response.response.status - self.reason = api_response.response.reason - self.body = api_response.response.data - self.headers = api_response.response.getheaders() + 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 @@ -113,7 +111,7 @@ def __init__(self, status=None, reason=None, api_response: 'petstore_api.api_cli def __str__(self): """Custom error messages for exception""" - error_message = "({0})\n"\ + error_message = "Status Code: {0}\n"\ "Reason: {1}\n".format(self.status, self.reason) if self.headers: error_message += "HTTP response headers: {0}\n".format( @@ -125,6 +123,30 @@ def __str__(self): 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 = "" diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/__init__.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/__init__.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/__init__.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/additional_properties_class.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/additional_properties_class.py new file mode 100644 index 000000000000..307a8c772ff0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/additional_properties_class.py @@ -0,0 +1,291 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class AdditionalPropertiesClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'map_property': ({str: (str,)},), # noqa: E501 + 'map_of_map_property': ({str: ({str: (str,)},)},), # noqa: E501 + 'anytype_1': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 + 'map_with_undeclared_properties_anytype_1': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + 'map_with_undeclared_properties_anytype_2': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + 'map_with_undeclared_properties_anytype_3': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + 'empty_map': (dict,), # noqa: E501 + 'map_with_undeclared_properties_string': ({str: (str,)},), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'map_property': 'map_property', # noqa: E501 + 'map_of_map_property': 'map_of_map_property', # noqa: E501 + 'anytype_1': 'anytype_1', # noqa: E501 + 'map_with_undeclared_properties_anytype_1': 'map_with_undeclared_properties_anytype_1', # noqa: E501 + 'map_with_undeclared_properties_anytype_2': 'map_with_undeclared_properties_anytype_2', # noqa: E501 + 'map_with_undeclared_properties_anytype_3': 'map_with_undeclared_properties_anytype_3', # noqa: E501 + 'empty_map': 'empty_map', # noqa: E501 + 'map_with_undeclared_properties_string': 'map_with_undeclared_properties_string', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AdditionalPropertiesClass - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + map_property ({str: (str,)}): [optional] # noqa: E501 + map_of_map_property ({str: ({str: (str,)},)}): [optional] # noqa: E501 + anytype_1 (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 + map_with_undeclared_properties_anytype_1 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + map_with_undeclared_properties_anytype_2 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + map_with_undeclared_properties_anytype_3 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + empty_map (dict): an object with no declared properties and no undeclared properties, hence it's an empty map.. [optional] # noqa: E501 + map_with_undeclared_properties_string ({str: (str,)}): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """AdditionalPropertiesClass - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + map_property ({str: (str,)}): [optional] # noqa: E501 + map_of_map_property ({str: ({str: (str,)},)}): [optional] # noqa: E501 + anytype_1 (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 + map_with_undeclared_properties_anytype_1 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + map_with_undeclared_properties_anytype_2 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + map_with_undeclared_properties_anytype_3 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + empty_map (dict): an object with no declared properties and no undeclared properties, hence it's an empty map.. [optional] # noqa: E501 + map_with_undeclared_properties_string ({str: (str,)}): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/additional_properties_with_array_of_enums.py new file mode 100644 index 000000000000..9b33b4689d5f --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/additional_properties_with_array_of_enums.py @@ -0,0 +1,265 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.enum_class import EnumClass + globals()['EnumClass'] = EnumClass + + +class AdditionalPropertiesWithArrayOfEnums(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ([EnumClass],) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AdditionalPropertiesWithArrayOfEnums - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """AdditionalPropertiesWithArrayOfEnums - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/address.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/address.py new file mode 100644 index 000000000000..6ab145672442 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/address.py @@ -0,0 +1,259 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class Address(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (int,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Address - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Address - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/animal.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/animal.py new file mode 100644 index 000000000000..b93180ea0559 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/animal.py @@ -0,0 +1,292 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.cat import Cat + from petstore_api.model.dog import Dog + globals()['Cat'] = Cat + globals()['Dog'] = Dog + + +class Animal(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'class_name': (str,), # noqa: E501 + 'color': (str,), # noqa: E501 + 'tail': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + lazy_import() + val = { + 'Cat': Cat, + 'Dog': Dog, + } + if not val: + return None + return {'class_name': val} + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'color': 'color', # noqa: E501 + 'tail': 'tail', # noqa: E501 + } + + read_only_vars = { + 'tail', # noqa: E501 + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501 + """Animal - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 + tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.class_name = class_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, class_name, *args, **kwargs): # noqa: E501 + """Animal - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 + tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.class_name = class_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/animal_farm.py new file mode 100644 index 000000000000..89062cff69cb --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/animal_farm.py @@ -0,0 +1,291 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.animal import Animal + globals()['Animal'] = Animal + + +class AnimalFarm(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'value': ([Animal],), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """AnimalFarm - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([Animal]): # noqa: E501 + + Keyword Args: + value ([Animal]): # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """AnimalFarm - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([Animal]): # noqa: E501 + + Keyword Args: + value ([Animal]): # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/api_response.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/api_response.py new file mode 100644 index 000000000000..5e21cdaf5988 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/api_response.py @@ -0,0 +1,271 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class ApiResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'code': (int,), # noqa: E501 + 'type': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'code': 'code', # noqa: E501 + 'type': 'type', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ApiResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + code (int): [optional] # noqa: E501 + type (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ApiResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + code (int): [optional] # noqa: E501 + type (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/apple.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/apple.py new file mode 100644 index 000000000000..9909e1994ab7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/apple.py @@ -0,0 +1,284 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class Apple(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('cultivar',): { + 'regex': { + 'pattern': r'^[a-zA-Z\s]*$', # noqa: E501 + }, + }, + ('origin',): { + 'regex': { + 'pattern': r'^[A-Z\s]*$', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'cultivar': (str,), # noqa: E501 + 'origin': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'cultivar': 'cultivar', # noqa: E501 + 'origin': 'origin', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, cultivar, *args, **kwargs): # noqa: E501 + """Apple - a model defined in OpenAPI + + Args: + cultivar (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + origin (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.cultivar = cultivar + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, cultivar, *args, **kwargs): # noqa: E501 + """Apple - a model defined in OpenAPI + + Args: + cultivar (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + origin (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.cultivar = cultivar + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/apple_req.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/apple_req.py new file mode 100644 index 000000000000..ce9ae6721e57 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/apple_req.py @@ -0,0 +1,267 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class AppleReq(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'cultivar': (str,), # noqa: E501 + 'mealy': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'cultivar': 'cultivar', # noqa: E501 + 'mealy': 'mealy', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, cultivar, *args, **kwargs): # noqa: E501 + """AppleReq - a model defined in OpenAPI + + Args: + cultivar (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + mealy (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.cultivar = cultivar + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, cultivar, *args, **kwargs): # noqa: E501 + """AppleReq - a model defined in OpenAPI + + Args: + cultivar (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + mealy (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.cultivar = cultivar + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_array_of_number_only.py new file mode 100644 index 000000000000..41e90e2ae966 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_array_of_number_only.py @@ -0,0 +1,263 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class ArrayOfArrayOfNumberOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'array_array_number': ([[float]],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'array_array_number': 'ArrayArrayNumber', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + array_array_number ([[float]]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + array_array_number ([[float]]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_enums.py new file mode 100644 index 000000000000..8ca15fd6c8fb --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_enums.py @@ -0,0 +1,291 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.string_enum import StringEnum + globals()['StringEnum'] = StringEnum + + +class ArrayOfEnums(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'value': ([StringEnum],), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """ArrayOfEnums - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([StringEnum]): # noqa: E501 + + Keyword Args: + value ([StringEnum]): # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ArrayOfEnums - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([StringEnum]): # noqa: E501 + + Keyword Args: + value ([StringEnum]): # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_number_only.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_number_only.py new file mode 100644 index 000000000000..068dc80b1a90 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_of_number_only.py @@ -0,0 +1,263 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class ArrayOfNumberOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'array_number': ([float],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'array_number': 'ArrayNumber', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ArrayOfNumberOnly - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + array_number ([float]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ArrayOfNumberOnly - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + array_number ([float]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_test.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_test.py new file mode 100644 index 000000000000..119a5ad1fdd0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/array_test.py @@ -0,0 +1,277 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.read_only_first import ReadOnlyFirst + globals()['ReadOnlyFirst'] = ReadOnlyFirst + + +class ArrayTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'array_of_string': ([str],), # noqa: E501 + 'array_array_of_integer': ([[int]],), # noqa: E501 + 'array_array_of_model': ([[ReadOnlyFirst]],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'array_of_string': 'array_of_string', # noqa: E501 + 'array_array_of_integer': 'array_array_of_integer', # noqa: E501 + 'array_array_of_model': 'array_array_of_model', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ArrayTest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + array_of_string ([str]): [optional] # noqa: E501 + array_array_of_integer ([[int]]): [optional] # noqa: E501 + array_array_of_model ([[ReadOnlyFirst]]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ArrayTest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + array_of_string ([str]): [optional] # noqa: E501 + array_array_of_integer ([[int]]): [optional] # noqa: E501 + array_array_of_model ([[ReadOnlyFirst]]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/banana.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/banana.py new file mode 100644 index 000000000000..f6f6792990d8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/banana.py @@ -0,0 +1,269 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class Banana(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'length_cm': (float,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'length_cm': 'lengthCm', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, length_cm, *args, **kwargs): # noqa: E501 + """Banana - a model defined in OpenAPI + + Args: + length_cm (float): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.length_cm = length_cm + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, length_cm, *args, **kwargs): # noqa: E501 + """Banana - a model defined in OpenAPI + + Args: + length_cm (float): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.length_cm = length_cm + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/banana_req.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/banana_req.py new file mode 100644 index 000000000000..1e6d97d13430 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/banana_req.py @@ -0,0 +1,267 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class BananaReq(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'length_cm': (float,), # noqa: E501 + 'sweet': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'length_cm': 'lengthCm', # noqa: E501 + 'sweet': 'sweet', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, length_cm, *args, **kwargs): # noqa: E501 + """BananaReq - a model defined in OpenAPI + + Args: + length_cm (float): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + sweet (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.length_cm = length_cm + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, length_cm, *args, **kwargs): # noqa: E501 + """BananaReq - a model defined in OpenAPI + + Args: + length_cm (float): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + sweet (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.length_cm = length_cm + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/basque_pig.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/basque_pig.py new file mode 100644 index 000000000000..456066d2ce5e --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/basque_pig.py @@ -0,0 +1,269 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class BasquePig(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'class_name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'class_name': 'className', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501 + """BasquePig - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.class_name = class_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, class_name, *args, **kwargs): # noqa: E501 + """BasquePig - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.class_name = class_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/boolean_enum.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/boolean_enum.py new file mode 100644 index 000000000000..e4002fb8f622 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/boolean_enum.py @@ -0,0 +1,281 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class BooleanEnum(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'TRUE': True, + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (bool,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """BooleanEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (bool): if omitted defaults to True, must be one of [True, ] # noqa: E501 + + Keyword Args: + value (bool): if omitted defaults to True, must be one of [True, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + value = True + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """BooleanEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (bool): if omitted defaults to True, must be one of [True, ] # noqa: E501 + + Keyword Args: + value (bool): if omitted defaults to True, must be one of [True, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + value = True + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/capitalization.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/capitalization.py new file mode 100644 index 000000000000..d57e30d2c85e --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/capitalization.py @@ -0,0 +1,283 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class Capitalization(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'small_camel': (str,), # noqa: E501 + 'capital_camel': (str,), # noqa: E501 + 'small_snake': (str,), # noqa: E501 + 'capital_snake': (str,), # noqa: E501 + 'sca_eth_flow_points': (str,), # noqa: E501 + 'att_name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'small_camel': 'smallCamel', # noqa: E501 + 'capital_camel': 'CapitalCamel', # noqa: E501 + 'small_snake': 'small_Snake', # noqa: E501 + 'capital_snake': 'Capital_Snake', # noqa: E501 + 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', # noqa: E501 + 'att_name': 'ATT_NAME', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Capitalization - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + small_camel (str): [optional] # noqa: E501 + capital_camel (str): [optional] # noqa: E501 + small_snake (str): [optional] # noqa: E501 + capital_snake (str): [optional] # noqa: E501 + sca_eth_flow_points (str): [optional] # noqa: E501 + att_name (str): Name of the pet . [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Capitalization - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + small_camel (str): [optional] # noqa: E501 + capital_camel (str): [optional] # noqa: E501 + small_snake (str): [optional] # noqa: E501 + capital_snake (str): [optional] # noqa: E501 + sca_eth_flow_points (str): [optional] # noqa: E501 + att_name (str): Name of the pet . [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/cat.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/cat.py new file mode 100644 index 000000000000..04a16c49115e --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/cat.py @@ -0,0 +1,338 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.animal import Animal + from petstore_api.model.cat_all_of import CatAllOf + globals()['Animal'] = Animal + globals()['CatAllOf'] = CatAllOf + + +class Cat(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'class_name': (str,), # noqa: E501 + 'declawed': (bool,), # noqa: E501 + 'color': (str,), # noqa: E501 + 'tail': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + val = { + } + if not val: + return None + return {'class_name': val} + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'declawed': 'declawed', # noqa: E501 + 'color': 'color', # noqa: E501 + 'tail': 'tail', # noqa: E501 + } + + read_only_vars = { + 'tail', # noqa: E501 + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Cat - a model defined in OpenAPI + + Keyword Args: + class_name (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + declawed (bool): [optional] # noqa: E501 + color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 + tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Cat - a model defined in OpenAPI + + Keyword Args: + class_name (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + declawed (bool): [optional] # noqa: E501 + color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 + tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + Animal, + CatAllOf, + ], + 'oneOf': [ + ], + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/cat_all_of.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/cat_all_of.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/cat_all_of.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/cat_all_of.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/category.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/category.py new file mode 100644 index 000000000000..21fb7bd65b51 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/category.py @@ -0,0 +1,275 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class Category(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + 'id': (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'id': 'id', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Category - a model defined in OpenAPI + + Args: + + Keyword Args: + name (str): defaults to "default-name" # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (int): [optional] # noqa: E501 + """ + + name = kwargs.get('name', "default-name") + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Category - a model defined in OpenAPI + + Args: + + Keyword Args: + name (str): defaults to "default-name" # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (int): [optional] # noqa: E501 + """ + + name = kwargs.get('name', "default-name") + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/child_cat.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/child_cat.py new file mode 100644 index 000000000000..6d971fd192aa --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/child_cat.py @@ -0,0 +1,329 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.child_cat_all_of import ChildCatAllOf + from petstore_api.model.parent_pet import ParentPet + globals()['ChildCatAllOf'] = ChildCatAllOf + globals()['ParentPet'] = ParentPet + + +class ChildCat(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'pet_type': (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + val = { + } + if not val: + return None + return {'pet_type': val} + + attribute_map = { + 'pet_type': 'pet_type', # noqa: E501 + 'name': 'name', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ChildCat - a model defined in OpenAPI + + Keyword Args: + pet_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ChildCat - a model defined in OpenAPI + + Keyword Args: + pet_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ChildCatAllOf, + ParentPet, + ], + 'oneOf': [ + ], + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/child_cat_all_of.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/child_cat_all_of.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/child_cat_all_of.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/child_cat_all_of.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/class_model.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/class_model.py new file mode 100644 index 000000000000..cbbd0ff1e81c --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/class_model.py @@ -0,0 +1,263 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class ClassModel(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + '_class': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + '_class': '_class', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ClassModel - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + _class (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ClassModel - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + _class (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/client.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/client.py new file mode 100644 index 000000000000..82c5a6ed6bb4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/client.py @@ -0,0 +1,263 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class Client(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'client': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'client': 'client', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Client - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + client (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Client - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + client (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/complex_quadrilateral.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/complex_quadrilateral.py new file mode 100644 index 000000000000..3ad5b7a7180f --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/complex_quadrilateral.py @@ -0,0 +1,326 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.quadrilateral_interface import QuadrilateralInterface + from petstore_api.model.shape_interface import ShapeInterface + globals()['QuadrilateralInterface'] = QuadrilateralInterface + globals()['ShapeInterface'] = ShapeInterface + + +class ComplexQuadrilateral(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'shape_type': (str,), # noqa: E501 + 'quadrilateral_type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'shape_type': 'shapeType', # noqa: E501 + 'quadrilateral_type': 'quadrilateralType', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ComplexQuadrilateral - a model defined in OpenAPI + + Keyword Args: + shape_type (str): + quadrilateral_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ComplexQuadrilateral - a model defined in OpenAPI + + Keyword Args: + shape_type (str): + quadrilateral_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + QuadrilateralInterface, + ShapeInterface, + ], + 'oneOf': [ + ], + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/composed_one_of_number_with_validations.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_number_with_validations.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/composed_one_of_number_with_validations.py diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_schema_with_props_and_no_add_props.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/composed_schema_with_props_and_no_add_props.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/composed_schema_with_props_and_no_add_props.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/composed_schema_with_props_and_no_add_props.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/danish_pig.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/danish_pig.py new file mode 100644 index 000000000000..3a37b353933c --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/danish_pig.py @@ -0,0 +1,269 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class DanishPig(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'class_name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'class_name': 'className', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501 + """DanishPig - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.class_name = class_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, class_name, *args, **kwargs): # noqa: E501 + """DanishPig - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.class_name = class_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/dog.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/dog.py new file mode 100644 index 000000000000..f5b4d580f081 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/dog.py @@ -0,0 +1,344 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.animal import Animal + from petstore_api.model.dog_all_of import DogAllOf + from petstore_api.model.legs import Legs + globals()['Animal'] = Animal + globals()['DogAllOf'] = DogAllOf + globals()['Legs'] = Legs + + +class Dog(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'class_name': (str,), # noqa: E501 + 'breed': (str,), # noqa: E501 + 'legs': (Legs,), # noqa: E501 + 'color': (str,), # noqa: E501 + 'tail': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + val = { + } + if not val: + return None + return {'class_name': val} + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'breed': 'breed', # noqa: E501 + 'legs': 'legs', # noqa: E501 + 'color': 'color', # noqa: E501 + 'tail': 'tail', # noqa: E501 + } + + read_only_vars = { + 'tail', # noqa: E501 + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Dog - a model defined in OpenAPI + + Keyword Args: + class_name (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + breed (str): [optional] # noqa: E501 + legs (Legs): [optional] # noqa: E501 + color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 + tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Dog - a model defined in OpenAPI + + Keyword Args: + class_name (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + breed (str): [optional] # noqa: E501 + legs (Legs): [optional] # noqa: E501 + color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 + tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + Animal, + DogAllOf, + ], + 'oneOf': [ + ], + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/dog_all_of.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/dog_all_of.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/dog_all_of.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/dog_all_of.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/drawing.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/drawing.py new file mode 100644 index 000000000000..c08b8d2a0bee --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/drawing.py @@ -0,0 +1,287 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.fruit import Fruit + from petstore_api.model.nullable_shape import NullableShape + from petstore_api.model.shape import Shape + from petstore_api.model.shape_or_null import ShapeOrNull + globals()['Fruit'] = Fruit + globals()['NullableShape'] = NullableShape + globals()['Shape'] = Shape + globals()['ShapeOrNull'] = ShapeOrNull + + +class Drawing(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (Fruit,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'main_shape': (Shape,), # noqa: E501 + 'shape_or_null': (ShapeOrNull,), # noqa: E501 + 'nullable_shape': (NullableShape,), # noqa: E501 + 'shapes': ([Shape],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'main_shape': 'mainShape', # noqa: E501 + 'shape_or_null': 'shapeOrNull', # noqa: E501 + 'nullable_shape': 'nullableShape', # noqa: E501 + 'shapes': 'shapes', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Drawing - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + main_shape (Shape): [optional] # noqa: E501 + shape_or_null (ShapeOrNull): [optional] # noqa: E501 + nullable_shape (NullableShape): [optional] # noqa: E501 + shapes ([Shape]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Drawing - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + main_shape (Shape): [optional] # noqa: E501 + shape_or_null (ShapeOrNull): [optional] # noqa: E501 + nullable_shape (NullableShape): [optional] # noqa: E501 + shapes ([Shape]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/egress_threshold_options.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/egress_threshold_options.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/egress_threshold_options.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/egress_threshold_options.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_arrays.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_arrays.py new file mode 100644 index 000000000000..65b981ab7be3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_arrays.py @@ -0,0 +1,275 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class EnumArrays(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('just_symbol',): { + '>=': ">=", + '$': "$", + }, + ('array_enum',): { + 'FISH': "fish", + 'CRAB': "crab", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'just_symbol': (str,), # noqa: E501 + 'array_enum': ([str],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'just_symbol': 'just_symbol', # noqa: E501 + 'array_enum': 'array_enum', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """EnumArrays - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + just_symbol (str): [optional] # noqa: E501 + array_enum ([str]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """EnumArrays - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + just_symbol (str): [optional] # noqa: E501 + array_enum ([str]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_class.py new file mode 100644 index 000000000000..bf9b682bd05d --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_class.py @@ -0,0 +1,283 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class EnumClass(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '_ABC': "_abc", + '-EFG': "-efg", + '(XYZ)': "(xyz)", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """EnumClass - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 + + Keyword Args: + value (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + value = "-efg" + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """EnumClass - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 + + Keyword Args: + value (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + value = "-efg" + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_test.py new file mode 100644 index 000000000000..dd47ea4f74c2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/enum_test.py @@ -0,0 +1,356 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.array_of_enums import ArrayOfEnums + from petstore_api.model.boolean_enum import BooleanEnum + from petstore_api.model.integer_enum import IntegerEnum + from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue + from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue + from petstore_api.model.string_enum import StringEnum + from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue + globals()['ArrayOfEnums'] = ArrayOfEnums + globals()['BooleanEnum'] = BooleanEnum + globals()['IntegerEnum'] = IntegerEnum + globals()['IntegerEnumOneValue'] = IntegerEnumOneValue + globals()['IntegerEnumWithDefaultValue'] = IntegerEnumWithDefaultValue + globals()['StringEnum'] = StringEnum + globals()['StringEnumWithDefaultValue'] = StringEnumWithDefaultValue + + +class EnumTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('enum_string_required',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + 'EMPTY': "", + }, + ('enum_string',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + 'EMPTY': "", + }, + ('enum_integer',): { + '1': 1, + '-1': -1, + }, + ('enum_number',): { + '1.1': 1.1, + '-1.2': -1.2, + }, + ('enum_bool',): { + 'FALSE': False, + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'enum_string_required': (str,), # noqa: E501 + 'enum_string': (str,), # noqa: E501 + 'enum_integer': (int,), # noqa: E501 + 'enum_number': (float,), # noqa: E501 + 'enum_bool': (bool,), # noqa: E501 + 'bool_enum': (BooleanEnum,), # noqa: E501 + 'string_enum': (StringEnum,), # noqa: E501 + 'integer_enum': (IntegerEnum,), # noqa: E501 + 'string_enum_with_default_value': (StringEnumWithDefaultValue,), # noqa: E501 + 'integer_enum_with_default_value': (IntegerEnumWithDefaultValue,), # noqa: E501 + 'integer_enum_one_value': (IntegerEnumOneValue,), # noqa: E501 + 'inline_array_of_str_enum': ([StringEnum],), # noqa: E501 + 'array_of_str_enum': (ArrayOfEnums,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'enum_string_required': 'enum_string_required', # noqa: E501 + 'enum_string': 'enum_string', # noqa: E501 + 'enum_integer': 'enum_integer', # noqa: E501 + 'enum_number': 'enum_number', # noqa: E501 + 'enum_bool': 'enum_bool', # noqa: E501 + 'bool_enum': 'boolEnum', # noqa: E501 + 'string_enum': 'stringEnum', # noqa: E501 + 'integer_enum': 'IntegerEnum', # noqa: E501 + 'string_enum_with_default_value': 'StringEnumWithDefaultValue', # noqa: E501 + 'integer_enum_with_default_value': 'IntegerEnumWithDefaultValue', # noqa: E501 + 'integer_enum_one_value': 'IntegerEnumOneValue', # noqa: E501 + 'inline_array_of_str_enum': 'InlineArrayOfStrEnum', # noqa: E501 + 'array_of_str_enum': 'ArrayOfStrEnum', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, enum_string_required, *args, **kwargs): # noqa: E501 + """EnumTest - a model defined in OpenAPI + + Args: + enum_string_required (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + enum_string (str): [optional] # noqa: E501 + enum_integer (int): [optional] # noqa: E501 + enum_number (float): [optional] # noqa: E501 + enum_bool (bool): [optional] if omitted the server will use the default value of False # noqa: E501 + bool_enum (BooleanEnum): [optional] # noqa: E501 + string_enum (StringEnum): [optional] # noqa: E501 + integer_enum (IntegerEnum): [optional] # noqa: E501 + string_enum_with_default_value (StringEnumWithDefaultValue): [optional] # noqa: E501 + integer_enum_with_default_value (IntegerEnumWithDefaultValue): [optional] # noqa: E501 + integer_enum_one_value (IntegerEnumOneValue): [optional] # noqa: E501 + inline_array_of_str_enum ([StringEnum]): [optional] # noqa: E501 + array_of_str_enum (ArrayOfEnums): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.enum_string_required = enum_string_required + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, enum_string_required, *args, **kwargs): # noqa: E501 + """EnumTest - a model defined in OpenAPI + + Args: + enum_string_required (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + enum_string (str): [optional] # noqa: E501 + enum_integer (int): [optional] # noqa: E501 + enum_number (float): [optional] # noqa: E501 + enum_bool (bool): [optional] if omitted the server will use the default value of False # noqa: E501 + bool_enum (BooleanEnum): [optional] # noqa: E501 + string_enum (StringEnum): [optional] # noqa: E501 + integer_enum (IntegerEnum): [optional] # noqa: E501 + string_enum_with_default_value (StringEnumWithDefaultValue): [optional] # noqa: E501 + integer_enum_with_default_value (IntegerEnumWithDefaultValue): [optional] # noqa: E501 + integer_enum_one_value (IntegerEnumOneValue): [optional] # noqa: E501 + inline_array_of_str_enum ([StringEnum]): [optional] # noqa: E501 + array_of_str_enum (ArrayOfEnums): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.enum_string_required = enum_string_required + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/equilateral_triangle.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/equilateral_triangle.py new file mode 100644 index 000000000000..47e8e9a64f18 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/equilateral_triangle.py @@ -0,0 +1,326 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.shape_interface import ShapeInterface + from petstore_api.model.triangle_interface import TriangleInterface + globals()['ShapeInterface'] = ShapeInterface + globals()['TriangleInterface'] = TriangleInterface + + +class EquilateralTriangle(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'shape_type': (str,), # noqa: E501 + 'triangle_type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'shape_type': 'shapeType', # noqa: E501 + 'triangle_type': 'triangleType', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """EquilateralTriangle - a model defined in OpenAPI + + Keyword Args: + shape_type (str): + triangle_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """EquilateralTriangle - a model defined in OpenAPI + + Keyword Args: + shape_type (str): + triangle_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ShapeInterface, + TriangleInterface, + ], + 'oneOf': [ + ], + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/fake_post_inline_additional_properties_payload_array_data.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/fake_post_inline_additional_properties_payload_array_data.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/fake_post_inline_additional_properties_payload_array_data.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/fake_post_inline_additional_properties_payload_array_data.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/file.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/file.py new file mode 100644 index 000000000000..6d8d65f45752 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/file.py @@ -0,0 +1,263 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class File(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'source_uri': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'source_uri': 'sourceURI', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """File - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + source_uri (str): Test capitalization. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """File - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + source_uri (str): Test capitalization. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/file_schema_test_class.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/file_schema_test_class.py new file mode 100644 index 000000000000..d8db617ffa80 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/file_schema_test_class.py @@ -0,0 +1,273 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.file import File + globals()['File'] = File + + +class FileSchemaTestClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'file': (File,), # noqa: E501 + 'files': ([File],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'file': 'file', # noqa: E501 + 'files': 'files', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """FileSchemaTestClass - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + file (File): [optional] # noqa: E501 + files ([File]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """FileSchemaTestClass - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + file (File): [optional] # noqa: E501 + files ([File]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/foo.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/foo.py new file mode 100644 index 000000000000..fd07a6d8ade3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/foo.py @@ -0,0 +1,263 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class Foo(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'bar': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'bar': 'bar', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Foo - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bar (str): [optional] if omitted the server will use the default value of "bar" # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Foo - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bar (str): [optional] if omitted the server will use the default value of "bar" # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/foo_get_default_response.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/foo_get_default_response.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/foo_get_default_response.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/foo_get_default_response.py diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/foo_object.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/foo_object.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/foo_object.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/foo_object.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/format_test.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/format_test.py new file mode 100644 index 000000000000..5b425f42332d --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/format_test.py @@ -0,0 +1,378 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class FormatTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('number',): { + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + 'multiple_of': 32.5, + }, + ('password',): { + 'max_length': 64, + 'min_length': 10, + }, + ('integer',): { + 'inclusive_maximum': 100, + 'inclusive_minimum': 10, + 'multiple_of': 2, + }, + ('int32',): { + 'inclusive_maximum': 200, + 'inclusive_minimum': 20, + }, + ('float',): { + 'inclusive_maximum': 987.6, + 'inclusive_minimum': 54.3, + }, + ('double',): { + 'inclusive_maximum': 123.4, + 'inclusive_minimum': 67.8, + }, + ('string',): { + 'regex': { + 'pattern': r'[a-z]', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + ('pattern_with_digits',): { + 'regex': { + 'pattern': r'^\d{10}$', # noqa: E501 + }, + }, + ('pattern_with_digits_and_delimiter',): { + 'regex': { + 'pattern': r'^image_\d{1,3}$', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'number': (float,), # noqa: E501 + 'byte': (str,), # noqa: E501 + 'date': (date,), # noqa: E501 + 'password': (str,), # noqa: E501 + 'integer': (int,), # noqa: E501 + 'int32': (int,), # noqa: E501 + 'int64': (int,), # noqa: E501 + 'float': (float,), # noqa: E501 + 'double': (float,), # noqa: E501 + 'string': (str,), # noqa: E501 + 'binary': (file_type,), # noqa: E501 + 'date_time': (datetime,), # noqa: E501 + 'uuid': (str,), # noqa: E501 + 'uuid_no_example': (str,), # noqa: E501 + 'pattern_with_digits': (str,), # noqa: E501 + 'pattern_with_digits_and_delimiter': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'number': 'number', # noqa: E501 + 'byte': 'byte', # noqa: E501 + 'date': 'date', # noqa: E501 + 'password': 'password', # noqa: E501 + 'integer': 'integer', # noqa: E501 + 'int32': 'int32', # noqa: E501 + 'int64': 'int64', # noqa: E501 + 'float': 'float', # noqa: E501 + 'double': 'double', # noqa: E501 + 'string': 'string', # noqa: E501 + 'binary': 'binary', # noqa: E501 + 'date_time': 'dateTime', # noqa: E501 + 'uuid': 'uuid', # noqa: E501 + 'uuid_no_example': 'uuidNoExample', # noqa: E501 + 'pattern_with_digits': 'pattern_with_digits', # noqa: E501 + 'pattern_with_digits_and_delimiter': 'pattern_with_digits_and_delimiter', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, number, byte, date, password, *args, **kwargs): # noqa: E501 + """FormatTest - a model defined in OpenAPI + + Args: + number (float): + byte (str): + date (date): + password (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + integer (int): [optional] # noqa: E501 + int32 (int): [optional] # noqa: E501 + int64 (int): [optional] # noqa: E501 + float (float): [optional] # noqa: E501 + double (float): [optional] # noqa: E501 + string (str): [optional] # noqa: E501 + binary (file_type): [optional] # noqa: E501 + date_time (datetime): [optional] # noqa: E501 + uuid (str): [optional] # noqa: E501 + uuid_no_example (str): [optional] # noqa: E501 + pattern_with_digits (str): A string that is a 10 digit number. Can have leading zeros.. [optional] # noqa: E501 + pattern_with_digits_and_delimiter (str): A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.number = number + self.byte = byte + self.date = date + self.password = password + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, number, byte, date, password, *args, **kwargs): # noqa: E501 + """FormatTest - a model defined in OpenAPI + + Args: + number (float): + byte (str): + date (date): + password (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + integer (int): [optional] # noqa: E501 + int32 (int): [optional] # noqa: E501 + int64 (int): [optional] # noqa: E501 + float (float): [optional] # noqa: E501 + double (float): [optional] # noqa: E501 + string (str): [optional] # noqa: E501 + binary (file_type): [optional] # noqa: E501 + date_time (datetime): [optional] # noqa: E501 + uuid (str): [optional] # noqa: E501 + uuid_no_example (str): [optional] # noqa: E501 + pattern_with_digits (str): A string that is a 10 digit number. Can have leading zeros.. [optional] # noqa: E501 + pattern_with_digits_and_delimiter (str): A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.number = number + self.byte = byte + self.date = date + self.password = password + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/fruit.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/fruit.py new file mode 100644 index 000000000000..79952ac853aa --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/fruit.py @@ -0,0 +1,345 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.apple import Apple + from petstore_api.model.banana import Banana + globals()['Apple'] = Apple + globals()['Banana'] = Banana + + +class Fruit(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('cultivar',): { + 'regex': { + 'pattern': r'^[a-zA-Z\s]*$', # noqa: E501 + }, + }, + ('origin',): { + 'regex': { + 'pattern': r'^[A-Z\s]*$', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'cultivar': (str,), # noqa: E501 + 'length_cm': (float,), # noqa: E501 + 'color': (str,), # noqa: E501 + 'origin': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'cultivar': 'cultivar', # noqa: E501 + 'length_cm': 'lengthCm', # noqa: E501 + 'color': 'color', # noqa: E501 + 'origin': 'origin', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Fruit - a model defined in OpenAPI + + Keyword Args: + cultivar (str): + length_cm (float): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + color (str): [optional] # noqa: E501 + origin (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Fruit - a model defined in OpenAPI + + Keyword Args: + cultivar (str): + length_cm (float): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + color (str): [optional] # noqa: E501 + origin (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ], + 'oneOf': [ + Apple, + Banana, + ], + } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/fruit_req.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/fruit_req.py new file mode 100644 index 000000000000..62fdc158f582 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/fruit_req.py @@ -0,0 +1,335 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.apple_req import AppleReq + from petstore_api.model.banana_req import BananaReq + globals()['AppleReq'] = AppleReq + globals()['BananaReq'] = BananaReq + + +class FruitReq(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'mealy': (bool,), # noqa: E501 + 'sweet': (bool,), # noqa: E501 + 'cultivar': (str,), # noqa: E501 + 'length_cm': (float,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'mealy': 'mealy', # noqa: E501 + 'sweet': 'sweet', # noqa: E501 + 'cultivar': 'cultivar', # noqa: E501 + 'length_cm': 'lengthCm', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """FruitReq - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + mealy (bool): [optional] # noqa: E501 + sweet (bool): [optional] # noqa: E501 + cultivar (str): [optional] # noqa: E501 + length_cm (float): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """FruitReq - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + mealy (bool): [optional] # noqa: E501 + sweet (bool): [optional] # noqa: E501 + cultivar (str): [optional] # noqa: E501 + length_cm (float): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ], + 'oneOf': [ + AppleReq, + BananaReq, + none_type, + ], + } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/gm_fruit.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/gm_fruit.py new file mode 100644 index 000000000000..93f102967ff3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/gm_fruit.py @@ -0,0 +1,345 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.apple import Apple + from petstore_api.model.banana import Banana + globals()['Apple'] = Apple + globals()['Banana'] = Banana + + +class GmFruit(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('cultivar',): { + 'regex': { + 'pattern': r'^[a-zA-Z\s]*$', # noqa: E501 + }, + }, + ('origin',): { + 'regex': { + 'pattern': r'^[A-Z\s]*$', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'cultivar': (str,), # noqa: E501 + 'length_cm': (float,), # noqa: E501 + 'color': (str,), # noqa: E501 + 'origin': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'cultivar': 'cultivar', # noqa: E501 + 'length_cm': 'lengthCm', # noqa: E501 + 'color': 'color', # noqa: E501 + 'origin': 'origin', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """GmFruit - a model defined in OpenAPI + + Keyword Args: + cultivar (str): + length_cm (float): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + color (str): [optional] # noqa: E501 + origin (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """GmFruit - a model defined in OpenAPI + + Keyword Args: + cultivar (str): + length_cm (float): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + color (str): [optional] # noqa: E501 + origin (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + Apple, + Banana, + ], + 'allOf': [ + ], + 'oneOf': [ + ], + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit_no_properties.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/gm_fruit_no_properties.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit_no_properties.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/gm_fruit_no_properties.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/grandparent_animal.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/grandparent_animal.py new file mode 100644 index 000000000000..f6d1b0bb2043 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/grandparent_animal.py @@ -0,0 +1,283 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.child_cat import ChildCat + from petstore_api.model.parent_pet import ParentPet + globals()['ChildCat'] = ChildCat + globals()['ParentPet'] = ParentPet + + +class GrandparentAnimal(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'pet_type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + lazy_import() + val = { + 'ChildCat': ChildCat, + 'ParentPet': ParentPet, + } + if not val: + return None + return {'pet_type': val} + + attribute_map = { + 'pet_type': 'pet_type', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, pet_type, *args, **kwargs): # noqa: E501 + """GrandparentAnimal - a model defined in OpenAPI + + Args: + pet_type (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.pet_type = pet_type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, pet_type, *args, **kwargs): # noqa: E501 + """GrandparentAnimal - a model defined in OpenAPI + + Args: + pet_type (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.pet_type = pet_type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/has_only_read_only.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/has_only_read_only.py new file mode 100644 index 000000000000..1ccc67be07a1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/has_only_read_only.py @@ -0,0 +1,269 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class HasOnlyReadOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'bar': (str,), # noqa: E501 + 'foo': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'bar': 'bar', # noqa: E501 + 'foo': 'foo', # noqa: E501 + } + + read_only_vars = { + 'bar', # noqa: E501 + 'foo', # noqa: E501 + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """HasOnlyReadOnly - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bar (str): [optional] # noqa: E501 + foo (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """HasOnlyReadOnly - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bar (str): [optional] # noqa: E501 + foo (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/health_check_result.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/health_check_result.py new file mode 100644 index 000000000000..e0f31297fe00 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/health_check_result.py @@ -0,0 +1,263 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class HealthCheckResult(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'nullable_message': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'nullable_message': 'NullableMessage', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """HealthCheckResult - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + nullable_message (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """HealthCheckResult - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + nullable_message (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/inline_additional_properties_ref_payload.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/inline_additional_properties_ref_payload.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/inline_additional_properties_ref_payload.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/inline_additional_properties_ref_payload.py diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/inline_object6.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/inline_object6.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/inline_object6.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/inline_object6.py diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/inline_response_default.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/inline_response_default.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/inline_response_default.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/inline_response_default.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum.py new file mode 100644 index 000000000000..de46d21f64f6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum.py @@ -0,0 +1,291 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class IntegerEnum(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '0': 0, + '1': 1, + '2': 2, + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (int,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """IntegerEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (int):, must be one of [0, 1, 2, ] # noqa: E501 + + Keyword Args: + value (int):, must be one of [0, 1, 2, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """IntegerEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (int):, must be one of [0, 1, 2, ] # noqa: E501 + + Keyword Args: + value (int):, must be one of [0, 1, 2, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum_one_value.py new file mode 100644 index 000000000000..9091039a21a8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum_one_value.py @@ -0,0 +1,281 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class IntegerEnumOneValue(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '0': 0, + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (int,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """IntegerEnumOneValue - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (int): if omitted defaults to 0, must be one of [0, ] # noqa: E501 + + Keyword Args: + value (int): if omitted defaults to 0, must be one of [0, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + value = 0 + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """IntegerEnumOneValue - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (int): if omitted defaults to 0, must be one of [0, ] # noqa: E501 + + Keyword Args: + value (int): if omitted defaults to 0, must be one of [0, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + value = 0 + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum_with_default_value.py new file mode 100644 index 000000000000..f3473cffa273 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/integer_enum_with_default_value.py @@ -0,0 +1,283 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class IntegerEnumWithDefaultValue(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '0': 0, + '1': 1, + '2': 2, + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (int,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """IntegerEnumWithDefaultValue - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (int): if omitted defaults to 0, must be one of [0, 1, 2, ] # noqa: E501 + + Keyword Args: + value (int): if omitted defaults to 0, must be one of [0, 1, 2, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + value = 0 + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """IntegerEnumWithDefaultValue - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (int): if omitted defaults to 0, must be one of [0, 1, 2, ] # noqa: E501 + + Keyword Args: + value (int): if omitted defaults to 0, must be one of [0, 1, 2, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + value = 0 + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/isosceles_triangle.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/isosceles_triangle.py new file mode 100644 index 000000000000..162f8fedb53a --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/isosceles_triangle.py @@ -0,0 +1,326 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.shape_interface import ShapeInterface + from petstore_api.model.triangle_interface import TriangleInterface + globals()['ShapeInterface'] = ShapeInterface + globals()['TriangleInterface'] = TriangleInterface + + +class IsoscelesTriangle(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'shape_type': (str,), # noqa: E501 + 'triangle_type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'shape_type': 'shapeType', # noqa: E501 + 'triangle_type': 'triangleType', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IsoscelesTriangle - a model defined in OpenAPI + + Keyword Args: + shape_type (str): + triangle_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """IsoscelesTriangle - a model defined in OpenAPI + + Keyword Args: + shape_type (str): + triangle_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ShapeInterface, + TriangleInterface, + ], + 'oneOf': [ + ], + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/legs.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/legs.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/legs.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/legs.py diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/list.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/list.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/list.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/list.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/mammal.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/mammal.py new file mode 100644 index 000000000000..0a2d927ea7ac --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/mammal.py @@ -0,0 +1,349 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.pig import Pig + from petstore_api.model.whale import Whale + from petstore_api.model.zebra import Zebra + globals()['Pig'] = Pig + globals()['Whale'] = Whale + globals()['Zebra'] = Zebra + + +class Mammal(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('type',): { + 'PLAINS': "plains", + 'MOUNTAIN': "mountain", + 'GREVYS': "grevys", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'class_name': (str,), # noqa: E501 + 'has_baleen': (bool,), # noqa: E501 + 'has_teeth': (bool,), # noqa: E501 + 'type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + lazy_import() + val = { + 'Pig': Pig, + 'whale': Whale, + 'zebra': Zebra, + } + if not val: + return None + return {'class_name': val} + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'has_baleen': 'hasBaleen', # noqa: E501 + 'has_teeth': 'hasTeeth', # noqa: E501 + 'type': 'type', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Mammal - a model defined in OpenAPI + + Keyword Args: + class_name (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + has_baleen (bool): [optional] # noqa: E501 + has_teeth (bool): [optional] # noqa: E501 + type (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Mammal - a model defined in OpenAPI + + Keyword Args: + class_name (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + has_baleen (bool): [optional] # noqa: E501 + has_teeth (bool): [optional] # noqa: E501 + type (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ], + 'oneOf': [ + Pig, + Whale, + Zebra, + ], + } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/map_test.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/map_test.py new file mode 100644 index 000000000000..eccf9c9e610c --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/map_test.py @@ -0,0 +1,285 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.string_boolean_map import StringBooleanMap + globals()['StringBooleanMap'] = StringBooleanMap + + +class MapTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('map_of_enum_string',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'map_map_of_string': ({str: ({str: (str,)},)},), # noqa: E501 + 'map_of_enum_string': ({str: (str,)},), # noqa: E501 + 'direct_map': ({str: (bool,)},), # noqa: E501 + 'indirect_map': (StringBooleanMap,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'map_map_of_string': 'map_map_of_string', # noqa: E501 + 'map_of_enum_string': 'map_of_enum_string', # noqa: E501 + 'direct_map': 'direct_map', # noqa: E501 + 'indirect_map': 'indirect_map', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MapTest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 + map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 + direct_map ({str: (bool,)}): [optional] # noqa: E501 + indirect_map (StringBooleanMap): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """MapTest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 + map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 + direct_map ({str: (bool,)}): [optional] # noqa: E501 + indirect_map (StringBooleanMap): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/mixed_properties_and_additional_properties_class.py new file mode 100644 index 000000000000..4d825b8dd46d --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -0,0 +1,277 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.animal import Animal + globals()['Animal'] = Animal + + +class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'uuid': (str,), # noqa: E501 + 'date_time': (datetime,), # noqa: E501 + 'map': ({str: (Animal,)},), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'uuid': 'uuid', # noqa: E501 + 'date_time': 'dateTime', # noqa: E501 + 'map': 'map', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + uuid (str): [optional] # noqa: E501 + date_time (datetime): [optional] # noqa: E501 + map ({str: (Animal,)}): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + uuid (str): [optional] # noqa: E501 + date_time (datetime): [optional] # noqa: E501 + map ({str: (Animal,)}): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/model200_response.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/model200_response.py new file mode 100644 index 000000000000..9bebea2423fd --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/model200_response.py @@ -0,0 +1,267 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class Model200Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (int,), # noqa: E501 + '_class': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + '_class': 'class', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Model200Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (int): [optional] # noqa: E501 + _class (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Model200Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (int): [optional] # noqa: E501 + _class (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/model_200_response.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/model_200_response.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/model_200_response.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/model_200_response.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/model_return.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/model_return.py new file mode 100644 index 000000000000..f3bd5123dd74 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/model_return.py @@ -0,0 +1,263 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class ModelReturn(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + '_return': (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + '_return': 'return', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ModelReturn - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + _return (int): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ModelReturn - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + _return (int): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/mole.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/mole.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/mole.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/mole.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/name.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/name.py new file mode 100644 index 000000000000..aec8c8b900cb --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/name.py @@ -0,0 +1,283 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class Name(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (int,), # noqa: E501 + 'snake_case': (int,), # noqa: E501 + '_property': (str,), # noqa: E501 + '_123_number': (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'snake_case': 'snake_case', # noqa: E501 + '_property': 'property', # noqa: E501 + '_123_number': '123Number', # noqa: E501 + } + + read_only_vars = { + 'snake_case', # noqa: E501 + '_123_number', # noqa: E501 + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """Name - a model defined in OpenAPI + + Args: + name (int): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + snake_case (int): [optional] # noqa: E501 + _property (str): [optional] # noqa: E501 + _123_number (int): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, name, *args, **kwargs): # noqa: E501 + """Name - a model defined in OpenAPI + + Args: + name (int): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + snake_case (int): [optional] # noqa: E501 + _property (str): [optional] # noqa: E501 + _123_number (int): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/nullable_class.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/nullable_class.py new file mode 100644 index 000000000000..0c6765a33ca5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/nullable_class.py @@ -0,0 +1,311 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class NullableClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'integer_prop': (int, none_type,), # noqa: E501 + 'number_prop': (float, none_type,), # noqa: E501 + 'boolean_prop': (bool, none_type,), # noqa: E501 + 'string_prop': (str, none_type,), # noqa: E501 + 'date_prop': (date, none_type,), # noqa: E501 + 'datetime_prop': (datetime, none_type,), # noqa: E501 + 'array_nullable_prop': ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type,), # noqa: E501 + 'array_and_items_nullable_prop': ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type], none_type,), # noqa: E501 + 'array_items_nullable': ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type],), # noqa: E501 + 'object_nullable': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + 'object_nullable_prop': ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}, none_type,), # noqa: E501 + 'object_and_items_nullable_prop': ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}, none_type,), # noqa: E501 + 'object_items_nullable': ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)},), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'integer_prop': 'integer_prop', # noqa: E501 + 'number_prop': 'number_prop', # noqa: E501 + 'boolean_prop': 'boolean_prop', # noqa: E501 + 'string_prop': 'string_prop', # noqa: E501 + 'date_prop': 'date_prop', # noqa: E501 + 'datetime_prop': 'datetime_prop', # noqa: E501 + 'array_nullable_prop': 'array_nullable_prop', # noqa: E501 + 'array_and_items_nullable_prop': 'array_and_items_nullable_prop', # noqa: E501 + 'array_items_nullable': 'array_items_nullable', # noqa: E501 + 'object_nullable': 'object_nullable', # noqa: E501 + 'object_nullable_prop': 'object_nullable_prop', # noqa: E501 + 'object_and_items_nullable_prop': 'object_and_items_nullable_prop', # noqa: E501 + 'object_items_nullable': 'object_items_nullable', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """NullableClass - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + integer_prop (int, none_type): [optional] # noqa: E501 + number_prop (float, none_type): [optional] # noqa: E501 + boolean_prop (bool, none_type): [optional] # noqa: E501 + string_prop (str, none_type): [optional] # noqa: E501 + date_prop (date, none_type): [optional] # noqa: E501 + datetime_prop (datetime, none_type): [optional] # noqa: E501 + array_nullable_prop ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type): [optional] # noqa: E501 + array_and_items_nullable_prop ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type], none_type): [optional] # noqa: E501 + array_items_nullable ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type]): [optional] # noqa: E501 + object_nullable ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + object_nullable_prop ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}, none_type): [optional] # noqa: E501 + object_and_items_nullable_prop ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}, none_type): [optional] # noqa: E501 + object_items_nullable ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """NullableClass - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + integer_prop (int, none_type): [optional] # noqa: E501 + number_prop (float, none_type): [optional] # noqa: E501 + boolean_prop (bool, none_type): [optional] # noqa: E501 + string_prop (str, none_type): [optional] # noqa: E501 + date_prop (date, none_type): [optional] # noqa: E501 + datetime_prop (datetime, none_type): [optional] # noqa: E501 + array_nullable_prop ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type): [optional] # noqa: E501 + array_and_items_nullable_prop ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type], none_type): [optional] # noqa: E501 + array_items_nullable ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type]): [optional] # noqa: E501 + object_nullable ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + object_nullable_prop ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}, none_type): [optional] # noqa: E501 + object_and_items_nullable_prop ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}, none_type): [optional] # noqa: E501 + object_items_nullable ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/nullable_shape.py new file mode 100644 index 000000000000..75aad1b1b010 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/nullable_shape.py @@ -0,0 +1,336 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.quadrilateral import Quadrilateral + from petstore_api.model.triangle import Triangle + globals()['Quadrilateral'] = Quadrilateral + globals()['Triangle'] = Triangle + + +class NullableShape(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'shape_type': (str,), # noqa: E501 + 'quadrilateral_type': (str,), # noqa: E501 + 'triangle_type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + lazy_import() + val = { + 'Quadrilateral': Quadrilateral, + 'Triangle': Triangle, + } + if not val: + return None + return {'shape_type': val} + + attribute_map = { + 'shape_type': 'shapeType', # noqa: E501 + 'quadrilateral_type': 'quadrilateralType', # noqa: E501 + 'triangle_type': 'triangleType', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """NullableShape - a model defined in OpenAPI + + Keyword Args: + shape_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + quadrilateral_type (str): [optional] # noqa: E501 + triangle_type (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """NullableShape - a model defined in OpenAPI + + Keyword Args: + shape_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + quadrilateral_type (str): [optional] # noqa: E501 + triangle_type (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ], + 'oneOf': [ + Quadrilateral, + Triangle, + ], + } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/number_only.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/number_only.py new file mode 100644 index 000000000000..7a586085d7c1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/number_only.py @@ -0,0 +1,263 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class NumberOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'just_number': (float,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'just_number': 'JustNumber', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """NumberOnly - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + just_number (float): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """NumberOnly - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + just_number (float): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/number_with_validations.py new file mode 100644 index 000000000000..67e019ad54db --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/number_with_validations.py @@ -0,0 +1,290 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class NumberWithValidations(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('value',): { + 'inclusive_maximum': 20, + 'inclusive_minimum': 10, + }, + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (float,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """NumberWithValidations - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (float): # noqa: E501 + + Keyword Args: + value (float): # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """NumberWithValidations - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (float): # noqa: E501 + + Keyword Args: + value (float): # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/object_interface.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/object_interface.py new file mode 100644 index 000000000000..4f9e0edf9862 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/object_interface.py @@ -0,0 +1,259 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class ObjectInterface(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ObjectInterface - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ObjectInterface - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/object_model_with_ref_props.py new file mode 100644 index 000000000000..085a1533c4bd --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/object_model_with_ref_props.py @@ -0,0 +1,283 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.number_with_validations import NumberWithValidations + from petstore_api.model.readonly import Readonly + globals()['NumberWithValidations'] = NumberWithValidations + globals()['Readonly'] = Readonly + + +class ObjectModelWithRefProps(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'my_number': (NumberWithValidations,), # noqa: E501 + 'my_readonly': (Readonly,), # noqa: E501 + 'my_string': (str,), # noqa: E501 + 'my_boolean': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'my_number': 'my_number', # noqa: E501 + 'my_readonly': 'my_readonly', # noqa: E501 + 'my_string': 'my_string', # noqa: E501 + 'my_boolean': 'my_boolean', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ObjectModelWithRefProps - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + my_number (NumberWithValidations): [optional] # noqa: E501 + my_readonly (Readonly): [optional] # noqa: E501 + my_string (str): [optional] # noqa: E501 + my_boolean (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ObjectModelWithRefProps - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + my_number (NumberWithValidations): [optional] # noqa: E501 + my_readonly (Readonly): [optional] # noqa: E501 + my_string (str): [optional] # noqa: E501 + my_boolean (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/object_with_validations.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/object_with_validations.py new file mode 100644 index 000000000000..16e0c1f1a2d3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/object_with_validations.py @@ -0,0 +1,262 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class ObjectWithValidations(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('value',): { + 'min_properties': 1, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ObjectWithValidations - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ObjectWithValidations - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/order.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/order.py new file mode 100644 index 000000000000..98fe0b869760 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/order.py @@ -0,0 +1,288 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class Order(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'id': (int,), # noqa: E501 + 'pet_id': (int,), # noqa: E501 + 'quantity': (int,), # noqa: E501 + 'ship_date': (datetime,), # noqa: E501 + 'status': (str,), # noqa: E501 + 'complete': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'pet_id': 'petId', # noqa: E501 + 'quantity': 'quantity', # noqa: E501 + 'ship_date': 'shipDate', # noqa: E501 + 'status': 'status', # noqa: E501 + 'complete': 'complete', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Order - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (int): [optional] # noqa: E501 + pet_id (int): [optional] # noqa: E501 + quantity (int): [optional] # noqa: E501 + ship_date (datetime): [optional] # noqa: E501 + status (str): Order Status. [optional] # noqa: E501 + complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Order - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (int): [optional] # noqa: E501 + pet_id (int): [optional] # noqa: E501 + quantity (int): [optional] # noqa: E501 + ship_date (datetime): [optional] # noqa: E501 + status (str): Order Status. [optional] # noqa: E501 + complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/parent_pet.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/parent_pet.py new file mode 100644 index 000000000000..8d94006f1591 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/parent_pet.py @@ -0,0 +1,326 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.child_cat import ChildCat + from petstore_api.model.grandparent_animal import GrandparentAnimal + globals()['ChildCat'] = ChildCat + globals()['GrandparentAnimal'] = GrandparentAnimal + + +class ParentPet(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'pet_type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + lazy_import() + val = { + 'ChildCat': ChildCat, + } + if not val: + return None + return {'pet_type': val} + + attribute_map = { + 'pet_type': 'pet_type', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ParentPet - a model defined in OpenAPI + + Keyword Args: + pet_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ParentPet - a model defined in OpenAPI + + Keyword Args: + pet_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + GrandparentAnimal, + ], + 'oneOf': [ + ], + } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/pet.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/pet.py new file mode 100644 index 000000000000..5eb4041e91d0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/pet.py @@ -0,0 +1,304 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.category import Category + from petstore_api.model.tag import Tag + globals()['Category'] = Category + globals()['Tag'] = Tag + + +class Pet(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'AVAILABLE': "available", + 'PENDING': "pending", + 'SOLD': "sold", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'name': (str,), # noqa: E501 + 'photo_urls': ([str],), # noqa: E501 + 'id': (int,), # noqa: E501 + 'category': (Category,), # noqa: E501 + 'tags': ([Tag],), # noqa: E501 + 'status': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'photo_urls': 'photoUrls', # noqa: E501 + 'id': 'id', # noqa: E501 + 'category': 'category', # noqa: E501 + 'tags': 'tags', # noqa: E501 + 'status': 'status', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, photo_urls, *args, **kwargs): # noqa: E501 + """Pet - a model defined in OpenAPI + + Args: + name (str): + photo_urls ([str]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (int): [optional] # noqa: E501 + category (Category): [optional] # noqa: E501 + tags ([Tag]): [optional] # noqa: E501 + status (str): pet status in the store. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.photo_urls = photo_urls + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, name, photo_urls, *args, **kwargs): # noqa: E501 + """Pet - a model defined in OpenAPI + + Args: + name (str): + photo_urls ([str]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (int): [optional] # noqa: E501 + category (Category): [optional] # noqa: E501 + tags ([Tag]): [optional] # noqa: E501 + status (str): pet status in the store. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.photo_urls = photo_urls + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/pig.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/pig.py new file mode 100644 index 000000000000..5c9bcc5bd034 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/pig.py @@ -0,0 +1,328 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.basque_pig import BasquePig + from petstore_api.model.danish_pig import DanishPig + globals()['BasquePig'] = BasquePig + globals()['DanishPig'] = DanishPig + + +class Pig(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'class_name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + lazy_import() + val = { + 'BasquePig': BasquePig, + 'DanishPig': DanishPig, + } + if not val: + return None + return {'class_name': val} + + attribute_map = { + 'class_name': 'className', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Pig - a model defined in OpenAPI + + Keyword Args: + class_name (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Pig - a model defined in OpenAPI + + Keyword Args: + class_name (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ], + 'oneOf': [ + BasquePig, + DanishPig, + ], + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/post_inline_additional_properties_payload_request.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/post_inline_additional_properties_payload_request.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/post_inline_additional_properties_payload_request.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/post_inline_additional_properties_payload_request.py diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/post_inline_additional_properties_payload_request_array_data_inner.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/post_inline_additional_properties_payload_request_array_data_inner.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/post_inline_additional_properties_payload_request_array_data_inner.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/post_inline_additional_properties_payload_request_array_data_inner.py diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/publish_options.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/publish_options.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/publish_options.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/publish_options.py diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/publish_options_publish.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/publish_options_publish.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/publish_options_publish.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/publish_options_publish.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/quadrilateral.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/quadrilateral.py new file mode 100644 index 000000000000..ddb76e43e806 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/quadrilateral.py @@ -0,0 +1,332 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral + from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral + globals()['ComplexQuadrilateral'] = ComplexQuadrilateral + globals()['SimpleQuadrilateral'] = SimpleQuadrilateral + + +class Quadrilateral(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'quadrilateral_type': (str,), # noqa: E501 + 'shape_type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + lazy_import() + val = { + 'ComplexQuadrilateral': ComplexQuadrilateral, + 'SimpleQuadrilateral': SimpleQuadrilateral, + } + if not val: + return None + return {'quadrilateral_type': val} + + attribute_map = { + 'quadrilateral_type': 'quadrilateralType', # noqa: E501 + 'shape_type': 'shapeType', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Quadrilateral - a model defined in OpenAPI + + Keyword Args: + quadrilateral_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + shape_type (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Quadrilateral - a model defined in OpenAPI + + Keyword Args: + quadrilateral_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + shape_type (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ], + 'oneOf': [ + ComplexQuadrilateral, + SimpleQuadrilateral, + ], + } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/quadrilateral_interface.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/quadrilateral_interface.py new file mode 100644 index 000000000000..9f61569c9c04 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/quadrilateral_interface.py @@ -0,0 +1,269 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class QuadrilateralInterface(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'quadrilateral_type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'quadrilateral_type': 'quadrilateralType', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, quadrilateral_type, *args, **kwargs): # noqa: E501 + """QuadrilateralInterface - a model defined in OpenAPI + + Args: + quadrilateral_type (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.quadrilateral_type = quadrilateral_type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, quadrilateral_type, *args, **kwargs): # noqa: E501 + """QuadrilateralInterface - a model defined in OpenAPI + + Args: + quadrilateral_type (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.quadrilateral_type = quadrilateral_type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/read_only_first.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/read_only_first.py new file mode 100644 index 000000000000..965325c2864d --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/read_only_first.py @@ -0,0 +1,268 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class ReadOnlyFirst(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'bar': (str,), # noqa: E501 + 'baz': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'bar': 'bar', # noqa: E501 + 'baz': 'baz', # noqa: E501 + } + + read_only_vars = { + 'bar', # noqa: E501 + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ReadOnlyFirst - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bar (str): [optional] # noqa: E501 + baz (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ReadOnlyFirst - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bar (str): [optional] # noqa: E501 + baz (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/readonly.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/readonly.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/readonly.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/readonly.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/scalene_triangle.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/scalene_triangle.py new file mode 100644 index 000000000000..6a7bfe81bd82 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/scalene_triangle.py @@ -0,0 +1,326 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.shape_interface import ShapeInterface + from petstore_api.model.triangle_interface import TriangleInterface + globals()['ShapeInterface'] = ShapeInterface + globals()['TriangleInterface'] = TriangleInterface + + +class ScaleneTriangle(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'shape_type': (str,), # noqa: E501 + 'triangle_type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'shape_type': 'shapeType', # noqa: E501 + 'triangle_type': 'triangleType', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ScaleneTriangle - a model defined in OpenAPI + + Keyword Args: + shape_type (str): + triangle_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ScaleneTriangle - a model defined in OpenAPI + + Keyword Args: + shape_type (str): + triangle_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ShapeInterface, + TriangleInterface, + ], + 'oneOf': [ + ], + } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/shape.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/shape.py new file mode 100644 index 000000000000..025657240278 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/shape.py @@ -0,0 +1,336 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.quadrilateral import Quadrilateral + from petstore_api.model.triangle import Triangle + globals()['Quadrilateral'] = Quadrilateral + globals()['Triangle'] = Triangle + + +class Shape(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'shape_type': (str,), # noqa: E501 + 'quadrilateral_type': (str,), # noqa: E501 + 'triangle_type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + lazy_import() + val = { + 'Quadrilateral': Quadrilateral, + 'Triangle': Triangle, + } + if not val: + return None + return {'shape_type': val} + + attribute_map = { + 'shape_type': 'shapeType', # noqa: E501 + 'quadrilateral_type': 'quadrilateralType', # noqa: E501 + 'triangle_type': 'triangleType', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Shape - a model defined in OpenAPI + + Keyword Args: + shape_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + quadrilateral_type (str): [optional] # noqa: E501 + triangle_type (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Shape - a model defined in OpenAPI + + Keyword Args: + shape_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + quadrilateral_type (str): [optional] # noqa: E501 + triangle_type (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ], + 'oneOf': [ + Quadrilateral, + Triangle, + ], + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/shape_interface.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/shape_interface.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/shape_interface.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/shape_interface.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/shape_or_null.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/shape_or_null.py new file mode 100644 index 000000000000..28bd8ecd4b5a --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/shape_or_null.py @@ -0,0 +1,337 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.quadrilateral import Quadrilateral + from petstore_api.model.triangle import Triangle + globals()['Quadrilateral'] = Quadrilateral + globals()['Triangle'] = Triangle + + +class ShapeOrNull(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'shape_type': (str,), # noqa: E501 + 'quadrilateral_type': (str,), # noqa: E501 + 'triangle_type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + lazy_import() + val = { + 'Quadrilateral': Quadrilateral, + 'Triangle': Triangle, + } + if not val: + return None + return {'shape_type': val} + + attribute_map = { + 'shape_type': 'shapeType', # noqa: E501 + 'quadrilateral_type': 'quadrilateralType', # noqa: E501 + 'triangle_type': 'triangleType', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ShapeOrNull - a model defined in OpenAPI + + Keyword Args: + shape_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + quadrilateral_type (str): [optional] # noqa: E501 + triangle_type (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ShapeOrNull - a model defined in OpenAPI + + Keyword Args: + shape_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + quadrilateral_type (str): [optional] # noqa: E501 + triangle_type (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ], + 'oneOf': [ + Quadrilateral, + Triangle, + none_type, + ], + } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/simple_quadrilateral.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/simple_quadrilateral.py new file mode 100644 index 000000000000..7c342851203f --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/simple_quadrilateral.py @@ -0,0 +1,326 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.quadrilateral_interface import QuadrilateralInterface + from petstore_api.model.shape_interface import ShapeInterface + globals()['QuadrilateralInterface'] = QuadrilateralInterface + globals()['ShapeInterface'] = ShapeInterface + + +class SimpleQuadrilateral(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'shape_type': (str,), # noqa: E501 + 'quadrilateral_type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'shape_type': 'shapeType', # noqa: E501 + 'quadrilateral_type': 'quadrilateralType', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SimpleQuadrilateral - a model defined in OpenAPI + + Keyword Args: + shape_type (str): + quadrilateral_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """SimpleQuadrilateral - a model defined in OpenAPI + + Keyword Args: + shape_type (str): + quadrilateral_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + QuadrilateralInterface, + ShapeInterface, + ], + 'oneOf': [ + ], + } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/some_object.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/some_object.py new file mode 100644 index 000000000000..cee41c9aa7f1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/some_object.py @@ -0,0 +1,315 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.object_interface import ObjectInterface + globals()['ObjectInterface'] = ObjectInterface + + +class SomeObject(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SomeObject - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """SomeObject - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ObjectInterface, + ], + 'oneOf': [ + ], + } diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/some_object_with_self_attr.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/some_object_with_self_attr.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/some_object_with_self_attr.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/some_object_with_self_attr.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/special_model_name.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/special_model_name.py new file mode 100644 index 000000000000..6044e5e10084 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/special_model_name.py @@ -0,0 +1,263 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class SpecialModelName(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'special_property_name': (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'special_property_name': '$special[property.name]', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SpecialModelName - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + special_property_name (int): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """SpecialModelName - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + special_property_name (int): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/stream_options.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/stream_options.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model/stream_options.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model/stream_options.py diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/string_boolean_map.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/string_boolean_map.py new file mode 100644 index 000000000000..52b6f39964bd --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/string_boolean_map.py @@ -0,0 +1,259 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class StringBooleanMap(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """StringBooleanMap - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """StringBooleanMap - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/string_enum.py new file mode 100644 index 000000000000..0fbdcdc6af33 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/string_enum.py @@ -0,0 +1,305 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class StringEnum(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'None': None, + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + 'SINGLE_QUOTED': "single quoted", + 'MULTIPLE_LINES': '''multiple +lines''', + 'DOUBLE_QUOTE_WITH_NEWLINE': '''double quote + with newline''', + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """StringEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["placed", "approved", "delivered", "single quoted", '''multiple +lines''', '''double quote + with newline''', ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["placed", "approved", "delivered", "single quoted", '''multiple +lines''', '''double quote + with newline''', ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """StringEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["placed", "approved", "delivered", "single quoted", '''multiple +lines''', '''double quote + with newline''', ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["placed", "approved", "delivered", "single quoted", '''multiple +lines''', '''double quote + with newline''', ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/string_enum_with_default_value.py new file mode 100644 index 000000000000..37775c93ca08 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/string_enum_with_default_value.py @@ -0,0 +1,283 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class StringEnumWithDefaultValue(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """StringEnumWithDefaultValue - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): if omitted defaults to "placed", must be one of ["placed", "approved", "delivered", ] # noqa: E501 + + Keyword Args: + value (str): if omitted defaults to "placed", must be one of ["placed", "approved", "delivered", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + value = "placed" + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """StringEnumWithDefaultValue - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): if omitted defaults to "placed", must be one of ["placed", "approved", "delivered", ] # noqa: E501 + + Keyword Args: + value (str): if omitted defaults to "placed", must be one of ["placed", "approved", "delivered", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + value = "placed" + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/tag.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/tag.py new file mode 100644 index 000000000000..b56728bb6bda --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/tag.py @@ -0,0 +1,267 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class Tag(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'id': (int,), # noqa: E501 + 'name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'name': 'name', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Tag - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (int): [optional] # noqa: E501 + name (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Tag - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (int): [optional] # noqa: E501 + name (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/triangle.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/triangle.py new file mode 100644 index 000000000000..fd9103c96bd6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/triangle.py @@ -0,0 +1,336 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + +def lazy_import(): + from petstore_api.model.equilateral_triangle import EquilateralTriangle + from petstore_api.model.isosceles_triangle import IsoscelesTriangle + from petstore_api.model.scalene_triangle import ScaleneTriangle + globals()['EquilateralTriangle'] = EquilateralTriangle + globals()['IsoscelesTriangle'] = IsoscelesTriangle + globals()['ScaleneTriangle'] = ScaleneTriangle + + +class Triangle(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'triangle_type': (str,), # noqa: E501 + 'shape_type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + lazy_import() + val = { + 'EquilateralTriangle': EquilateralTriangle, + 'IsoscelesTriangle': IsoscelesTriangle, + 'ScaleneTriangle': ScaleneTriangle, + } + if not val: + return None + return {'triangle_type': val} + + attribute_map = { + 'triangle_type': 'triangleType', # noqa: E501 + 'shape_type': 'shapeType', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Triangle - a model defined in OpenAPI + + Keyword Args: + triangle_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + shape_type (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Triangle - a model defined in OpenAPI + + Keyword Args: + triangle_type (str): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + shape_type (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ], + 'oneOf': [ + EquilateralTriangle, + IsoscelesTriangle, + ScaleneTriangle, + ], + } diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/triangle_interface.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/triangle_interface.py new file mode 100644 index 000000000000..3bb817d86bcc --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/triangle_interface.py @@ -0,0 +1,269 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class TriangleInterface(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'triangle_type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'triangle_type': 'triangleType', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, triangle_type, *args, **kwargs): # noqa: E501 + """TriangleInterface - a model defined in OpenAPI + + Args: + triangle_type (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.triangle_type = triangle_type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, triangle_type, *args, **kwargs): # noqa: E501 + """TriangleInterface - a model defined in OpenAPI + + Args: + triangle_type (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.triangle_type = triangle_type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/user.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/user.py new file mode 100644 index 000000000000..a8056b29a293 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/user.py @@ -0,0 +1,307 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class User(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'id': (int,), # noqa: E501 + 'username': (str,), # noqa: E501 + 'first_name': (str,), # noqa: E501 + 'last_name': (str,), # noqa: E501 + 'email': (str,), # noqa: E501 + 'password': (str,), # noqa: E501 + 'phone': (str,), # noqa: E501 + 'user_status': (int,), # noqa: E501 + 'object_with_no_declared_props': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + 'object_with_no_declared_props_nullable': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + 'any_type_prop': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 + 'any_type_prop_nullable': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'username': 'username', # noqa: E501 + 'first_name': 'firstName', # noqa: E501 + 'last_name': 'lastName', # noqa: E501 + 'email': 'email', # noqa: E501 + 'password': 'password', # noqa: E501 + 'phone': 'phone', # noqa: E501 + 'user_status': 'userStatus', # noqa: E501 + 'object_with_no_declared_props': 'objectWithNoDeclaredProps', # noqa: E501 + 'object_with_no_declared_props_nullable': 'objectWithNoDeclaredPropsNullable', # noqa: E501 + 'any_type_prop': 'anyTypeProp', # noqa: E501 + 'any_type_prop_nullable': 'anyTypePropNullable', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """User - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (int): [optional] # noqa: E501 + username (str): [optional] # noqa: E501 + first_name (str): [optional] # noqa: E501 + last_name (str): [optional] # noqa: E501 + email (str): [optional] # noqa: E501 + password (str): [optional] # noqa: E501 + phone (str): [optional] # noqa: E501 + user_status (int): User Status. [optional] # noqa: E501 + object_with_no_declared_props ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.. [optional] # noqa: E501 + object_with_no_declared_props_nullable ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.. [optional] # noqa: E501 + any_type_prop (bool, date, datetime, dict, float, int, list, str, none_type): test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389. [optional] # noqa: E501 + any_type_prop_nullable (bool, date, datetime, dict, float, int, list, str, none_type): test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """User - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (int): [optional] # noqa: E501 + username (str): [optional] # noqa: E501 + first_name (str): [optional] # noqa: E501 + last_name (str): [optional] # noqa: E501 + email (str): [optional] # noqa: E501 + password (str): [optional] # noqa: E501 + phone (str): [optional] # noqa: E501 + user_status (int): User Status. [optional] # noqa: E501 + object_with_no_declared_props ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.. [optional] # noqa: E501 + object_with_no_declared_props_nullable ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.. [optional] # noqa: E501 + any_type_prop (bool, date, datetime, dict, float, int, list, str, none_type): test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389. [optional] # noqa: E501 + any_type_prop_nullable (bool, date, datetime, dict, float, int, list, str, none_type): test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/whale.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/whale.py new file mode 100644 index 000000000000..7c1a8426712f --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/whale.py @@ -0,0 +1,277 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class Whale(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'class_name': (str,), # noqa: E501 + 'has_baleen': (bool,), # noqa: E501 + 'has_teeth': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'has_baleen': 'hasBaleen', # noqa: E501 + 'has_teeth': 'hasTeeth', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501 + """Whale - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + has_baleen (bool): [optional] # noqa: E501 + has_teeth (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.class_name = class_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, class_name, *args, **kwargs): # noqa: E501 + """Whale - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + has_baleen (bool): [optional] # noqa: E501 + has_teeth (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.class_name = class_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/model/zebra.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model/zebra.py new file mode 100644 index 000000000000..b6d2fe934d52 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/model/zebra.py @@ -0,0 +1,278 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class Zebra(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('type',): { + 'PLAINS': "plains", + 'MOUNTAIN': "mountain", + 'GREVYS': "grevys", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'class_name': (str,), # noqa: E501 + 'type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'type': 'type', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501 + """Zebra - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + type (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.class_name = class_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, class_name, *args, **kwargs): # noqa: E501 + """Zebra - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + type (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.class_name = class_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python-prior/petstore_api/model_utils.py similarity index 100% rename from samples/openapi3/client/petstore/python/petstore_api/model_utils.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/model_utils.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-prior/petstore_api/models/__init__.py similarity index 65% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/models/__init__.py index 0518982ad969..dd8afc1d8bf5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/models/__init__.py @@ -1,5 +1,3 @@ -# coding: utf-8 - # flake8: noqa # import all models into this package @@ -12,51 +10,37 @@ # sys.setrecursionlimit(n) from petstore_api.model.additional_properties_class import AdditionalPropertiesClass -from petstore_api.model.additional_properties_validator import AdditionalPropertiesValidator from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums from petstore_api.model.address import Address from petstore_api.model.animal import Animal from petstore_api.model.animal_farm import AnimalFarm -from petstore_api.model.any_type_and_format import AnyTypeAndFormat -from petstore_api.model.any_type_not_string import AnyTypeNotString from petstore_api.model.api_response import ApiResponse from petstore_api.model.apple import Apple from petstore_api.model.apple_req import AppleReq -from petstore_api.model.array_holding_any_type import ArrayHoldingAnyType from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly from petstore_api.model.array_of_enums import ArrayOfEnums from petstore_api.model.array_of_number_only import ArrayOfNumberOnly from petstore_api.model.array_test import ArrayTest -from petstore_api.model.array_with_validations_in_items import ArrayWithValidationsInItems from petstore_api.model.banana import Banana from petstore_api.model.banana_req import BananaReq -from petstore_api.model.bar import Bar from petstore_api.model.basque_pig import BasquePig -from petstore_api.model.boolean import Boolean from petstore_api.model.boolean_enum import BooleanEnum from petstore_api.model.capitalization import Capitalization from petstore_api.model.cat import Cat +from petstore_api.model.cat_all_of import CatAllOf from petstore_api.model.category import Category from petstore_api.model.child_cat import ChildCat +from petstore_api.model.child_cat_all_of import ChildCatAllOf from petstore_api.model.class_model import ClassModel from petstore_api.model.client import Client from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral -from petstore_api.model.composed_any_of_different_types_no_validations import ComposedAnyOfDifferentTypesNoValidations -from petstore_api.model.composed_array import ComposedArray -from petstore_api.model.composed_bool import ComposedBool -from petstore_api.model.composed_none import ComposedNone -from petstore_api.model.composed_number import ComposedNumber -from petstore_api.model.composed_object import ComposedObject -from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes -from petstore_api.model.composed_string import ComposedString -from petstore_api.model.currency import Currency +from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations +from petstore_api.model.composed_schema_with_props_and_no_add_props import ComposedSchemaWithPropsAndNoAddProps from petstore_api.model.danish_pig import DanishPig -from petstore_api.model.date_time_test import DateTimeTest -from petstore_api.model.date_time_with_validations import DateTimeWithValidations -from petstore_api.model.date_with_validations import DateWithValidations -from petstore_api.model.decimal_payload import DecimalPayload from petstore_api.model.dog import Dog +from petstore_api.model.dog_all_of import DogAllOf from petstore_api.model.drawing import Drawing +from petstore_api.model.egress_threshold_options import EgressThresholdOptions from petstore_api.model.enum_arrays import EnumArrays from petstore_api.model.enum_class import EnumClass from petstore_api.model.enum_test import EnumTest @@ -64,67 +48,64 @@ from petstore_api.model.file import File from petstore_api.model.file_schema_test_class import FileSchemaTestClass from petstore_api.model.foo import Foo +from petstore_api.model.foo_get_default_response import FooGetDefaultResponse +from petstore_api.model.foo_object import FooObject from petstore_api.model.format_test import FormatTest from petstore_api.model.fruit import Fruit from petstore_api.model.fruit_req import FruitReq from petstore_api.model.gm_fruit import GmFruit +from petstore_api.model.gm_fruit_no_properties import GmFruitNoProperties from petstore_api.model.grandparent_animal import GrandparentAnimal from petstore_api.model.has_only_read_only import HasOnlyReadOnly from petstore_api.model.health_check_result import HealthCheckResult +from petstore_api.model.inline_additional_properties_ref_payload import InlineAdditionalPropertiesRefPayload from petstore_api.model.integer_enum import IntegerEnum -from petstore_api.model.integer_enum_big import IntegerEnumBig from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue -from petstore_api.model.integer_max10 import IntegerMax10 -from petstore_api.model.integer_min15 import IntegerMin15 from petstore_api.model.isosceles_triangle import IsoscelesTriangle -from petstore_api.model.json_patch_request import JSONPatchRequest -from petstore_api.model.json_patch_request_add_replace_test import JSONPatchRequestAddReplaceTest -from petstore_api.model.json_patch_request_move_copy import JSONPatchRequestMoveCopy -from petstore_api.model.json_patch_request_remove import JSONPatchRequestRemove +from petstore_api.model.legs import Legs +from petstore_api.model.list import List from petstore_api.model.mammal import Mammal from petstore_api.model.map_test import MapTest from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass from petstore_api.model.model200_response import Model200Response from petstore_api.model.model_return import ModelReturn -from petstore_api.model.money import Money +from petstore_api.model.mole import Mole from petstore_api.model.name import Name -from petstore_api.model.no_additional_properties import NoAdditionalProperties from petstore_api.model.nullable_class import NullableClass from petstore_api.model.nullable_shape import NullableShape -from petstore_api.model.nullable_string import NullableString -from petstore_api.model.number import Number from petstore_api.model.number_only import NumberOnly from petstore_api.model.number_with_validations import NumberWithValidations from petstore_api.model.object_interface import ObjectInterface from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps -from petstore_api.model.object_with_decimal_properties import ObjectWithDecimalProperties -from petstore_api.model.object_with_difficultly_named_props import ObjectWithDifficultlyNamedProps -from petstore_api.model.object_with_inline_composition_property import ObjectWithInlineCompositionProperty from petstore_api.model.object_with_validations import ObjectWithValidations from petstore_api.model.order import Order from petstore_api.model.parent_pet import ParentPet from petstore_api.model.pet import Pet from petstore_api.model.pig import Pig -from petstore_api.model.player import Player +from petstore_api.model.post_inline_additional_properties_payload_request import PostInlineAdditionalPropertiesPayloadRequest +from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner +from petstore_api.model.publish_options import PublishOptions +from petstore_api.model.publish_options_publish import PublishOptionsPublish from petstore_api.model.quadrilateral import Quadrilateral from petstore_api.model.quadrilateral_interface import QuadrilateralInterface from petstore_api.model.read_only_first import ReadOnlyFirst +from petstore_api.model.readonly import Readonly from petstore_api.model.scalene_triangle import ScaleneTriangle from petstore_api.model.shape import Shape +from petstore_api.model.shape_interface import ShapeInterface from petstore_api.model.shape_or_null import ShapeOrNull from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral from petstore_api.model.some_object import SomeObject +from petstore_api.model.some_object_with_self_attr import SomeObjectWithSelfAttr from petstore_api.model.special_model_name import SpecialModelName -from petstore_api.model.string import String +from petstore_api.model.stream_options import StreamOptions from petstore_api.model.string_boolean_map import StringBooleanMap from petstore_api.model.string_enum import StringEnum from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue -from petstore_api.model.string_with_validation import StringWithValidation from petstore_api.model.tag import Tag from petstore_api.model.triangle import Triangle from petstore_api.model.triangle_interface import TriangleInterface -from petstore_api.model.uuid_string import UUIDString from petstore_api.model.user import User from petstore_api.model.whale import Whale from petstore_api.model.zebra import Zebra diff --git a/samples/openapi3/client/petstore/python-prior/petstore_api/rest.py b/samples/openapi3/client/petstore/python-prior/petstore_api/rest.py new file mode 100644 index 000000000000..8ec610c5cc62 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/rest.py @@ -0,0 +1,352 @@ +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 +from urllib.parse import urlencode +from urllib.parse import urlparse +from urllib.request import proxy_bypass_environment +import urllib3 +import ipaddress + +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 and not should_bypass_proxies( + configuration.host, no_proxy=configuration.no_proxy or ''): + 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 {} + + 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']: + # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests + if (method != 'DELETE') and ('Content-Type' not in headers): + headers['Content-Type'] = 'application/json' + if query_params: + url += '?' + urlencode(query_params) + if ('Content-Type' not in headers) 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=query_params, + 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(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(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(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(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(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(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(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) + +# end of class RESTClientObject + + +def is_ipv4(target): + """ Test if IPv4 address or not + """ + try: + chk = ipaddress.IPv4Address(target) + return True + except ipaddress.AddressValueError: + return False + + +def in_ipv4net(target, net): + """ Test if target belongs to given IPv4 network + """ + try: + nw = ipaddress.IPv4Network(net) + ip = ipaddress.IPv4Address(target) + if ip in nw: + return True + return False + except ipaddress.AddressValueError: + return False + except ipaddress.NetmaskValueError: + return False + + +def should_bypass_proxies(url, no_proxy=None): + """ Yet another requests.should_bypass_proxies + Test if proxies should not be used for a particular url. + """ + + parsed = urlparse(url) + + # special cases + if parsed.hostname in [None, '']: + return True + + # special cases + if no_proxy in [None, '']: + return False + if no_proxy == '*': + return True + + no_proxy = no_proxy.lower().replace(' ', ''); + entries = ( + host for host in no_proxy.split(',') if host + ) + + if is_ipv4(parsed.hostname): + for item in entries: + if in_ipv4net(parsed.hostname, item): + return True + return proxy_bypass_environment(parsed.hostname, {'no': no_proxy}) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py b/samples/openapi3/client/petstore/python-prior/petstore_api/signing.py similarity index 99% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py rename to samples/openapi3/client/petstore/python-prior/petstore_api/signing.py index 22b3bf2bf1d4..4ea7d8f779eb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py +++ b/samples/openapi3/client/petstore/python-prior/petstore_api/signing.py @@ -1,4 +1,3 @@ -# coding: utf-8 """ OpenAPI Petstore @@ -8,6 +7,7 @@ Generated by: https://openapi-generator.tech """ + from base64 import b64encode from Crypto.IO import PEM, PKCS8 from Crypto.Hash import SHA256, SHA512 @@ -341,7 +341,7 @@ def _get_message_digest(self, data): :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 cryptographc hash. It is used + 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: diff --git a/samples/openapi3/client/petstore/python-experimental/pom.xml b/samples/openapi3/client/petstore/python-prior/pom.xml similarity index 92% rename from samples/openapi3/client/petstore/python-experimental/pom.xml rename to samples/openapi3/client/petstore/python-prior/pom.xml index 7e737c361115..e7d7d9caf133 100644 --- a/samples/openapi3/client/petstore/python-experimental/pom.xml +++ b/samples/openapi3/client/petstore/python-prior/pom.xml @@ -1,10 +1,10 @@ 4.0.0 org.openapitools - PythonExperimentalOAS3PetstoreTests + PythonOAS3PetstoreTests pom 1.0-SNAPSHOT - Python Experimental OpenAPI3 Petstore Client + Python OpenAPI3 Petstore Client @@ -43,4 +43,4 @@ - \ No newline at end of file + diff --git a/samples/openapi3/client/petstore/python-prior/requirements.txt b/samples/openapi3/client/petstore/python-prior/requirements.txt new file mode 100644 index 000000000000..96947f60408f --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/requirements.txt @@ -0,0 +1,3 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3 diff --git a/samples/openapi3/client/petstore/python-experimental/setup.cfg b/samples/openapi3/client/petstore/python-prior/setup.cfg similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/setup.cfg rename to samples/openapi3/client/petstore/python-prior/setup.cfg diff --git a/samples/openapi3/client/petstore/python-experimental/setup.py b/samples/openapi3/client/petstore/python-prior/setup.py similarity index 90% rename from samples/openapi3/client/petstore/python-experimental/setup.py rename to samples/openapi3/client/petstore/python-prior/setup.py index 2acc6c1cf2ba..0fdf98480629 100644 --- a/samples/openapi3/client/petstore/python-experimental/setup.py +++ b/samples/openapi3/client/petstore/python-prior/setup.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ OpenAPI Petstore @@ -9,6 +7,7 @@ Generated by: https://openapi-generator.tech """ + from setuptools import setup, find_packages # noqa: H301 NAME = "petstore-api" @@ -21,13 +20,10 @@ # http://pypi.python.org/pypi/setuptools REQUIRES = [ - "urllib3 >= 1.15", - "certifi", + "urllib3 >= 1.25.3", "python-dateutil", - "frozendict >= 2.0.3", "pem>=19.3.0", "pycryptodome>=3.9.0", - "typing_extensions", ] setup( @@ -38,7 +34,7 @@ author_email="team@openapitools.org", url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], - python_requires=">=3.7", + python_requires=">=3.6", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, diff --git a/samples/openapi3/client/petstore/python-prior/test-requirements.txt b/samples/openapi3/client/petstore/python-prior/test-requirements.txt new file mode 100644 index 000000000000..4b3736d983e6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/test-requirements.txt @@ -0,0 +1,2 @@ +pytest-cov>=2.8.1 +pycryptodome>=3.9.0 diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake/__init__.py b/samples/openapi3/client/petstore/python-prior/test/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake/__init__.py rename to samples/openapi3/client/petstore/python-prior/test/__init__.py diff --git a/samples/openapi3/client/petstore/python/test/test_additional_properties_class.py b/samples/openapi3/client/petstore/python-prior/test/test_additional_properties_class.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_additional_properties_class.py rename to samples/openapi3/client/petstore/python-prior/test/test_additional_properties_class.py diff --git a/samples/openapi3/client/petstore/python/test/test_additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-prior/test/test_additional_properties_with_array_of_enums.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_additional_properties_with_array_of_enums.py rename to samples/openapi3/client/petstore/python-prior/test/test_additional_properties_with_array_of_enums.py diff --git a/samples/openapi3/client/petstore/python/test/test_address.py b/samples/openapi3/client/petstore/python-prior/test/test_address.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_address.py rename to samples/openapi3/client/petstore/python-prior/test/test_address.py diff --git a/samples/openapi3/client/petstore/python/test/test_animal.py b/samples/openapi3/client/petstore/python-prior/test/test_animal.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_animal.py rename to samples/openapi3/client/petstore/python-prior/test/test_animal.py diff --git a/samples/openapi3/client/petstore/python/test/test_animal_farm.py b/samples/openapi3/client/petstore/python-prior/test/test_animal_farm.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_animal_farm.py rename to samples/openapi3/client/petstore/python-prior/test/test_animal_farm.py diff --git a/samples/openapi3/client/petstore/python/test/test_another_fake_api.py b/samples/openapi3/client/petstore/python-prior/test/test_another_fake_api.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_another_fake_api.py rename to samples/openapi3/client/petstore/python-prior/test/test_another_fake_api.py diff --git a/samples/openapi3/client/petstore/python/test/test_api_response.py b/samples/openapi3/client/petstore/python-prior/test/test_api_response.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_api_response.py rename to samples/openapi3/client/petstore/python-prior/test/test_api_response.py diff --git a/samples/openapi3/client/petstore/python/test/test_apple.py b/samples/openapi3/client/petstore/python-prior/test/test_apple.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_apple.py rename to samples/openapi3/client/petstore/python-prior/test/test_apple.py diff --git a/samples/openapi3/client/petstore/python/test/test_apple_req.py b/samples/openapi3/client/petstore/python-prior/test/test_apple_req.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_apple_req.py rename to samples/openapi3/client/petstore/python-prior/test/test_apple_req.py diff --git a/samples/openapi3/client/petstore/python/test/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-prior/test/test_array_of_array_of_number_only.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_array_of_array_of_number_only.py rename to samples/openapi3/client/petstore/python-prior/test/test_array_of_array_of_number_only.py diff --git a/samples/openapi3/client/petstore/python/test/test_array_of_enums.py b/samples/openapi3/client/petstore/python-prior/test/test_array_of_enums.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_array_of_enums.py rename to samples/openapi3/client/petstore/python-prior/test/test_array_of_enums.py diff --git a/samples/openapi3/client/petstore/python/test/test_array_of_number_only.py b/samples/openapi3/client/petstore/python-prior/test/test_array_of_number_only.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_array_of_number_only.py rename to samples/openapi3/client/petstore/python-prior/test/test_array_of_number_only.py diff --git a/samples/openapi3/client/petstore/python/test/test_array_test.py b/samples/openapi3/client/petstore/python-prior/test/test_array_test.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_array_test.py rename to samples/openapi3/client/petstore/python-prior/test/test_array_test.py diff --git a/samples/openapi3/client/petstore/python/test/test_banana.py b/samples/openapi3/client/petstore/python-prior/test/test_banana.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_banana.py rename to samples/openapi3/client/petstore/python-prior/test/test_banana.py diff --git a/samples/openapi3/client/petstore/python/test/test_banana_req.py b/samples/openapi3/client/petstore/python-prior/test/test_banana_req.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_banana_req.py rename to samples/openapi3/client/petstore/python-prior/test/test_banana_req.py diff --git a/samples/openapi3/client/petstore/python/test/test_basque_pig.py b/samples/openapi3/client/petstore/python-prior/test/test_basque_pig.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_basque_pig.py rename to samples/openapi3/client/petstore/python-prior/test/test_basque_pig.py diff --git a/samples/openapi3/client/petstore/python/test/test_boolean_enum.py b/samples/openapi3/client/petstore/python-prior/test/test_boolean_enum.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_boolean_enum.py rename to samples/openapi3/client/petstore/python-prior/test/test_boolean_enum.py diff --git a/samples/openapi3/client/petstore/python/test/test_capitalization.py b/samples/openapi3/client/petstore/python-prior/test/test_capitalization.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_capitalization.py rename to samples/openapi3/client/petstore/python-prior/test/test_capitalization.py diff --git a/samples/openapi3/client/petstore/python/test/test_cat.py b/samples/openapi3/client/petstore/python-prior/test/test_cat.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_cat.py rename to samples/openapi3/client/petstore/python-prior/test/test_cat.py diff --git a/samples/openapi3/client/petstore/python/test/test_cat_all_of.py b/samples/openapi3/client/petstore/python-prior/test/test_cat_all_of.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_cat_all_of.py rename to samples/openapi3/client/petstore/python-prior/test/test_cat_all_of.py diff --git a/samples/openapi3/client/petstore/python/test/test_category.py b/samples/openapi3/client/petstore/python-prior/test/test_category.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_category.py rename to samples/openapi3/client/petstore/python-prior/test/test_category.py diff --git a/samples/openapi3/client/petstore/python/test/test_child_cat.py b/samples/openapi3/client/petstore/python-prior/test/test_child_cat.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_child_cat.py rename to samples/openapi3/client/petstore/python-prior/test/test_child_cat.py diff --git a/samples/openapi3/client/petstore/python/test/test_child_cat_all_of.py b/samples/openapi3/client/petstore/python-prior/test/test_child_cat_all_of.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_child_cat_all_of.py rename to samples/openapi3/client/petstore/python-prior/test/test_child_cat_all_of.py diff --git a/samples/openapi3/client/petstore/python/test/test_class_model.py b/samples/openapi3/client/petstore/python-prior/test/test_class_model.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_class_model.py rename to samples/openapi3/client/petstore/python-prior/test/test_class_model.py diff --git a/samples/openapi3/client/petstore/python/test/test_client.py b/samples/openapi3/client/petstore/python-prior/test/test_client.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_client.py rename to samples/openapi3/client/petstore/python-prior/test/test_client.py diff --git a/samples/openapi3/client/petstore/python/test/test_complex_quadrilateral.py b/samples/openapi3/client/petstore/python-prior/test/test_complex_quadrilateral.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_complex_quadrilateral.py rename to samples/openapi3/client/petstore/python-prior/test/test_complex_quadrilateral.py diff --git a/samples/openapi3/client/petstore/python/test/test_composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python-prior/test/test_composed_one_of_number_with_validations.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_composed_one_of_number_with_validations.py rename to samples/openapi3/client/petstore/python-prior/test/test_composed_one_of_number_with_validations.py diff --git a/samples/openapi3/client/petstore/python/test/test_composed_schema_with_props_and_no_add_props.py b/samples/openapi3/client/petstore/python-prior/test/test_composed_schema_with_props_and_no_add_props.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_composed_schema_with_props_and_no_add_props.py rename to samples/openapi3/client/petstore/python-prior/test/test_composed_schema_with_props_and_no_add_props.py diff --git a/samples/openapi3/client/petstore/python/test/test_danish_pig.py b/samples/openapi3/client/petstore/python-prior/test/test_danish_pig.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_danish_pig.py rename to samples/openapi3/client/petstore/python-prior/test/test_danish_pig.py diff --git a/samples/openapi3/client/petstore/python/test/test_default_api.py b/samples/openapi3/client/petstore/python-prior/test/test_default_api.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_default_api.py rename to samples/openapi3/client/petstore/python-prior/test/test_default_api.py diff --git a/samples/openapi3/client/petstore/python/test/test_dog.py b/samples/openapi3/client/petstore/python-prior/test/test_dog.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_dog.py rename to samples/openapi3/client/petstore/python-prior/test/test_dog.py diff --git a/samples/openapi3/client/petstore/python/test/test_dog_all_of.py b/samples/openapi3/client/petstore/python-prior/test/test_dog_all_of.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_dog_all_of.py rename to samples/openapi3/client/petstore/python-prior/test/test_dog_all_of.py diff --git a/samples/openapi3/client/petstore/python/test/test_drawing.py b/samples/openapi3/client/petstore/python-prior/test/test_drawing.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_drawing.py rename to samples/openapi3/client/petstore/python-prior/test/test_drawing.py diff --git a/samples/openapi3/client/petstore/python/test/test_egress_threshold_options.py b/samples/openapi3/client/petstore/python-prior/test/test_egress_threshold_options.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_egress_threshold_options.py rename to samples/openapi3/client/petstore/python-prior/test/test_egress_threshold_options.py diff --git a/samples/openapi3/client/petstore/python/test/test_enum_arrays.py b/samples/openapi3/client/petstore/python-prior/test/test_enum_arrays.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_enum_arrays.py rename to samples/openapi3/client/petstore/python-prior/test/test_enum_arrays.py diff --git a/samples/openapi3/client/petstore/python/test/test_enum_class.py b/samples/openapi3/client/petstore/python-prior/test/test_enum_class.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_enum_class.py rename to samples/openapi3/client/petstore/python-prior/test/test_enum_class.py diff --git a/samples/openapi3/client/petstore/python/test/test_enum_test.py b/samples/openapi3/client/petstore/python-prior/test/test_enum_test.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_enum_test.py rename to samples/openapi3/client/petstore/python-prior/test/test_enum_test.py diff --git a/samples/openapi3/client/petstore/python/test/test_equilateral_triangle.py b/samples/openapi3/client/petstore/python-prior/test/test_equilateral_triangle.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_equilateral_triangle.py rename to samples/openapi3/client/petstore/python-prior/test/test_equilateral_triangle.py diff --git a/samples/openapi3/client/petstore/python/test/test_fake_api.py b/samples/openapi3/client/petstore/python-prior/test/test_fake_api.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_fake_api.py rename to samples/openapi3/client/petstore/python-prior/test/test_fake_api.py diff --git a/samples/openapi3/client/petstore/python/test/test_fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-prior/test/test_fake_classname_tags123_api.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_fake_classname_tags123_api.py rename to samples/openapi3/client/petstore/python-prior/test/test_fake_classname_tags123_api.py diff --git a/samples/openapi3/client/petstore/python/test/test_fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-prior/test/test_fake_classname_tags_123_api.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_fake_classname_tags_123_api.py rename to samples/openapi3/client/petstore/python-prior/test/test_fake_classname_tags_123_api.py diff --git a/samples/openapi3/client/petstore/python/test/test_fake_post_inline_additional_properties_payload_array_data.py b/samples/openapi3/client/petstore/python-prior/test/test_fake_post_inline_additional_properties_payload_array_data.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_fake_post_inline_additional_properties_payload_array_data.py rename to samples/openapi3/client/petstore/python-prior/test/test_fake_post_inline_additional_properties_payload_array_data.py diff --git a/samples/openapi3/client/petstore/python/test/test_file.py b/samples/openapi3/client/petstore/python-prior/test/test_file.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_file.py rename to samples/openapi3/client/petstore/python-prior/test/test_file.py diff --git a/samples/openapi3/client/petstore/python/test/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python-prior/test/test_file_schema_test_class.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_file_schema_test_class.py rename to samples/openapi3/client/petstore/python-prior/test/test_file_schema_test_class.py diff --git a/samples/openapi3/client/petstore/python/test/test_foo.py b/samples/openapi3/client/petstore/python-prior/test/test_foo.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_foo.py rename to samples/openapi3/client/petstore/python-prior/test/test_foo.py diff --git a/samples/openapi3/client/petstore/python/test/test_foo_get_default_response.py b/samples/openapi3/client/petstore/python-prior/test/test_foo_get_default_response.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_foo_get_default_response.py rename to samples/openapi3/client/petstore/python-prior/test/test_foo_get_default_response.py diff --git a/samples/openapi3/client/petstore/python/test/test_foo_object.py b/samples/openapi3/client/petstore/python-prior/test/test_foo_object.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_foo_object.py rename to samples/openapi3/client/petstore/python-prior/test/test_foo_object.py diff --git a/samples/openapi3/client/petstore/python/test/test_format_test.py b/samples/openapi3/client/petstore/python-prior/test/test_format_test.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_format_test.py rename to samples/openapi3/client/petstore/python-prior/test/test_format_test.py diff --git a/samples/openapi3/client/petstore/python/test/test_fruit.py b/samples/openapi3/client/petstore/python-prior/test/test_fruit.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_fruit.py rename to samples/openapi3/client/petstore/python-prior/test/test_fruit.py diff --git a/samples/openapi3/client/petstore/python/test/test_fruit_req.py b/samples/openapi3/client/petstore/python-prior/test/test_fruit_req.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_fruit_req.py rename to samples/openapi3/client/petstore/python-prior/test/test_fruit_req.py diff --git a/samples/openapi3/client/petstore/python/test/test_gm_fruit.py b/samples/openapi3/client/petstore/python-prior/test/test_gm_fruit.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_gm_fruit.py rename to samples/openapi3/client/petstore/python-prior/test/test_gm_fruit.py diff --git a/samples/openapi3/client/petstore/python/test/test_gm_fruit_no_properties.py b/samples/openapi3/client/petstore/python-prior/test/test_gm_fruit_no_properties.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_gm_fruit_no_properties.py rename to samples/openapi3/client/petstore/python-prior/test/test_gm_fruit_no_properties.py diff --git a/samples/openapi3/client/petstore/python/test/test_grandparent_animal.py b/samples/openapi3/client/petstore/python-prior/test/test_grandparent_animal.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_grandparent_animal.py rename to samples/openapi3/client/petstore/python-prior/test/test_grandparent_animal.py diff --git a/samples/openapi3/client/petstore/python/test/test_has_only_read_only.py b/samples/openapi3/client/petstore/python-prior/test/test_has_only_read_only.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_has_only_read_only.py rename to samples/openapi3/client/petstore/python-prior/test/test_has_only_read_only.py diff --git a/samples/openapi3/client/petstore/python/test/test_health_check_result.py b/samples/openapi3/client/petstore/python-prior/test/test_health_check_result.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_health_check_result.py rename to samples/openapi3/client/petstore/python-prior/test/test_health_check_result.py diff --git a/samples/openapi3/client/petstore/python/test/test_inline_additional_properties_ref_payload.py b/samples/openapi3/client/petstore/python-prior/test/test_inline_additional_properties_ref_payload.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_inline_additional_properties_ref_payload.py rename to samples/openapi3/client/petstore/python-prior/test/test_inline_additional_properties_ref_payload.py diff --git a/samples/openapi3/client/petstore/python/test/test_inline_object6.py b/samples/openapi3/client/petstore/python-prior/test/test_inline_object6.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_inline_object6.py rename to samples/openapi3/client/petstore/python-prior/test/test_inline_object6.py diff --git a/samples/openapi3/client/petstore/python/test/test_inline_response_default.py b/samples/openapi3/client/petstore/python-prior/test/test_inline_response_default.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_inline_response_default.py rename to samples/openapi3/client/petstore/python-prior/test/test_inline_response_default.py diff --git a/samples/openapi3/client/petstore/python/test/test_integer_enum.py b/samples/openapi3/client/petstore/python-prior/test/test_integer_enum.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_integer_enum.py rename to samples/openapi3/client/petstore/python-prior/test/test_integer_enum.py diff --git a/samples/openapi3/client/petstore/python/test/test_integer_enum_one_value.py b/samples/openapi3/client/petstore/python-prior/test/test_integer_enum_one_value.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_integer_enum_one_value.py rename to samples/openapi3/client/petstore/python-prior/test/test_integer_enum_one_value.py diff --git a/samples/openapi3/client/petstore/python/test/test_integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-prior/test/test_integer_enum_with_default_value.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_integer_enum_with_default_value.py rename to samples/openapi3/client/petstore/python-prior/test/test_integer_enum_with_default_value.py diff --git a/samples/openapi3/client/petstore/python/test/test_isosceles_triangle.py b/samples/openapi3/client/petstore/python-prior/test/test_isosceles_triangle.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_isosceles_triangle.py rename to samples/openapi3/client/petstore/python-prior/test/test_isosceles_triangle.py diff --git a/samples/openapi3/client/petstore/python/test/test_legs.py b/samples/openapi3/client/petstore/python-prior/test/test_legs.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_legs.py rename to samples/openapi3/client/petstore/python-prior/test/test_legs.py diff --git a/samples/openapi3/client/petstore/python/test/test_list.py b/samples/openapi3/client/petstore/python-prior/test/test_list.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_list.py rename to samples/openapi3/client/petstore/python-prior/test/test_list.py diff --git a/samples/openapi3/client/petstore/python/test/test_mammal.py b/samples/openapi3/client/petstore/python-prior/test/test_mammal.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_mammal.py rename to samples/openapi3/client/petstore/python-prior/test/test_mammal.py diff --git a/samples/openapi3/client/petstore/python/test/test_map_test.py b/samples/openapi3/client/petstore/python-prior/test/test_map_test.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_map_test.py rename to samples/openapi3/client/petstore/python-prior/test/test_map_test.py diff --git a/samples/openapi3/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-prior/test/test_mixed_properties_and_additional_properties_class.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py rename to samples/openapi3/client/petstore/python-prior/test/test_mixed_properties_and_additional_properties_class.py diff --git a/samples/openapi3/client/petstore/python/test/test_model200_response.py b/samples/openapi3/client/petstore/python-prior/test/test_model200_response.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_model200_response.py rename to samples/openapi3/client/petstore/python-prior/test/test_model200_response.py diff --git a/samples/openapi3/client/petstore/python/test/test_model_200_response.py b/samples/openapi3/client/petstore/python-prior/test/test_model_200_response.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_model_200_response.py rename to samples/openapi3/client/petstore/python-prior/test/test_model_200_response.py diff --git a/samples/openapi3/client/petstore/python/test/test_model_return.py b/samples/openapi3/client/petstore/python-prior/test/test_model_return.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_model_return.py rename to samples/openapi3/client/petstore/python-prior/test/test_model_return.py diff --git a/samples/openapi3/client/petstore/python/test/test_mole.py b/samples/openapi3/client/petstore/python-prior/test/test_mole.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_mole.py rename to samples/openapi3/client/petstore/python-prior/test/test_mole.py diff --git a/samples/openapi3/client/petstore/python/test/test_name.py b/samples/openapi3/client/petstore/python-prior/test/test_name.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_name.py rename to samples/openapi3/client/petstore/python-prior/test/test_name.py diff --git a/samples/openapi3/client/petstore/python/test/test_nullable_class.py b/samples/openapi3/client/petstore/python-prior/test/test_nullable_class.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_nullable_class.py rename to samples/openapi3/client/petstore/python-prior/test/test_nullable_class.py diff --git a/samples/openapi3/client/petstore/python/test/test_nullable_shape.py b/samples/openapi3/client/petstore/python-prior/test/test_nullable_shape.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_nullable_shape.py rename to samples/openapi3/client/petstore/python-prior/test/test_nullable_shape.py diff --git a/samples/openapi3/client/petstore/python/test/test_number_only.py b/samples/openapi3/client/petstore/python-prior/test/test_number_only.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_number_only.py rename to samples/openapi3/client/petstore/python-prior/test/test_number_only.py diff --git a/samples/openapi3/client/petstore/python/test/test_number_with_validations.py b/samples/openapi3/client/petstore/python-prior/test/test_number_with_validations.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_number_with_validations.py rename to samples/openapi3/client/petstore/python-prior/test/test_number_with_validations.py diff --git a/samples/openapi3/client/petstore/python/test/test_object_interface.py b/samples/openapi3/client/petstore/python-prior/test/test_object_interface.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_object_interface.py rename to samples/openapi3/client/petstore/python-prior/test/test_object_interface.py diff --git a/samples/openapi3/client/petstore/python/test/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-prior/test/test_object_model_with_ref_props.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_object_model_with_ref_props.py rename to samples/openapi3/client/petstore/python-prior/test/test_object_model_with_ref_props.py diff --git a/samples/openapi3/client/petstore/python/test/test_object_with_validations.py b/samples/openapi3/client/petstore/python-prior/test/test_object_with_validations.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_object_with_validations.py rename to samples/openapi3/client/petstore/python-prior/test/test_object_with_validations.py diff --git a/samples/openapi3/client/petstore/python/test/test_order.py b/samples/openapi3/client/petstore/python-prior/test/test_order.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_order.py rename to samples/openapi3/client/petstore/python-prior/test/test_order.py diff --git a/samples/openapi3/client/petstore/python/test/test_parent_pet.py b/samples/openapi3/client/petstore/python-prior/test/test_parent_pet.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_parent_pet.py rename to samples/openapi3/client/petstore/python-prior/test/test_parent_pet.py diff --git a/samples/openapi3/client/petstore/python/test/test_pet.py b/samples/openapi3/client/petstore/python-prior/test/test_pet.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_pet.py rename to samples/openapi3/client/petstore/python-prior/test/test_pet.py diff --git a/samples/openapi3/client/petstore/python/test/test_pet_api.py b/samples/openapi3/client/petstore/python-prior/test/test_pet_api.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_pet_api.py rename to samples/openapi3/client/petstore/python-prior/test/test_pet_api.py diff --git a/samples/openapi3/client/petstore/python/test/test_pig.py b/samples/openapi3/client/petstore/python-prior/test/test_pig.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_pig.py rename to samples/openapi3/client/petstore/python-prior/test/test_pig.py diff --git a/samples/openapi3/client/petstore/python/test/test_post_inline_additional_properties_payload_request.py b/samples/openapi3/client/petstore/python-prior/test/test_post_inline_additional_properties_payload_request.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_post_inline_additional_properties_payload_request.py rename to samples/openapi3/client/petstore/python-prior/test/test_post_inline_additional_properties_payload_request.py diff --git a/samples/openapi3/client/petstore/python/test/test_post_inline_additional_properties_payload_request_array_data_inner.py b/samples/openapi3/client/petstore/python-prior/test/test_post_inline_additional_properties_payload_request_array_data_inner.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_post_inline_additional_properties_payload_request_array_data_inner.py rename to samples/openapi3/client/petstore/python-prior/test/test_post_inline_additional_properties_payload_request_array_data_inner.py diff --git a/samples/openapi3/client/petstore/python/test/test_publish_options.py b/samples/openapi3/client/petstore/python-prior/test/test_publish_options.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_publish_options.py rename to samples/openapi3/client/petstore/python-prior/test/test_publish_options.py diff --git a/samples/openapi3/client/petstore/python/test/test_publish_options_publish.py b/samples/openapi3/client/petstore/python-prior/test/test_publish_options_publish.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_publish_options_publish.py rename to samples/openapi3/client/petstore/python-prior/test/test_publish_options_publish.py diff --git a/samples/openapi3/client/petstore/python/test/test_quadrilateral.py b/samples/openapi3/client/petstore/python-prior/test/test_quadrilateral.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_quadrilateral.py rename to samples/openapi3/client/petstore/python-prior/test/test_quadrilateral.py diff --git a/samples/openapi3/client/petstore/python/test/test_quadrilateral_interface.py b/samples/openapi3/client/petstore/python-prior/test/test_quadrilateral_interface.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_quadrilateral_interface.py rename to samples/openapi3/client/petstore/python-prior/test/test_quadrilateral_interface.py diff --git a/samples/openapi3/client/petstore/python/test/test_read_only_first.py b/samples/openapi3/client/petstore/python-prior/test/test_read_only_first.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_read_only_first.py rename to samples/openapi3/client/petstore/python-prior/test/test_read_only_first.py diff --git a/samples/openapi3/client/petstore/python/test/test_readonly.py b/samples/openapi3/client/petstore/python-prior/test/test_readonly.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_readonly.py rename to samples/openapi3/client/petstore/python-prior/test/test_readonly.py diff --git a/samples/openapi3/client/petstore/python/test/test_scalene_triangle.py b/samples/openapi3/client/petstore/python-prior/test/test_scalene_triangle.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_scalene_triangle.py rename to samples/openapi3/client/petstore/python-prior/test/test_scalene_triangle.py diff --git a/samples/openapi3/client/petstore/python/test/test_shape.py b/samples/openapi3/client/petstore/python-prior/test/test_shape.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_shape.py rename to samples/openapi3/client/petstore/python-prior/test/test_shape.py diff --git a/samples/openapi3/client/petstore/python/test/test_shape_interface.py b/samples/openapi3/client/petstore/python-prior/test/test_shape_interface.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_shape_interface.py rename to samples/openapi3/client/petstore/python-prior/test/test_shape_interface.py diff --git a/samples/openapi3/client/petstore/python/test/test_shape_or_null.py b/samples/openapi3/client/petstore/python-prior/test/test_shape_or_null.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_shape_or_null.py rename to samples/openapi3/client/petstore/python-prior/test/test_shape_or_null.py diff --git a/samples/openapi3/client/petstore/python/test/test_simple_quadrilateral.py b/samples/openapi3/client/petstore/python-prior/test/test_simple_quadrilateral.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_simple_quadrilateral.py rename to samples/openapi3/client/petstore/python-prior/test/test_simple_quadrilateral.py diff --git a/samples/openapi3/client/petstore/python/test/test_some_object.py b/samples/openapi3/client/petstore/python-prior/test/test_some_object.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_some_object.py rename to samples/openapi3/client/petstore/python-prior/test/test_some_object.py diff --git a/samples/openapi3/client/petstore/python/test/test_some_object_with_self_attr.py b/samples/openapi3/client/petstore/python-prior/test/test_some_object_with_self_attr.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_some_object_with_self_attr.py rename to samples/openapi3/client/petstore/python-prior/test/test_some_object_with_self_attr.py diff --git a/samples/openapi3/client/petstore/python/test/test_special_model_name.py b/samples/openapi3/client/petstore/python-prior/test/test_special_model_name.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_special_model_name.py rename to samples/openapi3/client/petstore/python-prior/test/test_special_model_name.py diff --git a/samples/openapi3/client/petstore/python/test/test_store_api.py b/samples/openapi3/client/petstore/python-prior/test/test_store_api.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_store_api.py rename to samples/openapi3/client/petstore/python-prior/test/test_store_api.py diff --git a/samples/openapi3/client/petstore/python/test/test_stream_options.py b/samples/openapi3/client/petstore/python-prior/test/test_stream_options.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_stream_options.py rename to samples/openapi3/client/petstore/python-prior/test/test_stream_options.py diff --git a/samples/openapi3/client/petstore/python/test/test_string_boolean_map.py b/samples/openapi3/client/petstore/python-prior/test/test_string_boolean_map.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_string_boolean_map.py rename to samples/openapi3/client/petstore/python-prior/test/test_string_boolean_map.py diff --git a/samples/openapi3/client/petstore/python/test/test_string_enum.py b/samples/openapi3/client/petstore/python-prior/test/test_string_enum.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_string_enum.py rename to samples/openapi3/client/petstore/python-prior/test/test_string_enum.py diff --git a/samples/openapi3/client/petstore/python/test/test_string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-prior/test/test_string_enum_with_default_value.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_string_enum_with_default_value.py rename to samples/openapi3/client/petstore/python-prior/test/test_string_enum_with_default_value.py diff --git a/samples/openapi3/client/petstore/python/test/test_tag.py b/samples/openapi3/client/petstore/python-prior/test/test_tag.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_tag.py rename to samples/openapi3/client/petstore/python-prior/test/test_tag.py diff --git a/samples/openapi3/client/petstore/python/test/test_triangle.py b/samples/openapi3/client/petstore/python-prior/test/test_triangle.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_triangle.py rename to samples/openapi3/client/petstore/python-prior/test/test_triangle.py diff --git a/samples/openapi3/client/petstore/python/test/test_triangle_interface.py b/samples/openapi3/client/petstore/python-prior/test/test_triangle_interface.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_triangle_interface.py rename to samples/openapi3/client/petstore/python-prior/test/test_triangle_interface.py diff --git a/samples/openapi3/client/petstore/python/test/test_user.py b/samples/openapi3/client/petstore/python-prior/test/test_user.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_user.py rename to samples/openapi3/client/petstore/python-prior/test/test_user.py diff --git a/samples/openapi3/client/petstore/python/test/test_user_api.py b/samples/openapi3/client/petstore/python-prior/test/test_user_api.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_user_api.py rename to samples/openapi3/client/petstore/python-prior/test/test_user_api.py diff --git a/samples/openapi3/client/petstore/python/test/test_whale.py b/samples/openapi3/client/petstore/python-prior/test/test_whale.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_whale.py rename to samples/openapi3/client/petstore/python-prior/test/test_whale.py diff --git a/samples/openapi3/client/petstore/python/test/test_zebra.py b/samples/openapi3/client/petstore/python-prior/test/test_zebra.py similarity index 100% rename from samples/openapi3/client/petstore/python/test/test_zebra.py rename to samples/openapi3/client/petstore/python-prior/test/test_zebra.py diff --git a/samples/openapi3/client/petstore/python-experimental/test_python.sh b/samples/openapi3/client/petstore/python-prior/test_python.sh similarity index 79% rename from samples/openapi3/client/petstore/python-experimental/test_python.sh rename to samples/openapi3/client/petstore/python-prior/test_python.sh index 9728a9b53163..f617f3adfa64 100755 --- a/samples/openapi3/client/petstore/python-experimental/test_python.sh +++ b/samples/openapi3/client/petstore/python-prior/test_python.sh @@ -10,16 +10,14 @@ export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 ### set virtualenv -if [ -z "$VENVV" ]; then - python3 -m venv $VENV +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 -### locally install the package, needed for pycharm problem checking -pip install -e . ### run tests tox || exit 1 diff --git a/samples/openapi3/client/petstore/python-experimental/testfiles/1px_pic1.png b/samples/openapi3/client/petstore/python-prior/testfiles/1px_pic1.png similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/testfiles/1px_pic1.png rename to samples/openapi3/client/petstore/python-prior/testfiles/1px_pic1.png diff --git a/samples/openapi3/client/petstore/python-experimental/testfiles/1px_pic2.png b/samples/openapi3/client/petstore/python-prior/testfiles/1px_pic2.png similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/testfiles/1px_pic2.png rename to samples/openapi3/client/petstore/python-prior/testfiles/1px_pic2.png diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_additional_properties_with_array_of_enums/__init__.py b/samples/openapi3/client/petstore/python-prior/tests_manual/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_additional_properties_with_array_of_enums/__init__.py rename to samples/openapi3/client/petstore/python-prior/tests_manual/__init__.py diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_api_validation.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_api_validation.py similarity index 100% rename from samples/openapi3/client/petstore/python/tests_manual/test_api_validation.py rename to samples/openapi3/client/petstore/python-prior/tests_manual/test_api_validation.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_boolean_enum.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_boolean_enum.py similarity index 77% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_boolean_enum.py rename to samples/openapi3/client/petstore/python-prior/tests_manual/test_boolean_enum.py index 530755c0681b..09f386f23aa1 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_boolean_enum.py +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_boolean_enum.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ OpenAPI Petstore @@ -10,6 +8,7 @@ """ +import sys import unittest import petstore_api @@ -25,13 +24,13 @@ def setUp(self): def tearDown(self): pass - def test_BooleanEnum(self): + def testBooleanEnum(self): """Test BooleanEnum""" model = BooleanEnum(True) - assert model is BooleanEnum.TRUE - assert model.is_true_oapg() - assert model.is_false_oapg() is False - assert repr(model) == '' + assert model.value is True + + assert BooleanEnum.allowed_values[('value',)]['TRUE'] is True + with self.assertRaises(petstore_api.ApiValueError): BooleanEnum(False) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_composed_one_of_number_with_validations.py similarity index 100% rename from samples/openapi3/client/petstore/python/tests_manual/test_composed_one_of_number_with_validations.py rename to samples/openapi3/client/petstore/python-prior/tests_manual/test_composed_one_of_number_with_validations.py diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_composed_schema_with_props_and_no_add_props.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_composed_schema_with_props_and_no_add_props.py similarity index 100% rename from samples/openapi3/client/petstore/python/tests_manual/test_composed_schema_with_props_and_no_add_props.py rename to samples/openapi3/client/petstore/python-prior/tests_manual/test_composed_schema_with_props_and_no_add_props.py diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_copy.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_copy.py similarity index 100% rename from samples/openapi3/client/petstore/python/tests_manual/test_copy.py rename to samples/openapi3/client/petstore/python-prior/tests_manual/test_copy.py diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_deserialization.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_deserialization.py new file mode 100644 index 000000000000..93538160f9a8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_deserialization.py @@ -0,0 +1,327 @@ +# 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 petstore_api +from petstore_api.model import ( + shape, + equilateral_triangle, + animal, + dog, + apple, + mammal, + whale, + zebra, + banana, + fruit_req, + drawing, + banana_req, + number_with_validations, +) + + +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_deserialize_shape(self): + """ + + deserialize Shape to an instance of: + - EquilateralTriangle + - IsoscelesTriangle + - IsoscelesTriangle + - ScaleneTriangle + - ComplexQuadrilateral + - SimpleQuadrilateral + by traveling through 2 discriminators + """ + shape_type, triangle_type = ['Triangle', 'EquilateralTriangle'] + data = { + 'shapeType': shape_type, + 'triangleType': triangle_type, + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, (shape.Shape,), True) + self.assertTrue(isinstance(deserialized, equilateral_triangle.EquilateralTriangle)) + self.assertEqual(deserialized.shape_type, shape_type) + self.assertEqual(deserialized.triangle_type, triangle_type) + + # invalid second discriminator value + shape_type, quadrilateral_type = ['Quadrilateral', 'Triangle'] + data = { + 'shapeType': shape_type, + 'quadrilateralType': quadrilateral_type, + } + response = MockResponse(data=json.dumps(data)) + + err_msg = ("Cannot deserialize input data due to invalid discriminator " + "value. The OpenAPI document has no mapping for discriminator " + "property '{}'='{}' at path: ()" + ) + with self.assertRaisesRegex( + petstore_api.ApiValueError, + err_msg.format("quadrilateralType", "Triangle") + ): + self.deserialize(response, (shape.Shape,), True) + + def test_deserialize_animal(self): + """ + deserialize Animal to a Dog instance + Animal uses a discriminator which has a map built of child classes + that inherrit from Animal + This is the swagger (v2) way of doing something like oneOf composition + """ + class_name = 'Dog' + color = 'white' + breed = 'Jack Russel Terrier' + data = { + 'className': class_name, + 'color': color, + 'breed': breed + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, (animal.Animal,), True) + self.assertTrue(isinstance(deserialized, dog.Dog)) + self.assertEqual(deserialized.class_name, class_name) + self.assertEqual(deserialized.color, color) + self.assertEqual(deserialized.breed, breed) + + def test_regex_constraint(self): + """ + Test regex pattern validation. + """ + + # Test with valid regex pattern. + inst = apple.Apple( + cultivar="Akane" + ) + assert isinstance(inst, apple.Apple) + + # Test with invalid regex pattern in cultivar + err_msg = ("Invalid value for `{}`, must match regular expression `{}`$") + with self.assertRaisesRegex( + petstore_api.ApiValueError, + err_msg.format("cultivar", "[^`]*") + ): + inst = apple.Apple( + cultivar="!@#%@$#Akane" + ) + + # Test with invalid regex pattern in origin + err_msg = ("Invalid value for `{}`, must match regular expression `{}` with flags") + with self.assertRaisesRegex( + petstore_api.ApiValueError, + err_msg.format("origin", "[^`]*") + ): + inst = apple.Apple( + cultivar="Akane", + origin="!@#%@$#Chile" + ) + + def test_deserialize_mammal(self): + """ + deserialize mammal + mammal is a oneOf composed schema model with discriminator + """ + + # whale test + has_baleen = True + has_teeth = False + class_name = 'whale' + data = { + 'hasBaleen': has_baleen, + 'hasTeeth': has_teeth, + 'className': class_name + } + response = MockResponse(data=json.dumps(data)) + deserialized = self.deserialize(response, (mammal.Mammal,), True) + self.assertTrue(isinstance(deserialized, whale.Whale)) + self.assertEqual(deserialized.has_baleen, has_baleen) + self.assertEqual(deserialized.has_teeth, has_teeth) + self.assertEqual(deserialized.class_name, class_name) + + # zebra test + zebra_type = 'plains' + class_name = 'zebra' + data = { + 'type': zebra_type, + 'className': class_name + } + response = MockResponse(data=json.dumps(data)) + deserialized = self.deserialize(response, (mammal.Mammal,), True) + self.assertTrue(isinstance(deserialized, zebra.Zebra)) + self.assertEqual(deserialized.type, zebra_type) + self.assertEqual(deserialized.class_name, class_name) + + def test_deserialize_float_value(self): + """ + Deserialize floating point values. + """ + data = { + 'lengthCm': 3.1415 + } + response = MockResponse(data=json.dumps(data)) + deserialized = self.deserialize(response, (banana.Banana,), True) + self.assertTrue(isinstance(deserialized, banana.Banana)) + self.assertEqual(deserialized.length_cm, 3.1415) + + # Float value is serialized without decimal point + data = { + 'lengthCm': 3 + } + response = MockResponse(data=json.dumps(data)) + deserialized = self.deserialize(response, (banana.Banana,), True) + self.assertTrue(isinstance(deserialized, banana.Banana)) + self.assertEqual(deserialized.length_cm, 3.0) + + def test_deserialize_fruit_null_value(self): + """ + deserialize fruit with null value. + fruitReq is a oneOf composed schema model with discriminator, including 'null' type. + """ + + # Unmarshal 'null' value + data = None + response = MockResponse(data=json.dumps(data)) + deserialized = self.deserialize(response, (fruit_req.FruitReq, type(None)), True) + self.assertEqual(type(deserialized), type(None)) + + inst = fruit_req.FruitReq(None) + self.assertIsNone(inst) + + def test_deserialize_with_additional_properties(self): + """ + Deserialize data with schemas that have the additionalProperties keyword. + Test conditions when additional properties are allowed, not allowed, have + specific types... + """ + + # Dog is allOf with two child schemas. + # The OAS document for Dog does not specify the 'additionalProperties' keyword, + # which means that by default, the Dog schema must allow undeclared properties. + # The additionalProperties keyword is used to control the handling of extra stuff, + # that is, properties whose names are not listed in the properties keyword. + # By default any additional properties are allowed. + data = { + 'className': 'Dog', + 'color': 'brown', + 'breed': 'golden retriever', + # Below are additional, undeclared properties. + 'group': 'Terrier Group', + 'size': 'medium', + } + response = MockResponse(data=json.dumps(data)) + deserialized = self.deserialize(response, (dog.Dog,), True) + self.assertEqual(type(deserialized), dog.Dog) + self.assertEqual(deserialized.class_name, 'Dog') + self.assertEqual(deserialized.breed, 'golden retriever') + + # The 'zebra' schema allows additional properties by explicitly setting + # additionalProperties: true. + # This is equivalent to 'additionalProperties' not being present. + data = { + 'class_name': 'zebra', + 'type': 'plains', + # Below are additional, undeclared properties + 'group': 'abc', + 'size': 3, + 'p1': True, + 'p2': [ 'a', 'b', 123], + } + response = MockResponse(data=json.dumps(data)) + deserialized = self.deserialize(response, (mammal.Mammal,), True) + self.assertEqual(type(deserialized), zebra.Zebra) + self.assertEqual(deserialized.class_name, 'zebra') + self.assertEqual(deserialized.type, 'plains') + self.assertEqual(deserialized.p1, True) + + # The 'bananaReq' schema disallows additional properties by explicitly setting + # additionalProperties: false + err_msg = ("{} has no attribute '{}' at ") + with self.assertRaisesRegex( + petstore_api.exceptions.ApiAttributeError, + err_msg.format("BananaReq", "unknown-group") + ): + data = { + 'lengthCm': 21.2, + 'sweet': False, + # Below are additional, undeclared properties. They are not allowed, + # an exception must be raised. + 'unknown-group': 'abc', + } + response = MockResponse(data=json.dumps(data)) + deserialized = self.deserialize(response, (banana_req.BananaReq,), True) + self.assertEqual(type(deserialized), banana_req.BananaReq) + self.assertEqual(deserialized.lengthCm, 21) + self.assertEqual(deserialized.p1, True) + + def test_deserialize_with_additional_properties_and_reference(self): + """ + Deserialize data with schemas that has the additionalProperties keyword + and the schema is specified as a reference ($ref). + """ + data = { + 'main_shape': { + 'shape_type': 'Triangle', + 'triangle_type': 'EquilateralTriangle', + }, + 'shapes': [ + { + 'shape_type': 'Triangle', + 'triangle_type': 'IsoscelesTriangle', + }, + { + 'shape_type': 'Quadrilateral', + 'quadrilateral_type': 'ComplexQuadrilateral', + }, + ], + } + response = MockResponse(data=json.dumps(data)) + deserialized = self.deserialize(response, (drawing.Drawing,), True) + + def test_deserialize_NumberWithValidations(self): + """ deserialize NumberWithValidations """ + # make sure that an exception is thrown on an invalid type value + with self.assertRaises(petstore_api.ApiTypeError): + self.deserialize( + MockResponse(data=json.dumps("test str")), + (number_with_validations.NumberWithValidations,), + True + ) + + # make sure that an exception is thrown on an invalid value + with self.assertRaises(petstore_api.ApiValueError): + self.deserialize( + MockResponse(data=json.dumps(21.0)), + (number_with_validations.NumberWithValidations,), + True + ) + + # valid value works + number_val = 11.0 + response = MockResponse(data=json.dumps(number_val)) + number = self.deserialize(response, + (number_with_validations.NumberWithValidations,), True) + self.assertTrue(isinstance(number, number_with_validations.NumberWithValidations)) + self.assertTrue(number.value == number_val) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_discard_unknown_properties.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_discard_unknown_properties.py new file mode 100644 index 000000000000..ed1ca736d4ba --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_discard_unknown_properties.py @@ -0,0 +1,173 @@ +# 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 +""" +from collections import namedtuple +import json +import re +import unittest + +import petstore_api +from petstore_api.model import cat, dog, isosceles_triangle, banana_req, fruit_req +from petstore_api import Configuration, signing + +from petstore_api.model_utils import ( + file_type, + model_to_dict, +) + +MockResponse = namedtuple('MockResponse', 'data') + +class DiscardUnknownPropertiesTests(unittest.TestCase): + + def test_deserialize_banana_req_do_not_discard_unknown_properties(self): + """ + deserialize bananaReq with unknown properties. + Strict validation is enabled. + Simple (non-composed) schema scenario. + """ + config = Configuration(discard_unknown_keys=False) + api_client = petstore_api.ApiClient(config) + data = { + 'lengthCm': 21.3, + 'sweet': False, + # Below is an unknown property not explicitly declared in the OpenAPI document. + # It should not be in the payload because additional properties (undeclared) are + # not allowed in the bananaReq schema (additionalProperties: false). + 'unknown_property': 'a-value' + } + response = MockResponse(data=json.dumps(data)) + + # Deserializing with strict validation raises an exception because the 'unknown_property' + # is undeclared. + with self.assertRaises(petstore_api.exceptions.ApiAttributeError) as cm: + deserialized = api_client.deserialize(response, ((banana_req.BananaReq),), True) + self.assertTrue(re.match("BananaReq has no attribute 'unknown_property' at.*", str(cm.exception)), + 'Exception message: {0}'.format(str(cm.exception))) + + + def test_deserialize_fruit_req_do_not_discard_unknown_properties(self): + """ + deserialize FruitReq with unknown properties. + Strict validation is enabled. + Composed schema scenario. + """ + config = Configuration(discard_unknown_keys=False) + api_client = petstore_api.ApiClient(config) + data = { + 'lengthCm': 21.3, + 'sweet': False, + # Below is an unknown property not explicitly declared in the OpenAPI document. + # It should not be in the payload because additional properties (undeclared) are + # not allowed in the schema (additionalProperties: false). + 'unknown_property': 'a-value' + } + response = MockResponse(data=json.dumps(data)) + + # Deserializing with strict validation raises an exception because the 'unknown_property' + # is undeclared. + with self.assertRaisesRegex(petstore_api.ApiValueError, "Invalid inputs given to generate an instance of FruitReq. None of the oneOf schemas matched the input data."): + deserialized = api_client.deserialize(response, ((fruit_req.FruitReq),), True) + + + def test_deserialize_fruit_req_discard_unknown_properties(self): + """ + deserialize FruitReq with unknown properties. + Strict validation is enabled. + Composed schema scenario. + """ + config = Configuration(discard_unknown_keys=True) + api_client = petstore_api.ApiClient(config) + data = { + 'lengthCm': 21.3, + 'sweet': False, + # Below is an unknown property not explicitly declared in the OpenAPI document. + # It should not be in the payload because additional properties (undeclared) are + # not allowed in BananaReq + 'unknown_property': 'a-value' + } + response = MockResponse(data=json.dumps(data)) + deserialized = api_client.deserialize(response, ((fruit_req.FruitReq),), True) + self.assertNotIn("unknown_property", deserialized.to_dict().keys()) + + + def test_deserialize_banana_req_discard_unknown_properties(self): + """ + Deserialize bananaReq with unknown properties. + Discard unknown properties. + """ + config = Configuration(discard_unknown_keys=True) + api_client = petstore_api.ApiClient(config) + data = { + 'lengthCm': 21.3, + 'sweet': False, + # Below are additional (undeclared) properties not specified in the bananaReq schema. + 'unknown_property': 'a-value', + 'more-unknown': [ + 'a' + ] + } + # The 'unknown_property' is undeclared, which would normally raise an exception, but + # when discard_unknown_keys is set to True, the unknown properties are discarded. + response = MockResponse(data=json.dumps(data)) + deserialized = api_client.deserialize(response, ((banana_req.BananaReq),), True) + self.assertTrue(isinstance(deserialized, banana_req.BananaReq)) + # Check the 'unknown_property' and 'more-unknown' properties are not present in the + # output. + self.assertIn("length_cm", deserialized.to_dict().keys()) + self.assertNotIn("unknown_property", deserialized.to_dict().keys()) + self.assertNotIn("more-unknown", deserialized.to_dict().keys()) + + def test_deserialize_cat_do_not_discard_unknown_properties(self): + """ + Deserialize Cat with unknown properties. + Strict validation is enabled. + """ + config = Configuration(discard_unknown_keys=False) + api_client = petstore_api.ApiClient(config) + data = { + "class_name": "Cat", + "color": "black", + "declawed": True, + "dynamic-property": 12345, + } + response = MockResponse(data=json.dumps(data)) + + # Deserializing with strict validation does not raise an exception because the even though + # the 'dynamic-property' is undeclared, the 'Cat' schema defines the additionalProperties + # attribute. + deserialized = api_client.deserialize(response, ((cat.Cat),), True) + self.assertTrue(isinstance(deserialized, cat.Cat)) + self.assertIn('color', deserialized.to_dict()) + self.assertEqual(deserialized['color'], 'black') + + def test_deserialize_cat_discard_unknown_properties(self): + """ + Deserialize Cat with unknown properties. + Request to discard unknown properties, but Cat is composed schema + with one inner schema that has 'additionalProperties' set to true. + """ + config = Configuration(discard_unknown_keys=True) + api_client = petstore_api.ApiClient(config) + data = { + "class_name": "Cat", + "color": "black", + "declawed": True, + # Below are additional (undeclared) properties. + "my_additional_property": 123, + } + # The 'my_additional_property' is undeclared + response = MockResponse(data=json.dumps(data)) + deserialized = api_client.deserialize(response, ((cat.Cat),), True) + self.assertTrue(isinstance(deserialized, cat.Cat)) + # Check the 'my_additional_property' is present + self.assertIn("my_additional_property", deserialized.to_dict().keys()) + diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_drawing.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_drawing.py new file mode 100644 index 000000000000..327e01fb849f --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_drawing.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 sys +import unittest + +import petstore_api +try: + from petstore_api.model import nullable_shape +except ImportError: + nullable_shape = sys.modules[ + 'petstore_api.model.nullable_shape'] +try: + from petstore_api.model import shape +except ImportError: + shape = sys.modules[ + 'petstore_api.model.shape'] +try: + from petstore_api.model import shape_or_null +except ImportError: + shape_or_null = sys.modules[ + 'petstore_api.model.shape_or_null'] +from petstore_api.model.drawing import Drawing + + +class TestDrawing(unittest.TestCase): + """Drawing unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_create_instances(self): + """ + Validate instance can be created using pythonic name or OAS names. + """ + + # Validate object can be created using pythonic names. + inst = shape.Shape( + shape_type="Triangle", + triangle_type="IsoscelesTriangle" + ) + from petstore_api.model.isosceles_triangle import IsoscelesTriangle + assert isinstance(inst, IsoscelesTriangle) + + # Validate object can be created using OAS names. + # For example, this can be used to construct objects on the client + # when the input data is available as JSON documents. + data = { + 'shapeType': "Triangle", + 'triangleType': "IsoscelesTriangle" + } + inst = shape.Shape(_spec_property_naming=True, **data) + assert isinstance(inst, IsoscelesTriangle) + + def test_deserialize_oneof_reference(self): + """ + Validate the scenario when the type of a OAS property is 'oneOf', and the 'oneOf' + schema is specified as a reference ($ref), not an inline 'oneOf' schema. + """ + isosceles_triangle = shape.Shape( + shape_type="Triangle", + triangle_type="IsoscelesTriangle" + ) + from petstore_api.model.isosceles_triangle import IsoscelesTriangle + from petstore_api.model.triangle import Triangle + from petstore_api.model.equilateral_triangle import EquilateralTriangle + + assert isinstance(isosceles_triangle, IsoscelesTriangle) + inst = Drawing( + # 'main_shape' has type 'Shape', which is a oneOf [triangle, quadrilateral] + # composed schema. So we should be able to assign a petstore_api.Triangle + # to a 'main_shape'. + main_shape=isosceles_triangle, + shapes=[ + shape.Shape( + shape_type="Triangle", + triangle_type="EquilateralTriangle" + ), + Triangle( + shape_type="Triangle", + triangle_type="IsoscelesTriangle" + ), + EquilateralTriangle( + shape_type="Triangle", + triangle_type="EquilateralTriangle" + ), + shape.Shape( + shape_type="Quadrilateral", + quadrilateral_type="ComplexQuadrilateral" + ), + ], + ) + from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral + assert isinstance(inst, Drawing) + assert isinstance(inst.main_shape, IsoscelesTriangle) + self.assertEqual(len(inst.shapes), 4) + assert isinstance(inst.shapes[0], EquilateralTriangle) + assert isinstance(inst.shapes[1], IsoscelesTriangle) + assert isinstance(inst.shapes[2], EquilateralTriangle) + assert isinstance(inst.shapes[3], ComplexQuadrilateral) + + # Validate we cannot assign the None value to main_shape because the 'null' type + # is not one of the allowed types in the 'Shape' schema. + err_msg = (r"Invalid type for variable '{}'. " + r"Required value type is {} and passed type was {} at {}") + with self.assertRaisesRegex( + petstore_api.ApiTypeError, + err_msg.format(r"main_shape", r"one of \[ComplexQuadrilateral, EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle, SimpleQuadrilateral\]", r"NoneType", r"\['main_shape'\]") + ): + inst = Drawing( + # 'main_shape' has type 'Shape', which is a oneOf [triangle, quadrilateral] + # So the None value should not be allowed and an exception should be raised. + main_shape=None, + ) + + + def test_deserialize_oneof_reference_with_null_type(self): + """ + Validate the scenario when the type of a OAS property is 'oneOf', and the 'oneOf' + schema is specified as a reference ($ref), not an inline 'oneOf' schema. + Further, the 'oneOf' schema has a 'null' type child schema (as introduced in + OpenAPI 3.1). + """ + + # Validate we can assign the None value to shape_or_null, because the 'null' type + # is one of the allowed types in the 'ShapeOrNull' schema. + inst = Drawing( + # 'shape_or_null' has type 'ShapeOrNull', which is a oneOf [null, triangle, quadrilateral] + shape_or_null=None, + ) + assert isinstance(inst, Drawing) + self.assertFalse(hasattr(inst, 'main_shape')) + self.assertTrue(hasattr(inst, 'shape_or_null')) + self.assertIsNone(inst.shape_or_null) + + + def test_deserialize_oneof_reference_with_nullable_type(self): + """ + Validate the scenario when the type of a OAS property is 'oneOf', and the 'oneOf' + schema is specified as a reference ($ref), not an inline 'oneOf' schema. + Further, the 'oneOf' schema has the 'nullable' attribute (as introduced in + OpenAPI 3.0 and deprecated in 3.1). + """ + + # Validate we can assign the None value to nullable_shape, because the NullableShape + # has the 'nullable: true' attribute. + inst = Drawing( + # 'nullable_shape' has type 'NullableShape', which is a oneOf [triangle, quadrilateral] + # and the 'nullable: true' attribute. + nullable_shape=None, + ) + assert isinstance(inst, Drawing) + self.assertFalse(hasattr(inst, 'main_shape')) + self.assertTrue(hasattr(inst, 'nullable_shape')) + self.assertIsNone(inst.nullable_shape) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_enum_test.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_enum_test.py similarity index 100% rename from samples/openapi3/client/petstore/python/tests_manual/test_enum_test.py rename to samples/openapi3/client/petstore/python-prior/tests_manual/test_enum_test.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_extra_pool_config_options.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_extra_pool_config_options.py similarity index 93% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_extra_pool_config_options.py rename to samples/openapi3/client/petstore/python-prior/tests_manual/test_extra_pool_config_options.py index 5bf6b989ebe2..9e49b9e71ba1 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_extra_pool_config_options.py +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_extra_pool_config_options.py @@ -48,9 +48,9 @@ def test_socket_options_get_passed_to_proxy_manager(self): socket_options = ["extra", "socket", "options"] - config = petstore_api.Configuration(host="HOST") + config = petstore_api.Configuration(host="http://somehost.local:8080") config.socket_options = socket_options - config.proxy = True + config.proxy = "http://proxy.local:8080/" with patch("petstore_api.rest.urllib3.ProxyManager", StubProxyManager): api_client = petstore_api.ApiClient(config) diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_fake_api.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_fake_api.py new file mode 100644 index 000000000000..12e391238e6e --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_fake_api.py @@ -0,0 +1,785 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 sys +from collections import namedtuple +import os +import json +import unittest +from unittest.mock import patch + +import petstore_api +from petstore_api.api.fake_api import FakeApi # noqa: E501 +from petstore_api.rest import RESTClientObject, RESTResponse +from petstore_api.model_utils import file_type, model_to_dict + +HTTPResponse = namedtuple( + 'urllib3_response_HTTPResponse', + ['status', 'reason', 'data', 'getheaders', 'getheader'] +) + +headers = {'Content-Type': 'application/json'} +def get_headers(): + return {} +def get_header(name, default=None): + return {}.get(name, default) + + +class TestFakeApi(unittest.TestCase): + """FakeApi unit test stubs""" + + def setUp(self): + self.api = FakeApi() # noqa: E501 + + def tearDown(self): + pass + + @staticmethod + def mock_response(body_value): + http_response = HTTPResponse( + status=200, + reason='OK', + data=json.dumps(body_value).encode('utf-8'), + getheaders=get_headers, + getheader=get_header + ) + return RESTResponse(http_response) + + @staticmethod + def assert_request_called_with( + mock_method, + url, + accept='application/json', + http_method='POST', + content_type='application/json', + **kwargs + ): + headers = { + 'Accept': accept, + 'User-Agent': 'OpenAPI-Generator/1.0.0/python', + } + if content_type: + headers['Content-Type'] = content_type + used_kwargs = dict( + _preload_content=True, + _request_timeout=None, + headers=headers, + query_params=[] + ) + if 'post_params' in kwargs: + used_kwargs['post_params'] = kwargs['post_params'] + if 'body' in kwargs: + used_kwargs['body'] = kwargs['body'] + if 'post_params' not in used_kwargs: + used_kwargs['post_params'] = [] + mock_method.assert_called_with( + http_method, + url, + **used_kwargs + ) + + def test_array_model(self): + """Test case for array_model + + """ + from petstore_api.model import animal_farm, animal + endpoint = self.api.array_model_endpoint + assert endpoint.openapi_types['body'] == (animal_farm.AnimalFarm,) + assert endpoint.settings['response_type'] == (animal_farm.AnimalFarm,) + + # serialization + deserialization works + with patch.object(RESTClientObject, 'request') as mock_method: + cat = animal.Animal(class_name="Cat", color="black") + body = animal_farm.AnimalFarm([cat]) + json_data = [{"className": "Cat", "color": "black"}] + mock_method.return_value = self.mock_response(json_data) + + response = self.api.array_model(body=body) + self.assert_request_called_with( + mock_method, + 'http://petstore.swagger.io:80/v2/fake/refs/arraymodel', + body=json_data, + ) + + assert isinstance(response, animal_farm.AnimalFarm) + assert response == body + + def test_boolean(self): + """Test case for boolean + + """ + endpoint = self.api.boolean_endpoint + assert endpoint.openapi_types['body'] == (bool,) + assert endpoint.settings['response_type'] == (bool,) + + def test_recursionlimit(self): + """Test case for recursionlimit + + """ + assert sys.getrecursionlimit() == 1234 + + def test_fake_health_get(self): + """Test case for fake_health_get + + Health check endpoint # noqa: E501 + """ + pass + + def test_additional_properties_with_array_of_enums(self): + """Test case for additional_properties_with_array_of_enums + + Additional Properties with Array of Enums # noqa: E501 + """ + pass + + def test_enum_test(self): + """Test case for enum_test + + Object contains enum properties and array properties containing enums + """ + from petstore_api.model.enum_test import EnumTest + from petstore_api.model.string_enum import StringEnum + from petstore_api.model.array_of_enums import ArrayOfEnums + + endpoint = self.api.enum_test_endpoint + assert endpoint.openapi_types['enum_test'] == (EnumTest,) + assert endpoint.settings['response_type'] == (EnumTest,) + + # serialization + deserialization works w/ inline array + with patch.object(RESTClientObject, 'request') as mock_method: + body = EnumTest( + enum_string_required='lower', + inline_array_of_str_enum=[StringEnum('approved')] + ) + json_value = {'enum_string_required': 'lower', 'InlineArrayOfStrEnum': ['approved']} + mock_method.return_value = self.mock_response(json_value) + + response = self.api.enum_test(enum_test=body) + self.assert_request_called_with( + mock_method, + 'http://petstore.swagger.io:80/v2/fake/refs/enum-test', + body=json_value, + ) + + assert isinstance(response, EnumTest) + assert response == body + + # serialization + deserialization works w/ refed array + with patch.object(RESTClientObject, 'request') as mock_method: + body = EnumTest( + enum_string_required='lower', + array_of_str_enum=ArrayOfEnums([StringEnum('approved')]) + ) + json_value = {'enum_string_required': 'lower', 'ArrayOfStrEnum': ['approved']} + mock_method.return_value = self.mock_response(json_value) + + response = self.api.enum_test(enum_test=body) + self.assert_request_called_with( + mock_method, + 'http://petstore.swagger.io:80/v2/fake/refs/enum-test', + body=json_value, + ) + + assert isinstance(response, EnumTest) + assert response == body + + + def test_array_of_enums(self): + """Test case for array_of_enums + + Array of Enums # noqa: E501 + """ + from petstore_api.model import array_of_enums, string_enum + endpoint = self.api.array_of_enums_endpoint + assert endpoint.openapi_types['array_of_enums'] == (array_of_enums.ArrayOfEnums,) + assert endpoint.settings['response_type'] == (array_of_enums.ArrayOfEnums,) + + # serialization + deserialization works + with patch.object(RESTClientObject, 'request') as mock_method: + value = [string_enum.StringEnum("placed")] + body = array_of_enums.ArrayOfEnums(value) + value_simple = ["placed"] + mock_method.return_value = self.mock_response(value_simple) + + response = self.api.array_of_enums(array_of_enums=body) + self.assert_request_called_with( + mock_method, + 'http://petstore.swagger.io:80/v2/fake/refs/array-of-enums', + body=value_simple, + ) + + assert isinstance(response, array_of_enums.ArrayOfEnums) + assert response.value == value + + def test_number_with_validations(self): + """Test case for number_with_validations + + """ + from petstore_api.model import number_with_validations + endpoint = self.api.number_with_validations_endpoint + assert endpoint.openapi_types['body'] == (number_with_validations.NumberWithValidations,) + assert endpoint.settings['response_type'] == (number_with_validations.NumberWithValidations,) + + # serialization + deserialization works + with patch.object(RESTClientObject, 'request') as mock_method: + value = 10.0 + body = number_with_validations.NumberWithValidations(value) + mock_method.return_value = self.mock_response(value) + + response = self.api.number_with_validations(body=body) + self.assert_request_called_with( + mock_method, + 'http://petstore.swagger.io:80/v2/fake/refs/number', + body=value, + ) + + assert isinstance(response, number_with_validations.NumberWithValidations) + assert response.value == value + + def test_object_model_with_ref_props(self): + """Test case for object_model_with_ref_props + + """ + from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps + from petstore_api.model.number_with_validations import NumberWithValidations + endpoint = self.api.object_model_with_ref_props_endpoint + assert endpoint.openapi_types['body'] == (ObjectModelWithRefProps,) + assert endpoint.settings['response_type'] == (ObjectModelWithRefProps,) + + json_payloads = [ + {}, # only required + no optional properties works + { # optional properties works + "my_number": 11.0, + "my_string": 'a', + "my_boolean": True, + } + ] + # instantiation works + expected_models = [ + ObjectModelWithRefProps(), + ObjectModelWithRefProps( + my_number=NumberWithValidations(11.0), + my_string='a', + my_boolean=True + ) + ] + + pairs = zip(json_payloads, expected_models) + # serialization + deserialization works + for (json_payload, expected_model) in pairs: + with patch.object(RESTClientObject, 'request') as mock_method: + mock_method.return_value = self.mock_response(json_payload) + + response = self.api.object_model_with_ref_props(body=expected_model) + self.assert_request_called_with( + mock_method, + 'http://petstore.swagger.io:80/v2/fake/refs/object_model_with_ref_props', + body=json_payload, + ) + + assert isinstance(response, expected_model.__class__) + assert response == expected_model + + def test_composed_one_of_number_with_validations(self): + """Test case for composed_one_of_number_with_validations + + """ + from petstore_api.model import animal, composed_one_of_number_with_validations, number_with_validations + endpoint = self.api.composed_one_of_number_with_validations_endpoint + assert endpoint.openapi_types['composed_one_of_number_with_validations'] == ( + composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,) + assert endpoint.settings['response_type'] == ( + composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,) + + # serialization + deserialization works + num_with_validations = number_with_validations.NumberWithValidations(10.0) + cat_in_composed = composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations( + class_name="Cat", color="black" + ) + import datetime + date = datetime.date(1970, 1, 1) + body_value_simple = [ + (num_with_validations, 10.0), + (cat_in_composed, {"className": "Cat", "color": "black"}), + (None, None), + (date, '1970-01-01'), + ] + for (body, value_simple) in body_value_simple: + with patch.object(RESTClientObject, 'request') as mock_method: + mock_method.return_value = self.mock_response(value_simple) + + response = self.api.composed_one_of_number_with_validations(composed_one_of_number_with_validations=body) + self.assert_request_called_with( + mock_method, + 'http://petstore.swagger.io:80/v2/fake/refs/composed_one_of_number_with_validations', + body=value_simple, + ) + + assert isinstance(response, body.__class__) + assert response == body + + def test_string(self): + """Test case for string + + """ + endpoint = self.api.string_endpoint + assert endpoint.openapi_types['body'] == (str,) + assert endpoint.settings['response_type'] == (str,) + + # serialization + deserialization works + with patch.object(RESTClientObject, 'request') as mock_method: + body = "blah" + value_simple = body + mock_method.return_value = self.mock_response(value_simple) + + response = self.api.string(body=body) + self.assert_request_called_with( + mock_method, + 'http://petstore.swagger.io:80/v2/fake/refs/string', + body=value_simple, + ) + + assert isinstance(response, str) + assert response == value_simple + + def test_string_enum(self): + """Test case for string_enum + + """ + from petstore_api.model import string_enum + endpoint = self.api.string_enum_endpoint + assert endpoint.openapi_types['body'] == (string_enum.StringEnum,) + assert endpoint.settings['response_type'] == (string_enum.StringEnum,) + + # serialization + deserialization works + from petstore_api.rest import RESTClientObject, RESTResponse + with patch.object(RESTClientObject, 'request') as mock_method: + value = "placed" + body = string_enum.StringEnum(value) + mock_method.return_value = self.mock_response(value) + + response = self.api.string_enum(body=body) + self.assert_request_called_with( + mock_method, + 'http://petstore.swagger.io:80/v2/fake/refs/enum', + body=value, + ) + + assert isinstance(response, string_enum.StringEnum) + assert response.value == value + + def test_upload_file(self): + # uploads a file + test_file_dir = os.path.realpath( + os.path.join(os.path.dirname(__file__), "..", "testfiles")) + file_path1 = os.path.join(test_file_dir, "1px_pic1.png") + + headers = {} + def get_headers(): + return headers + def get_header(name, default=None): + return headers.get(name, default) + api_respponse = { + 'code': 200, + 'type': 'blah', + 'message': 'file upload succeeded' + } + http_response = HTTPResponse( + status=200, + reason='OK', + data=json.dumps(api_respponse).encode('utf-8'), + getheaders=get_headers, + getheader=get_header + ) + mock_response = RESTResponse(http_response) + file1 = open(file_path1, "rb") + try: + with patch.object(RESTClientObject, 'request') as mock_method: + mock_method.return_value = mock_response + res = self.api.upload_file( + file=file1) + body = None + post_params=[ + ('file', ('1px_pic1.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png')), + ] + self.assert_request_called_with( + mock_method, + 'http://petstore.swagger.io:80/v2/fake/uploadFile', + body=body, post_params=post_params, content_type='multipart/form-data' + ) + except petstore_api.ApiException as e: + self.fail("upload_file() raised {0} unexpectedly".format(type(e))) + finally: + file1.close() + + # passing in an array of files to when file only allows one + # raises an exceptions + try: + file = open(file_path1, "rb") + with self.assertRaises(petstore_api.ApiTypeError) as exc: + self.api.upload_file(file=[file]) + finally: + file.close() + + # passing in a closed file raises an exception + with self.assertRaises(petstore_api.ApiValueError) as exc: + file = open(file_path1, "rb") + file.close() + self.api.upload_file(file=file) + + def test_upload_files(self): + test_file_dir = os.path.realpath( + os.path.join(os.path.dirname(__file__), "..", "testfiles")) + file_path1 = os.path.join(test_file_dir, "1px_pic1.png") + file_path2 = os.path.join(test_file_dir, "1px_pic2.png") + + headers = {} + def get_headers(): + return headers + def get_header(name, default=None): + return headers.get(name, default) + api_respponse = { + 'code': 200, + 'type': 'blah', + 'message': 'file upload succeeded' + } + http_response = HTTPResponse( + status=200, + reason='OK', + data=json.dumps(api_respponse).encode('utf-8'), + getheaders=get_headers, + getheader=get_header + ) + mock_response = RESTResponse(http_response) + file1 = open(file_path1, "rb") + file2 = open(file_path2, "rb") + try: + with patch.object(RESTClientObject, 'request') as mock_method: + mock_method.return_value = mock_response + res = self.api.upload_files( + files=[file1, file2]) + post_params=[ + ('files', ('1px_pic1.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png')), + ('files', ('1px_pic2.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png')) + ] + self.assert_request_called_with( + mock_method, + 'http://petstore.swagger.io:80/v2/fake/uploadFiles', + body=None, post_params=post_params, content_type='multipart/form-data' + ) + except petstore_api.ApiException as e: + self.fail("upload_file() raised {0} unexpectedly".format(type(e))) + finally: + file1.close() + file2.close() + + # passing in a single file when an array of file is required + # raises an exception + try: + file = open(file_path1, "rb") + with self.assertRaises(petstore_api.ApiTypeError) as exc: + self.api.upload_files(files=file) + finally: + file.close() + + def test_download_attachment(self): + """Ensures that file deserialization works""" + + # sample from http://www.jtricks.com/download-text + file_name = 'content.txt' + headers_dict = { + 'with_filename': {'Content-Disposition': 'attachment; filename={}'.format(file_name), 'Content-Type': 'text/plain'}, + 'no_filename': {'Content-Disposition': 'attachment;', 'Content-Type': 'text/plain'} + } + def get_headers(*args): + return args + file_data = ( + "You are reading text file that was supposed to be downloaded\r\n" + "to your hard disk. If your browser offered to save you the file," + "\r\nthen it handled the Content-Disposition header correctly." + ) + for key, headers in headers_dict.items(): + def get_header(name, default=None): + return headers_dict[key].get(name, default) + http_response = HTTPResponse( + status=200, + reason='OK', + data=file_data, + getheaders=get_headers(headers), + getheader=get_header + ) + # deserialize response to a file + mock_response = RESTResponse(http_response) + with patch.object(RESTClientObject, 'request') as mock_method: + mock_method.return_value = mock_response + try: + file_object = self.api.download_attachment(file_name='download-text') + self.assert_request_called_with( + mock_method, + 'http://www.jtricks.com/download-text', + http_method='GET', + accept='text/plain', + content_type=None, + ) + self.assertTrue(isinstance(file_object, file_type)) + self.assertFalse(file_object.closed) + self.assertEqual(file_object.read(), file_data.encode('utf-8')) + finally: + file_object.close() + os.unlink(file_object.name) + + def test_upload_download_file(self): + test_file_dir = os.path.realpath( + os.path.join(os.path.dirname(__file__), "..", "testfiles")) + file_path1 = os.path.join(test_file_dir, "1px_pic1.png") + + with open(file_path1, "rb") as f: + expected_file_data = f.read() + + headers = {'Content-Type': 'application/octet-stream'} + def get_headers(): + return headers + def get_header(name, default=None): + return headers.get(name, default) + http_response = HTTPResponse( + status=200, + reason='OK', + data=expected_file_data, + getheaders=get_headers, + getheader=get_header + ) + mock_response = RESTResponse(http_response) + file1 = open(file_path1, "rb") + try: + with patch.object(RESTClientObject, 'request') as mock_method: + mock_method.return_value = mock_response + downloaded_file = self.api.upload_download_file(body=file1) + self.assert_request_called_with( + mock_method, + 'http://petstore.swagger.io:80/v2/fake/uploadDownloadFile', + body=expected_file_data, + content_type='application/octet-stream', + accept='application/octet-stream' + ) + + self.assertTrue(isinstance(downloaded_file, file_type)) + self.assertFalse(downloaded_file.closed) + self.assertEqual(downloaded_file.read(), expected_file_data) + except petstore_api.ApiException as e: + self.fail("upload_download_file() raised {0} unexpectedly".format(type(e))) + finally: + file1.close() + downloaded_file.close() + os.unlink(downloaded_file.name) + + 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_post_inline_additional_properties_ref_payload(self): + """Test case for postInlineAdditionlPropertiesRefPayload + """ + from petstore_api.model.inline_additional_properties_ref_payload import InlineAdditionalPropertiesRefPayload + from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner + endpoint = self.api.post_inline_additional_properties_ref_payload_endpoint + assert endpoint.openapi_types['inline_additional_properties_ref_payload'] == (InlineAdditionalPropertiesRefPayload,) + assert endpoint.settings['response_type'] == (InlineAdditionalPropertiesRefPayload,) + + # serialization + deserialization works + from petstore_api.rest import RESTClientObject, RESTResponse + with patch.object(RESTClientObject, 'request') as mock_method: + expected_json_body = { + 'arrayData': [ + { + 'labels': [ + None, + 'foo' + ] + } + ] + } + inline_additional_properties_ref_payload = InlineAdditionalPropertiesRefPayload( + array_data=[ + PostInlineAdditionalPropertiesPayloadRequestArrayDataInner(labels=[None, 'foo']) + ] + ) + mock_method.return_value = self.mock_response(expected_json_body) + + response = self.api.post_inline_additional_properties_ref_payload(inline_additional_properties_ref_payload=inline_additional_properties_ref_payload) + self.assert_request_called_with( + mock_method, + 'http://petstore.swagger.io:80/v2/fake/postInlineAdditionalPropertiesRefPayload', + body=expected_json_body + ) + + assert isinstance(response, InlineAdditionalPropertiesRefPayload) + assert model_to_dict(response) == expected_json_body + + def test_post_inline_additional_properties_payload(self): + """Test case for postInlineAdditionlPropertiesPayload + """ + from petstore_api.model.post_inline_additional_properties_payload_request import PostInlineAdditionalPropertiesPayloadRequest + from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner + endpoint = self.api.post_inline_additional_properties_payload_endpoint + assert endpoint.openapi_types['post_inline_additional_properties_payload_request'] == (PostInlineAdditionalPropertiesPayloadRequest,) + assert endpoint.settings['response_type'] == (PostInlineAdditionalPropertiesPayloadRequest,) + + # serialization + deserialization works + from petstore_api.rest import RESTClientObject, RESTResponse + with patch.object(RESTClientObject, 'request') as mock_method: + expected_json_body = { + 'arrayData': [ + { + 'labels': [ + None, + 'foo' + ] + } + ] + } + post_inline_additional_properties_payload_request = PostInlineAdditionalPropertiesPayloadRequest( + array_data=[ + PostInlineAdditionalPropertiesPayloadRequestArrayDataInner(labels=[None, 'foo']) + ] + ) + mock_method.return_value = self.mock_response(expected_json_body) + + response = self.api.post_inline_additional_properties_payload(post_inline_additional_properties_payload_request=post_inline_additional_properties_payload_request) + self.assert_request_called_with( + mock_method, + 'http://petstore.swagger.io:80/v2/fake/postInlineAdditionalPropertiesPayload', + body=expected_json_body + ) + + assert isinstance(response, PostInlineAdditionalPropertiesPayloadRequest) + assert model_to_dict(response) == expected_json_body + + def test_post_tx_rx_any_of_payload(self): + """Test case for postInlineAdditionlPropertiesPayload + """ + from petstore_api.model.gm_fruit_no_properties import GmFruitNoProperties + endpoint = self.api.tx_rx_any_of_model_endpoint + assert endpoint.openapi_types['gm_fruit_no_properties'] == (GmFruitNoProperties,) + assert endpoint.settings['response_type'] == (GmFruitNoProperties,) + + # serialization + deserialization works + from petstore_api.rest import RESTClientObject, RESTResponse + with patch.object(RESTClientObject, 'request') as mock_method: + expected_json_body = { + 'cultivar': 'Alice', + 'origin': 'Kazakhstan', + 'lengthCm': 7, + } + fruit = GmFruitNoProperties(**expected_json_body) + mock_method.return_value = self.mock_response(expected_json_body) + + response = self.api.tx_rx_any_of_model(gm_fruit_no_properties=fruit) + self.assert_request_called_with( + mock_method, + 'http://petstore.swagger.io:80/v2/fake/TxRxAnyOfModel', + body=expected_json_body + ) + + assert isinstance(response, GmFruitNoProperties) + assert model_to_dict(response) == expected_json_body + + def test_post_tx_rx_all_of_payload(self): + """Test case for postInlineAdditionlPropertiesPayload + """ + from petstore_api.model.stream_options import StreamOptions + from petstore_api.model.publish_options_publish import PublishOptionsPublish + endpoint = self.api.tx_rx_all_of_model_endpoint + assert endpoint.openapi_types['stream_options'] == (StreamOptions,) + assert endpoint.settings['response_type'] == (StreamOptions,) + + # serialization + deserialization works + from petstore_api.rest import RESTClientObject, RESTResponse + with patch.object(RESTClientObject, 'request') as mock_method: + expected_json_body = { + "egressThresholds": { + "person":0.8 + }, + "publish": { + "egressUnknownDetections": False + } + } + stream_option_instance = StreamOptions(**expected_json_body) + mock_method.return_value = self.mock_response(expected_json_body) + + response = self.api.tx_rx_all_of_model(stream_options=stream_option_instance) + self.assert_request_called_with( + mock_method, + 'http://petstore.swagger.io:80/v2/fake/TxRxAllOfModel', + body=expected_json_body + ) + + assert isinstance(response, StreamOptions) + assert model_to_dict(response) == expected_json_body + assert response.publish == PublishOptionsPublish(**{"egress_unknown_detections": False}) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_fruit.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_fruit.py new file mode 100644 index 000000000000..a0f97a4a97dc --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_fruit.py @@ -0,0 +1,247 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 sys +import unittest + +import petstore_api +from petstore_api.model import apple +from petstore_api.model import banana +from petstore_api.model.fruit import Fruit + + +class TestFruit(unittest.TestCase): + """Fruit unit test stubs""" + + length_cm = 20.3 + color = 'yellow' + + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_fruit_with_additional_props(self): + # including extra parameters works because the oneOf models include additionalProperties + some_value = 'some_value' + some_fruit = Fruit( + color=self.color, + length_cm=self.length_cm, + unknown_property=some_value + ) + assert some_fruit['unknown_property'] == some_value + + def test_fruit_assigning_additional_props_in_client(self): + # setting a value that doesn't exist works because additional_properties_type allows any type + other_fruit = Fruit(length_cm=self.length_cm, color=self.color) + blah = 'blah' + other_fruit['a'] = blah + assert other_fruit.a == blah + + # with setattr + setattr(other_fruit, 'b', blah) + assert other_fruit.b == blah + + self.assertEqual( + other_fruit.to_dict(), + { + 'a': 'blah', + 'b': 'blah', + 'length_cm': self.length_cm, + 'color': self.color + } + ) + + def test_fruit_access_errors(self): + fruit = Fruit(length_cm=self.length_cm, color=self.color) + + # getting a value that doesn't exist raises an exception + # with a key + with self.assertRaises(AttributeError): + invalid_variable = fruit['cultivar'] + + # Per Python doc, if the named attribute does not exist, + # default is returned if provided, otherwise AttributeError is raised. + with self.assertRaises(AttributeError): + getattr(fruit, 'cultivar') + + def test_fruit_attribute_access(self): + fruit = Fruit(length_cm=self.length_cm, color=self.color) + + # Assert that we can call the builtin hasattr() function. + # hasattr should return False for non-existent attribute. + # Internally hasattr catches the AttributeError exception. + self.assertFalse(hasattr(fruit, 'invalid_variable')) + + # Assert that we can call the builtin hasattr() function. + # hasattr should return True for existent attribute. + self.assertTrue(hasattr(fruit, 'color')) + + # with getattr + # Per Python doc, if the named attribute does not exist, + # default is returned if provided. + self.assertEqual(getattr(fruit, 'cultivar', 'some value'), 'some value') + self.assertEqual(fruit.get('cultivar'), None) + self.assertEqual(fruit.get('cultivar', 'some value'), 'some value') + + def test_banana_fruit(self): + """Test Fruit""" + + # make an instance of Fruit, a composed schema oneOf model + # banana test + fruit = Fruit(length_cm=self.length_cm, color=self.color) + # check its properties + self.assertEqual(fruit.length_cm, self.length_cm) + self.assertEqual(fruit['length_cm'], self.length_cm) + self.assertEqual(fruit.get('length_cm'), self.length_cm) + self.assertEqual(getattr(fruit, 'length_cm'), self.length_cm) + self.assertEqual(fruit.color, self.color) + self.assertEqual(fruit['color'], self.color) + self.assertEqual(getattr(fruit, 'color'), self.color) + # check the dict representation + self.assertEqual( + fruit.to_dict(), + { + 'length_cm': self.length_cm, + 'color': self.color + } + ) + + # make sure that the ModelComposed class properties are correct + # model._composed_schemas stores the anyOf/allOf/oneOf info + self.assertEqual( + fruit._composed_schemas, + { + 'anyOf': [], + 'allOf': [], + 'oneOf': [ + apple.Apple, + banana.Banana, + ], + } + ) + # model._composed_instances is a list of the instances that were + # made from the anyOf/allOf/OneOf classes in model._composed_schemas + self.assertEqual(len(fruit._composed_instances), 1) + for composed_instance in fruit._composed_instances: + if composed_instance.__class__ == banana.Banana: + banana_instance = composed_instance + self.assertEqual( + fruit._composed_instances, + [banana_instance] + ) + # model._var_name_to_model_instances maps the variable name to the + # model instances which store that variable + print(fruit._var_name_to_model_instances) + self.assertEqual( + fruit._var_name_to_model_instances, + { + 'color': [fruit], + 'length_cm': [fruit, banana_instance], + } + ) + self.assertEqual( + fruit._additional_properties_model_instances, [fruit] + ) + + # if we modify one of the properties owned by multiple + # model_instances we get an exception when we try to access that + # property because the retrieved values are not all the same + banana_instance.length_cm = 4.56 + with self.assertRaises(petstore_api.ApiValueError): + some_length_cm = fruit.length_cm + + # including input parameters for two oneOf instances raise an exception + with self.assertRaises(petstore_api.ApiValueError): + fruit = Fruit( + length_cm=self.length_cm, + cultivar='granny smith' + ) + + def test_apple_fruit(self): + + # make an instance of Fruit, a composed schema oneOf model + # apple test + color = 'red' + cultivar = 'golden delicious' + fruit = Fruit(color=color, cultivar=cultivar) + # check its properties + self.assertEqual(fruit.color, color) + self.assertEqual(fruit['color'], color) + self.assertEqual(getattr(fruit, 'color'), color) + self.assertEqual(fruit.cultivar, cultivar) + self.assertEqual(fruit['cultivar'], cultivar) + self.assertEqual(getattr(fruit, 'cultivar'), cultivar) + # check the dict representation + self.assertEqual( + fruit.to_dict(), + { + 'color': color, + 'cultivar': cultivar + } + ) + + # model._composed_instances is a list of the instances that were + # made from the anyOf/allOf/OneOf classes in model._composed_schemas + for composed_instance in fruit._composed_instances: + if composed_instance.__class__ == apple.Apple: + apple_instance = composed_instance + self.assertEqual( + fruit._composed_instances, + [apple_instance] + ) + # model._var_name_to_model_instances maps the variable name to the + # model instances which store that variable + self.assertEqual( + fruit._var_name_to_model_instances, + { + 'color': [fruit], + 'cultivar': [fruit, apple_instance], + } + ) + self.assertEqual( + fruit._additional_properties_model_instances, [fruit] + ) + + def test_null_fruit(self): + # Since 'apple' is nullable, validate we can create an apple with the 'null' value. + fruit = apple.Apple(None) + self.assertIsNone(fruit) + + # 'banana' is not nullable. + with self.assertRaises(petstore_api.ApiTypeError): + banana.Banana(None) + + # Since 'fruit' has oneOf 'apple', 'banana' and 'apple' is nullable, + # validate we can create a fruit with the 'null' value. + fruit = Fruit(None) + self.assertIsNone(fruit) + + # Redo the same thing, this time passing a null Apple to the Fruit constructor. + fruit = Fruit(apple.Apple(None)) + self.assertIsNone(fruit) + + def test_fruit_with_invalid_input_type(self): + + """ + color must be a str, color's str type is only defined at the Fruit level + Banana + Apple would allow color to be assigned with any type of value + """ + invalid_value = 1 + with self.assertRaises(petstore_api.ApiTypeError): + fruit = Fruit(color=invalid_value, length_cm=self.length_cm) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_fruit_req.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_fruit_req.py new file mode 100644 index 000000000000..64b710fdd583 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_fruit_req.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 sys +import unittest + +import petstore_api +from petstore_api.model import apple_req +from petstore_api.model import banana_req +from petstore_api.model.fruit_req import FruitReq + + +class TestFruitReq(unittest.TestCase): + """FruitReq unit test stubs""" + length_cm = 20.3 + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_fruit_access_errors(self): + fruit = FruitReq(length_cm=self.length_cm) + + # setting a value that doesn't exist raises an exception + # with a key + with self.assertRaises(AttributeError): + fruit['invalid_variable'] = 'some value' + # with setattr + with self.assertRaises(AttributeError): + setattr(fruit, 'invalid_variable', 'some value') + + # getting a value that doesn't exist raises an exception + # with a key + with self.assertRaises(AttributeError): + invalid_variable = fruit['cultivar'] + + with self.assertRaises(AttributeError): + getattr(fruit, 'cultivar') + + def test_FruitReq_banana(self): + """Test FruitReq""" + + # make an instance of Fruit, a composed schema oneOf model + # banana test + fruit = FruitReq(length_cm=self.length_cm) + # check its properties + self.assertEqual(fruit.length_cm, self.length_cm) + self.assertEqual(fruit['length_cm'], self.length_cm) + self.assertEqual(getattr(fruit, 'length_cm'), self.length_cm) + # check the dict representation + self.assertEqual( + fruit.to_dict(), + { + 'length_cm': self.length_cm, + } + ) + + # with getattr + self.assertEqual(getattr(fruit, 'cultivar', 'some value'), 'some value') + + # make sure that the ModelComposed class properties are correct + # model._composed_schemas stores the anyOf/allOf/oneOf info + self.assertEqual( + fruit._composed_schemas, + { + 'anyOf': [], + 'allOf': [], + 'oneOf': [ + apple_req.AppleReq, + banana_req.BananaReq, + type(None), + ], + } + ) + # model._composed_instances is a list of the instances that were + # made from the anyOf/allOf/OneOf classes in model._composed_schemas + for composed_instance in fruit._composed_instances: + if composed_instance.__class__ == banana_req.BananaReq: + banana_instance = composed_instance + self.assertEqual( + fruit._composed_instances, + [banana_instance] + ) + # model._var_name_to_model_instances maps the variable name to the + # model instances which store that variable + self.assertEqual( + fruit._var_name_to_model_instances, + { + 'length_cm': [fruit, banana_instance], + } + ) + self.assertEqual( + fruit._additional_properties_model_instances, [fruit] + ) + + # if we modify one of the properties owned by multiple + # model_instances we get an exception when we try to access that + # property because the retrieved values are not all the same + banana_instance.length_cm = 4.56 + with self.assertRaises(petstore_api.ApiValueError): + some_length_cm = fruit.length_cm + + def test_invalid_inputs(self): + # including extra parameters raises an exception + with self.assertRaises(petstore_api.ApiValueError): + fruit = FruitReq( + length_cm=self.length_cm, + unknown_property='some value' + ) + + # including input parameters for two oneOf instances raise an exception + with self.assertRaises(petstore_api.ApiValueError): + fruit = FruitReq( + length_cm=self.length_cm, + cultivar='granny smith' + ) + + def test_FruitReq_apple(self): + """Test FruitReq""" + + # apple test + cultivar = 'golden delicious' + fruit = FruitReq(cultivar=cultivar) + # check its properties + self.assertEqual(fruit.cultivar, cultivar) + self.assertEqual(fruit['cultivar'], cultivar) + self.assertEqual(getattr(fruit, 'cultivar'), cultivar) + # check the dict representation + self.assertEqual( + fruit.to_dict(), + { + 'cultivar': cultivar + } + ) + + # model._composed_instances is a list of the instances that were + # made from the anyOf/allOf/OneOf classes in model._composed_schemas + for composed_instance in fruit._composed_instances: + if composed_instance.__class__ == apple_req.AppleReq: + apple_instance = composed_instance + self.assertEqual( + fruit._composed_instances, + [apple_instance] + ) + # model._var_name_to_model_instances maps the variable name to the + # model instances which store that variable + self.assertEqual( + fruit._var_name_to_model_instances, + { + 'cultivar': [fruit, apple_instance], + } + ) + self.assertEqual( + fruit._additional_properties_model_instances, [fruit] + ) + + def test_null_fruit(self): + # we can pass in None + fruit = FruitReq(None) + assert fruit is None + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_gm_fruit.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_gm_fruit.py new file mode 100644 index 000000000000..bbe105c59bc9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_gm_fruit.py @@ -0,0 +1,217 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 sys +import unittest + +import petstore_api +from petstore_api.model import apple +from petstore_api.model import banana +from petstore_api.model.gm_fruit import GmFruit + + +class TestGmFruit(unittest.TestCase): + """GmFruit unit test stubs""" + length_cm = 20.3 + color = 'yellow' + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_set_addprop_attributes(self): + # setting a value that doesn't exist works because additional_properties_type allows any type + other_fruit = GmFruit(length_cm=self.length_cm, color=self.color) + blah = 'blah' + other_fruit['a'] = blah + assert other_fruit.a == blah + + # with setattr + setattr(other_fruit, 'b', blah) + assert other_fruit.b == blah + + self.assertEqual( + other_fruit.to_dict(), + { + 'a': 'blah', + 'b': 'blah', + 'length_cm': self.length_cm, + 'color': self.color + } + ) + + def test_banana_fruit(self): + """Test GmFruit""" + + # make an instance of GmFruit, a composed schema anyOf model + # banana test + fruit = GmFruit(length_cm=self.length_cm, color=self.color) + # check its properties + self.assertEqual(fruit.length_cm, self.length_cm) + self.assertEqual(fruit['length_cm'], self.length_cm) + self.assertEqual(getattr(fruit, 'length_cm'), self.length_cm) + self.assertEqual(fruit.color, self.color) + self.assertEqual(fruit['color'], self.color) + self.assertEqual(getattr(fruit, 'color'), self.color) + # check the dict representation + self.assertEqual( + fruit.to_dict(), + { + 'length_cm': self.length_cm, + 'color': self.color + } + ) + + # getting a value that doesn't exist raises an exception + # with a key + with self.assertRaises(AttributeError): + invalid_variable = fruit['cultivar'] + # with getattr + self.assertTrue(getattr(fruit, 'cultivar', 'some value'), 'some value') + + with self.assertRaises(AttributeError): + invalid_variable = getattr(fruit, 'cultivar') + + # make sure that the ModelComposed class properties are correct + # model._composed_schemas stores the anyOf/allOf/oneOf info + self.assertEqual( + fruit._composed_schemas, + { + 'anyOf': [ + apple.Apple, + banana.Banana, + ], + 'allOf': [], + 'oneOf': [], + } + ) + # model._composed_instances is a list of the instances that were + # made from the anyOf/allOf/OneOf classes in model._composed_schemas + for composed_instance in fruit._composed_instances: + if composed_instance.__class__ == banana.Banana: + banana_instance = composed_instance + self.assertEqual( + fruit._composed_instances, + [banana_instance] + ) + # model._var_name_to_model_instances maps the variable name to the + # model instances which store that variable + self.assertEqual( + fruit._var_name_to_model_instances, + { + 'color': [fruit], + 'length_cm': [fruit, banana_instance], + } + ) + self.assertEqual( + fruit._additional_properties_model_instances, [fruit] + ) + + def test_combo_fruit(self): + # including input parameters for both anyOf instances works + cultivar = 'banaple' + color = 'orange' + fruit = GmFruit( + color=color, + cultivar=cultivar, + length_cm=self.length_cm + ) + self.assertEqual(fruit.color, color) + self.assertEqual(fruit['color'], color) + self.assertEqual(getattr(fruit, 'color'), color) + self.assertEqual(fruit.cultivar, cultivar) + self.assertEqual(fruit['cultivar'], cultivar) + self.assertEqual(getattr(fruit, 'cultivar'), cultivar) + self.assertEqual(fruit.length_cm, self.length_cm) + self.assertEqual(fruit['length_cm'], self.length_cm) + self.assertEqual(getattr(fruit, 'length_cm'), self.length_cm) + + # model._composed_instances is a list of the instances that were + # made from the anyOf/allOf/OneOf classes in model._composed_schemas + for composed_instance in fruit._composed_instances: + if composed_instance.__class__ == apple.Apple: + apple_instance = composed_instance + elif composed_instance.__class__ == banana.Banana: + banana_instance = composed_instance + self.assertEqual( + fruit._composed_instances, + [apple_instance, banana_instance] + ) + # model._var_name_to_model_instances maps the variable name to the + # model instances which store that variable + self.assertEqual( + fruit._var_name_to_model_instances, + { + 'color': [fruit], + 'length_cm': [fruit, banana_instance], + 'cultivar': [fruit, apple_instance], + } + ) + self.assertEqual( + fruit._additional_properties_model_instances, [fruit] + ) + + def test_apple_fruit(self): + # apple test + color = 'red' + cultivar = 'golden delicious' + origin = 'California' + fruit = GmFruit(color=color, cultivar=cultivar, origin=origin) + # check its properties + self.assertEqual(fruit.color, color) + self.assertEqual(fruit['color'], color) + self.assertEqual(getattr(fruit, 'color'), color) + self.assertEqual(fruit.cultivar, cultivar) + self.assertEqual(fruit['cultivar'], cultivar) + self.assertEqual(getattr(fruit, 'cultivar'), cultivar) + + self.assertEqual(fruit.origin, origin) + self.assertEqual(fruit['origin'], origin) + self.assertEqual(getattr(fruit, 'origin'), origin) + + # check the dict representation + self.assertEqual( + fruit.to_dict(), + { + 'color': color, + 'cultivar': cultivar, + 'origin': origin, + } + ) + + # model._composed_instances is a list of the instances that were + # made from the anyOf/allOf/OneOf classes in model._composed_schemas + for composed_instance in fruit._composed_instances: + if composed_instance.__class__ == apple.Apple: + apple_instance = composed_instance + self.assertEqual( + fruit._composed_instances, + [apple_instance] + ) + # model._var_name_to_model_instances maps the variable name to the + # model instances which store that variable + self.assertEqual( + fruit._var_name_to_model_instances, + { + 'color': [fruit], + 'cultivar': [fruit, apple_instance], + 'origin': [fruit, apple_instance], + } + ) + self.assertEqual( + fruit._additional_properties_model_instances, [fruit] + ) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_http_signature.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_http_signature.py new file mode 100644 index 000000000000..c6854d666c74 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_http_signature.py @@ -0,0 +1,518 @@ +# 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 +""" + +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.model 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 = category.Category() + cls.category.id = id_gen() + cls.category.name = "dog" + cls.tag = tag.Tag() + cls.tag.id = id_gen() + cls.tag.name = "python-pet-tag" + cls.pet = pet.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 acces_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)), + 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 acces_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)), + 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 acces_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)), + 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 acces_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)), + 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 acces_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)), + 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-prior/tests_manual/test_integer_enum_one_value.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_integer_enum_one_value.py new file mode 100644 index 000000000000..eff7298d9f3d --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_integer_enum_one_value.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 sys +import unittest + +import petstore_api +from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue + + +class TestIntegerEnumOneValue(unittest.TestCase): + """IntegerEnumOneValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testIntegerEnumOneValue(self): + """Test IntegerEnumOneValue""" + model = IntegerEnumOneValue() + assert model.value == 0, "With only one option, the value is assigned automatically" + + model = IntegerEnumOneValue(0) + assert model.value == 0, "We can also pass in the value as a positional arg" + + model = IntegerEnumOneValue(value=0) + assert model.value == 0, "We can also pass in the value as a named argument" + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_issue10083.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_issue10083.py similarity index 100% rename from samples/openapi3/client/petstore/python/tests_manual/test_issue10083.py rename to samples/openapi3/client/petstore/python-prior/tests_manual/test_issue10083.py diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_issue10155.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_issue10155.py similarity index 100% rename from samples/openapi3/client/petstore/python/tests_manual/test_issue10155.py rename to samples/openapi3/client/petstore/python-prior/tests_manual/test_issue10155.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_mammal.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_mammal.py similarity index 53% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_mammal.py rename to samples/openapi3/client/petstore/python-prior/tests_manual/test_mammal.py index 975b02e01547..3ed00dd79817 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_mammal.py +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_mammal.py @@ -14,6 +14,16 @@ import unittest import petstore_api +try: + from petstore_api.model import whale +except ImportError: + whale = sys.modules[ + 'petstore_api.model.whale'] +try: + from petstore_api.model import zebra +except ImportError: + zebra = sys.modules[ + 'petstore_api.model.zebra'] from petstore_api.model.mammal import Mammal @@ -29,26 +39,10 @@ def tearDown(self): def testMammal(self): """Test Mammal""" - # tests that we can make a BasquePig by traveling through discriminator in Pig - m = Mammal(className="BasquePig") - from petstore_api.model import pig + # tests that we can make a BasquePig by traveling through descendant discriminator in Pig + model = Mammal(class_name="BasquePig") from petstore_api.model import basque_pig - assert isinstance(m, Mammal) - assert isinstance(m, basque_pig.BasquePig) - assert isinstance(m, pig.Pig) - - # can make a Whale - m = Mammal(className="whale") - from petstore_api.model import whale - assert isinstance(m, whale.Whale) - - # can use the enum value - m = Mammal(className=whale.Whale.MetaOapg.properties.className.WHALE) - assert isinstance(m, whale.Whale) - - from petstore_api.model import zebra - m = Mammal(className='zebra') - assert isinstance(m, zebra.Zebra) + assert isinstance(model, basque_pig.BasquePig) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_mole.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_mole.py similarity index 100% rename from samples/openapi3/client/petstore/python/tests_manual/test_mole.py rename to samples/openapi3/client/petstore/python-prior/tests_manual/test_mole.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_number_with_validations.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_number_with_validations.py similarity index 67% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_number_with_validations.py rename to samples/openapi3/client/petstore/python-prior/tests_manual/test_number_with_validations.py index 5cf1dfaa9c53..f4264ca82ea3 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_number_with_validations.py +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_number_with_validations.py @@ -31,14 +31,11 @@ def testNumberWithValidations(self): valid_values = [10.0, 15.0, 20.0] for valid_value in valid_values: model = NumberWithValidations(valid_value) - assert model == valid_value - - value_error_msg_pairs = ( - (9.0, r"Invalid value `9.0`, must be a value greater than or equal to `10` at \('args\[0\]',\)"), - (21.0, r"Invalid value `21.0`, must be a value less than or equal to `20` at \('args\[0\]',\)"), - ) - for invalid_value, error_msg in value_error_msg_pairs: - with self.assertRaisesRegex(petstore_api.ApiValueError, error_msg): + assert model.value == valid_value + + invalid_values = [9.0, 21.0] + for invalid_value in invalid_values: + with self.assertRaises(petstore_api.ApiValueError): NumberWithValidations(invalid_value) diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_object_model_with_ref_props.py new file mode 100644 index 000000000000..c708237acb42 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_object_model_with_ref_props.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 +""" + + +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import number_with_validations +except ImportError: + number_with_validations = sys.modules[ + 'petstore_api.model.number_with_validations'] +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps +from petstore_api.model.readonly import Readonly + + +class TestObjectModelWithRefProps(unittest.TestCase): + """ObjectModelWithRefProps unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testObjectModelWithRefProps(self): + """Test ObjectModelWithRefProps""" + from petstore_api.model.number_with_validations import NumberWithValidations + self.assertEqual( + ObjectModelWithRefProps.openapi_types, + { + 'my_number': (NumberWithValidations,), + 'my_readonly': (Readonly,), + 'my_string': (str,), + 'my_boolean': (bool,), + } + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_parent_pet.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_parent_pet.py similarity index 76% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_parent_pet.py rename to samples/openapi3/client/petstore/python-prior/tests_manual/test_parent_pet.py index 171310075abf..a57f9b8527ae 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_parent_pet.py +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_parent_pet.py @@ -14,7 +14,16 @@ import unittest import petstore_api -from petstore_api.model.grandparent_animal import GrandparentAnimal +try: + from petstore_api.model import child_cat +except ImportError: + child_cat = sys.modules[ + 'petstore_api.model.child_cat'] +try: + from petstore_api.model import grandparent_animal +except ImportError: + grandparent_animal = sys.modules[ + 'petstore_api.model.grandparent_animal'] from petstore_api.model.parent_pet import ParentPet @@ -35,7 +44,6 @@ def testParentPet(self): # GrandparentAnimal, and we use the descendant's discriminator to make ParentPet model = ParentPet(pet_type="ParentPet") assert isinstance(model, ParentPet) - assert isinstance(model, GrandparentAnimal) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_quadrilateral.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_quadrilateral.py similarity index 60% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_quadrilateral.py rename to samples/openapi3/client/petstore/python-prior/tests_manual/test_quadrilateral.py index dff97bc716ad..63f74ae541fb 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_quadrilateral.py @@ -14,8 +14,16 @@ import unittest import petstore_api -from petstore_api.model import complex_quadrilateral -from petstore_api.model import simple_quadrilateral +try: + from petstore_api.model import complex_quadrilateral +except ImportError: + complex_quadrilateral = sys.modules[ + 'petstore_api.model.complex_quadrilateral'] +try: + from petstore_api.model import simple_quadrilateral +except ImportError: + simple_quadrilateral = sys.modules[ + 'petstore_api.model.simple_quadrilateral'] from petstore_api.model.quadrilateral import Quadrilateral @@ -30,9 +38,9 @@ def tearDown(self): def testQuadrilateral(self): """Test Quadrilateral""" - instance = Quadrilateral(shapeType="Quadrilateral", quadrilateralType="ComplexQuadrilateral") + instance = Quadrilateral(shape_type="Quadrilateral", quadrilateral_type="ComplexQuadrilateral") assert isinstance(instance, complex_quadrilateral.ComplexQuadrilateral) - instance = Quadrilateral(shapeType="Quadrilateral", quadrilateralType="SimpleQuadrilateral") + instance = Quadrilateral(shape_type="Quadrilateral", quadrilateral_type="SimpleQuadrilateral") assert isinstance(instance, simple_quadrilateral.SimpleQuadrilateral) diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_shape.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_shape.py new file mode 100644 index 000000000000..a2b59fc6f31c --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_shape.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 sys +import unittest + +import petstore_api +try: + from petstore_api.model import quadrilateral +except ImportError: + quadrilateral = sys.modules[ + 'petstore_api.model.quadrilateral'] +try: + from petstore_api.model import triangle +except ImportError: + triangle = sys.modules[ + 'petstore_api.model.triangle'] +from petstore_api.model.shape import Shape + + +class TestShape(unittest.TestCase): + """Shape unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_recursionlimit(self): + """Test case for recursionlimit + + """ + assert sys.getrecursionlimit() == 1234 + + def testShape(self): + """Test Shape""" + from petstore_api.model import complex_quadrilateral + from petstore_api.model import simple_quadrilateral + from petstore_api.model import equilateral_triangle + from petstore_api.model import isosceles_triangle + from petstore_api.model import scalene_triangle + + tri = triangle.Triangle( + shape_type="Triangle", + triangle_type="EquilateralTriangle" + ) + assert isinstance(tri, equilateral_triangle.EquilateralTriangle) + + tri = triangle.Triangle( + shape_type="Triangle", + triangle_type="IsoscelesTriangle" + ) + assert isinstance(tri, isosceles_triangle.IsoscelesTriangle) + + tri = triangle.Triangle( + shape_type="Triangle", + triangle_type="ScaleneTriangle" + ) + assert isinstance(tri, scalene_triangle.ScaleneTriangle) + + quad = Shape( + shape_type="Quadrilateral", + quadrilateral_type="ComplexQuadrilateral" + ) + assert isinstance(quad, complex_quadrilateral.ComplexQuadrilateral) + + quad = Shape( + shape_type="Quadrilateral", + quadrilateral_type="SimpleQuadrilateral" + ) + assert isinstance(quad, simple_quadrilateral.SimpleQuadrilateral) + + # No discriminator provided. + err_msg = ("Cannot deserialize input data due to missing discriminator. " + "The discriminator property '{}' is missing at path: ()" + ) + with self.assertRaisesRegex( + petstore_api.ApiValueError, + err_msg.format("shapeType") + ): + Shape() + + # invalid shape_type (first discriminator). 'Circle' does not exist in the model. + err_msg = ("Cannot deserialize input data due to invalid discriminator " + "value. The OpenAPI document has no mapping for discriminator " + "property '{}'='{}' at path: ()" + ) + with self.assertRaisesRegex( + petstore_api.ApiValueError, + err_msg.format("shapeType", "Circle") + ): + Shape(shape_type="Circle") + + # invalid quadrilateral_type (second discriminator) + with self.assertRaisesRegex( + petstore_api.ApiValueError, + err_msg.format("quadrilateralType", "Triangle") + ): + Shape( + shape_type="Quadrilateral", + quadrilateral_type="Triangle" + ) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_string_enum.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_string_enum.py similarity index 54% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_string_enum.py rename to samples/openapi3/client/petstore/python-prior/tests_manual/test_string_enum.py index 0485242b37e2..87092d66d388 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_string_enum.py +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_string_enum.py @@ -10,11 +10,11 @@ """ +import sys import unittest import petstore_api from petstore_api.model.string_enum import StringEnum -from petstore_api.schemas import Singleton, NoneClass class TestStringEnum(unittest.TestCase): @@ -29,28 +29,24 @@ def tearDown(self): def testStringEnum(self): """Test StringEnum""" inst = StringEnum(None) - assert isinstance(inst, StringEnum) - assert isinstance(inst, NoneClass) - assert repr(inst) == '' + self.assertIsNone(inst) inst = StringEnum('approved') assert isinstance(inst, StringEnum) - assert isinstance(inst, Singleton) - assert isinstance(inst, str) - assert inst == 'approved' - assert repr(inst) == "" with self.assertRaises(petstore_api.ApiValueError): StringEnum('garbage') # make sure that we can access its allowed_values - assert isinstance(StringEnum.NONE, NoneClass) - assert StringEnum.PLACED == 'placed' - assert StringEnum.APPROVED == 'approved' - assert StringEnum.DELIVERED == 'delivered' - assert StringEnum.DOUBLE_QUOTE_WITH_NEWLINE == "double quote \n with newline" - assert StringEnum.MULTIPLE_LINES == "multiple\nlines" - assert StringEnum.SINGLE_QUOTED == "single quoted" + assert StringEnum.allowed_values[('value',)] == { + 'None': None, + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + 'DOUBLE_QUOTE_WITH_NEWLINE': "double quote \n with newline", + 'MULTIPLE_LINES': "multiple\nlines", + 'SINGLE_QUOTED': "single quoted" + } if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_tag.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_tag.py similarity index 100% rename from samples/openapi3/client/petstore/python/tests_manual/test_tag.py rename to samples/openapi3/client/petstore/python-prior/tests_manual/test_tag.py diff --git a/samples/openapi3/client/petstore/python-prior/tests_manual/test_triangle.py b/samples/openapi3/client/petstore/python-prior/tests_manual/test_triangle.py new file mode 100644 index 000000000000..7268022cad52 --- /dev/null +++ b/samples/openapi3/client/petstore/python-prior/tests_manual/test_triangle.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 +""" + + +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import equilateral_triangle +except ImportError: + equilateral_triangle = sys.modules[ + 'petstore_api.model.equilateral_triangle'] +try: + from petstore_api.model import isosceles_triangle +except ImportError: + isosceles_triangle = sys.modules[ + 'petstore_api.model.isosceles_triangle'] +try: + from petstore_api.model import scalene_triangle +except ImportError: + scalene_triangle = sys.modules[ + 'petstore_api.model.scalene_triangle'] +from petstore_api.model.triangle import Triangle + + +class TestTriangle(unittest.TestCase): + """Triangle unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTriangle(self): + """Test Triangle""" + tri = Triangle(shape_type="Triangle", triangle_type="EquilateralTriangle") + assert isinstance(tri, equilateral_triangle.EquilateralTriangle) + tri = Triangle(shape_type="Triangle", triangle_type="IsoscelesTriangle") + assert isinstance(tri, isosceles_triangle.IsoscelesTriangle) + tri = Triangle(shape_type="Triangle", triangle_type="ScaleneTriangle") + assert isinstance(tri, scalene_triangle.ScaleneTriangle) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/util.py b/samples/openapi3/client/petstore/python-prior/tests_manual/util.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/util.py rename to samples/openapi3/client/petstore/python-prior/tests_manual/util.py diff --git a/samples/openapi3/client/petstore/python-experimental/tox.ini b/samples/openapi3/client/petstore/python-prior/tox.ini similarity index 77% rename from samples/openapi3/client/petstore/python-experimental/tox.ini rename to samples/openapi3/client/petstore/python-prior/tox.ini index e57c17e10c10..8989fc3c4d96 100644 --- a/samples/openapi3/client/petstore/python-experimental/tox.ini +++ b/samples/openapi3/client/petstore/python-prior/tox.ini @@ -1,8 +1,7 @@ [tox] -envlist = py37 +envlist = py3 [testenv] -passenv = PYTHON_VERSION deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt diff --git a/samples/openapi3/client/petstore/python/.gitignore b/samples/openapi3/client/petstore/python/.gitignore index 43995bd42fa2..a62e8aba43f8 100644 --- a/samples/openapi3/client/petstore/python/.gitignore +++ b/samples/openapi3/client/petstore/python/.gitignore @@ -33,6 +33,7 @@ var/ # Installer logs pip-log.txt pip-delete-this-directory.txt +dev-requirements.txt.log # Unit test / coverage reports htmlcov/ diff --git a/samples/openapi3/client/petstore/python/.gitlab-ci.yml b/samples/openapi3/client/petstore/python/.gitlab-ci.yml index 9e84f5176163..611e425676ee 100644 --- a/samples/openapi3/client/petstore/python/.gitlab-ci.yml +++ b/samples/openapi3/client/petstore/python/.gitlab-ci.yml @@ -10,6 +10,9 @@ stages: - pip install -r test-requirements.txt - pytest --cov=petstore_api +test-3.5: + extends: .tests + image: python:3.5-alpine test-3.6: extends: .tests image: python:3.6-alpine @@ -19,6 +22,3 @@ test-3.7: test-3.8: extends: .tests image: python:3.8-alpine -test-3.9: - extends: .tests - image: python:3.9-alpine diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/FILES b/samples/openapi3/client/petstore/python/.openapi-generator/FILES index aa32ba2deeb9..0ce65f0078f7 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python/.openapi-generator/FILES @@ -2,235 +2,386 @@ .gitlab-ci.yml .travis.yml README.md -docs/AdditionalPropertiesClass.md -docs/AdditionalPropertiesWithArrayOfEnums.md -docs/Address.md -docs/Animal.md -docs/AnimalFarm.md -docs/AnotherFakeApi.md -docs/ApiResponse.md -docs/Apple.md -docs/AppleReq.md -docs/ArrayOfArrayOfNumberOnly.md -docs/ArrayOfEnums.md -docs/ArrayOfNumberOnly.md -docs/ArrayTest.md -docs/Banana.md -docs/BananaReq.md -docs/BasquePig.md -docs/BooleanEnum.md -docs/Capitalization.md -docs/Cat.md -docs/CatAllOf.md -docs/Category.md -docs/ChildCat.md -docs/ChildCatAllOf.md -docs/ClassModel.md -docs/Client.md -docs/ComplexQuadrilateral.md -docs/ComposedOneOfNumberWithValidations.md -docs/ComposedSchemaWithPropsAndNoAddProps.md -docs/DanishPig.md -docs/DefaultApi.md -docs/Dog.md -docs/DogAllOf.md -docs/Drawing.md -docs/EgressThresholdOptions.md -docs/EnumArrays.md -docs/EnumClass.md -docs/EnumTest.md -docs/EquilateralTriangle.md -docs/FakeApi.md -docs/FakeClassnameTags123Api.md -docs/File.md -docs/FileSchemaTestClass.md -docs/Foo.md -docs/FooGetDefaultResponse.md -docs/FooObject.md -docs/FormatTest.md -docs/Fruit.md -docs/FruitReq.md -docs/GmFruit.md -docs/GmFruitNoProperties.md -docs/GrandparentAnimal.md -docs/HasOnlyReadOnly.md -docs/HealthCheckResult.md -docs/InlineAdditionalPropertiesRefPayload.md -docs/IntegerEnum.md -docs/IntegerEnumOneValue.md -docs/IntegerEnumWithDefaultValue.md -docs/IsoscelesTriangle.md -docs/Legs.md -docs/List.md -docs/Mammal.md -docs/MapTest.md -docs/MixedPropertiesAndAdditionalPropertiesClass.md -docs/Model200Response.md -docs/ModelReturn.md -docs/Mole.md -docs/Name.md -docs/NullableClass.md -docs/NullableShape.md -docs/NumberOnly.md -docs/NumberWithValidations.md -docs/ObjectInterface.md -docs/ObjectModelWithRefProps.md -docs/ObjectWithValidations.md -docs/Order.md -docs/ParentPet.md -docs/Pet.md -docs/PetApi.md -docs/Pig.md -docs/PostInlineAdditionalPropertiesPayloadRequest.md -docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md -docs/PublishOptions.md -docs/PublishOptionsPublish.md -docs/Quadrilateral.md -docs/QuadrilateralInterface.md -docs/ReadOnlyFirst.md -docs/Readonly.md -docs/ScaleneTriangle.md -docs/Shape.md -docs/ShapeInterface.md -docs/ShapeOrNull.md -docs/SimpleQuadrilateral.md -docs/SomeObject.md -docs/SomeObjectWithSelfAttr.md -docs/SpecialModelName.md -docs/StoreApi.md -docs/StreamOptions.md -docs/StringBooleanMap.md -docs/StringEnum.md -docs/StringEnumWithDefaultValue.md -docs/Tag.md -docs/Triangle.md -docs/TriangleInterface.md -docs/User.md -docs/UserApi.md -docs/Whale.md -docs/Zebra.md +docs/apis/tags/AnotherFakeApi.md +docs/apis/tags/DefaultApi.md +docs/apis/tags/FakeApi.md +docs/apis/tags/FakeClassnameTags123Api.md +docs/apis/tags/PetApi.md +docs/apis/tags/StoreApi.md +docs/apis/tags/UserApi.md +docs/models/AdditionalPropertiesClass.md +docs/models/AdditionalPropertiesValidator.md +docs/models/AdditionalPropertiesWithArrayOfEnums.md +docs/models/Address.md +docs/models/Animal.md +docs/models/AnimalFarm.md +docs/models/AnyTypeAndFormat.md +docs/models/AnyTypeNotString.md +docs/models/ApiResponse.md +docs/models/Apple.md +docs/models/AppleReq.md +docs/models/ArrayHoldingAnyType.md +docs/models/ArrayOfArrayOfNumberOnly.md +docs/models/ArrayOfEnums.md +docs/models/ArrayOfNumberOnly.md +docs/models/ArrayTest.md +docs/models/ArrayWithValidationsInItems.md +docs/models/Banana.md +docs/models/BananaReq.md +docs/models/Bar.md +docs/models/BasquePig.md +docs/models/Boolean.md +docs/models/BooleanEnum.md +docs/models/Capitalization.md +docs/models/Cat.md +docs/models/Category.md +docs/models/ChildCat.md +docs/models/ClassModel.md +docs/models/Client.md +docs/models/ComplexQuadrilateral.md +docs/models/ComposedAnyOfDifferentTypesNoValidations.md +docs/models/ComposedArray.md +docs/models/ComposedBool.md +docs/models/ComposedNone.md +docs/models/ComposedNumber.md +docs/models/ComposedObject.md +docs/models/ComposedOneOfDifferentTypes.md +docs/models/ComposedString.md +docs/models/Currency.md +docs/models/DanishPig.md +docs/models/DateTimeTest.md +docs/models/DateTimeWithValidations.md +docs/models/DateWithValidations.md +docs/models/DecimalPayload.md +docs/models/Dog.md +docs/models/Drawing.md +docs/models/EnumArrays.md +docs/models/EnumClass.md +docs/models/EnumTest.md +docs/models/EquilateralTriangle.md +docs/models/File.md +docs/models/FileSchemaTestClass.md +docs/models/Foo.md +docs/models/FormatTest.md +docs/models/Fruit.md +docs/models/FruitReq.md +docs/models/GmFruit.md +docs/models/GrandparentAnimal.md +docs/models/HasOnlyReadOnly.md +docs/models/HealthCheckResult.md +docs/models/IntegerEnum.md +docs/models/IntegerEnumBig.md +docs/models/IntegerEnumOneValue.md +docs/models/IntegerEnumWithDefaultValue.md +docs/models/IntegerMax10.md +docs/models/IntegerMin15.md +docs/models/IsoscelesTriangle.md +docs/models/JSONPatchRequest.md +docs/models/JSONPatchRequestAddReplaceTest.md +docs/models/JSONPatchRequestMoveCopy.md +docs/models/JSONPatchRequestRemove.md +docs/models/Mammal.md +docs/models/MapTest.md +docs/models/MixedPropertiesAndAdditionalPropertiesClass.md +docs/models/Model200Response.md +docs/models/ModelReturn.md +docs/models/Money.md +docs/models/Name.md +docs/models/NoAdditionalProperties.md +docs/models/NullableClass.md +docs/models/NullableShape.md +docs/models/NullableString.md +docs/models/Number.md +docs/models/NumberOnly.md +docs/models/NumberWithValidations.md +docs/models/ObjectInterface.md +docs/models/ObjectModelWithRefProps.md +docs/models/ObjectWithDecimalProperties.md +docs/models/ObjectWithDifficultlyNamedProps.md +docs/models/ObjectWithInlineCompositionProperty.md +docs/models/ObjectWithValidations.md +docs/models/Order.md +docs/models/ParentPet.md +docs/models/Pet.md +docs/models/Pig.md +docs/models/Player.md +docs/models/Quadrilateral.md +docs/models/QuadrilateralInterface.md +docs/models/ReadOnlyFirst.md +docs/models/ScaleneTriangle.md +docs/models/Shape.md +docs/models/ShapeOrNull.md +docs/models/SimpleQuadrilateral.md +docs/models/SomeObject.md +docs/models/SpecialModelName.md +docs/models/String.md +docs/models/StringBooleanMap.md +docs/models/StringEnum.md +docs/models/StringEnumWithDefaultValue.md +docs/models/StringWithValidation.md +docs/models/Tag.md +docs/models/Triangle.md +docs/models/TriangleInterface.md +docs/models/UUIDString.md +docs/models/User.md +docs/models/Whale.md +docs/models/Zebra.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/apis/__init__.py +petstore_api/apis/tags/another_fake_api.py +petstore_api/apis/tags/default_api.py +petstore_api/apis/tags/fake_api.py +petstore_api/apis/tags/fake_classname_tags123_api.py +petstore_api/apis/tags/pet_api.py +petstore_api/apis/tags/store_api.py +petstore_api/apis/tags/user_api.py petstore_api/configuration.py petstore_api/exceptions.py petstore_api/model/__init__.py petstore_api/model/additional_properties_class.py +petstore_api/model/additional_properties_class.pyi +petstore_api/model/additional_properties_validator.py +petstore_api/model/additional_properties_validator.pyi petstore_api/model/additional_properties_with_array_of_enums.py +petstore_api/model/additional_properties_with_array_of_enums.pyi petstore_api/model/address.py +petstore_api/model/address.pyi petstore_api/model/animal.py +petstore_api/model/animal.pyi petstore_api/model/animal_farm.py +petstore_api/model/animal_farm.pyi +petstore_api/model/any_type_and_format.py +petstore_api/model/any_type_and_format.pyi +petstore_api/model/any_type_not_string.py +petstore_api/model/any_type_not_string.pyi petstore_api/model/api_response.py +petstore_api/model/api_response.pyi petstore_api/model/apple.py +petstore_api/model/apple.pyi petstore_api/model/apple_req.py +petstore_api/model/apple_req.pyi +petstore_api/model/array_holding_any_type.py +petstore_api/model/array_holding_any_type.pyi petstore_api/model/array_of_array_of_number_only.py +petstore_api/model/array_of_array_of_number_only.pyi petstore_api/model/array_of_enums.py +petstore_api/model/array_of_enums.pyi petstore_api/model/array_of_number_only.py +petstore_api/model/array_of_number_only.pyi petstore_api/model/array_test.py +petstore_api/model/array_test.pyi +petstore_api/model/array_with_validations_in_items.py +petstore_api/model/array_with_validations_in_items.pyi petstore_api/model/banana.py +petstore_api/model/banana.pyi petstore_api/model/banana_req.py +petstore_api/model/banana_req.pyi +petstore_api/model/bar.py +petstore_api/model/bar.pyi petstore_api/model/basque_pig.py +petstore_api/model/basque_pig.pyi +petstore_api/model/boolean.py +petstore_api/model/boolean.pyi petstore_api/model/boolean_enum.py +petstore_api/model/boolean_enum.pyi petstore_api/model/capitalization.py +petstore_api/model/capitalization.pyi petstore_api/model/cat.py -petstore_api/model/cat_all_of.py +petstore_api/model/cat.pyi petstore_api/model/category.py +petstore_api/model/category.pyi petstore_api/model/child_cat.py -petstore_api/model/child_cat_all_of.py +petstore_api/model/child_cat.pyi petstore_api/model/class_model.py +petstore_api/model/class_model.pyi petstore_api/model/client.py +petstore_api/model/client.pyi petstore_api/model/complex_quadrilateral.py -petstore_api/model/composed_one_of_number_with_validations.py -petstore_api/model/composed_schema_with_props_and_no_add_props.py +petstore_api/model/complex_quadrilateral.pyi +petstore_api/model/composed_any_of_different_types_no_validations.py +petstore_api/model/composed_any_of_different_types_no_validations.pyi +petstore_api/model/composed_array.py +petstore_api/model/composed_array.pyi +petstore_api/model/composed_bool.py +petstore_api/model/composed_bool.pyi +petstore_api/model/composed_none.py +petstore_api/model/composed_none.pyi +petstore_api/model/composed_number.py +petstore_api/model/composed_number.pyi +petstore_api/model/composed_object.py +petstore_api/model/composed_object.pyi +petstore_api/model/composed_one_of_different_types.py +petstore_api/model/composed_one_of_different_types.pyi +petstore_api/model/composed_string.py +petstore_api/model/composed_string.pyi +petstore_api/model/currency.py +petstore_api/model/currency.pyi petstore_api/model/danish_pig.py +petstore_api/model/danish_pig.pyi +petstore_api/model/date_time_test.py +petstore_api/model/date_time_test.pyi +petstore_api/model/date_time_with_validations.py +petstore_api/model/date_time_with_validations.pyi +petstore_api/model/date_with_validations.py +petstore_api/model/date_with_validations.pyi +petstore_api/model/decimal_payload.py +petstore_api/model/decimal_payload.pyi petstore_api/model/dog.py -petstore_api/model/dog_all_of.py +petstore_api/model/dog.pyi petstore_api/model/drawing.py -petstore_api/model/egress_threshold_options.py +petstore_api/model/drawing.pyi petstore_api/model/enum_arrays.py +petstore_api/model/enum_arrays.pyi petstore_api/model/enum_class.py +petstore_api/model/enum_class.pyi petstore_api/model/enum_test.py +petstore_api/model/enum_test.pyi petstore_api/model/equilateral_triangle.py +petstore_api/model/equilateral_triangle.pyi petstore_api/model/file.py +petstore_api/model/file.pyi petstore_api/model/file_schema_test_class.py +petstore_api/model/file_schema_test_class.pyi petstore_api/model/foo.py -petstore_api/model/foo_get_default_response.py -petstore_api/model/foo_object.py +petstore_api/model/foo.pyi petstore_api/model/format_test.py +petstore_api/model/format_test.pyi petstore_api/model/fruit.py +petstore_api/model/fruit.pyi petstore_api/model/fruit_req.py +petstore_api/model/fruit_req.pyi petstore_api/model/gm_fruit.py -petstore_api/model/gm_fruit_no_properties.py +petstore_api/model/gm_fruit.pyi petstore_api/model/grandparent_animal.py +petstore_api/model/grandparent_animal.pyi petstore_api/model/has_only_read_only.py +petstore_api/model/has_only_read_only.pyi petstore_api/model/health_check_result.py -petstore_api/model/inline_additional_properties_ref_payload.py +petstore_api/model/health_check_result.pyi petstore_api/model/integer_enum.py +petstore_api/model/integer_enum.pyi +petstore_api/model/integer_enum_big.py +petstore_api/model/integer_enum_big.pyi petstore_api/model/integer_enum_one_value.py +petstore_api/model/integer_enum_one_value.pyi petstore_api/model/integer_enum_with_default_value.py +petstore_api/model/integer_enum_with_default_value.pyi +petstore_api/model/integer_max10.py +petstore_api/model/integer_max10.pyi +petstore_api/model/integer_min15.py +petstore_api/model/integer_min15.pyi petstore_api/model/isosceles_triangle.py -petstore_api/model/legs.py -petstore_api/model/list.py +petstore_api/model/isosceles_triangle.pyi +petstore_api/model/json_patch_request.py +petstore_api/model/json_patch_request.pyi +petstore_api/model/json_patch_request_add_replace_test.py +petstore_api/model/json_patch_request_add_replace_test.pyi +petstore_api/model/json_patch_request_move_copy.py +petstore_api/model/json_patch_request_move_copy.pyi +petstore_api/model/json_patch_request_remove.py +petstore_api/model/json_patch_request_remove.pyi petstore_api/model/mammal.py +petstore_api/model/mammal.pyi petstore_api/model/map_test.py +petstore_api/model/map_test.pyi petstore_api/model/mixed_properties_and_additional_properties_class.py +petstore_api/model/mixed_properties_and_additional_properties_class.pyi petstore_api/model/model200_response.py +petstore_api/model/model200_response.pyi petstore_api/model/model_return.py -petstore_api/model/mole.py +petstore_api/model/model_return.pyi +petstore_api/model/money.py +petstore_api/model/money.pyi petstore_api/model/name.py +petstore_api/model/name.pyi +petstore_api/model/no_additional_properties.py +petstore_api/model/no_additional_properties.pyi petstore_api/model/nullable_class.py +petstore_api/model/nullable_class.pyi petstore_api/model/nullable_shape.py +petstore_api/model/nullable_shape.pyi +petstore_api/model/nullable_string.py +petstore_api/model/nullable_string.pyi +petstore_api/model/number.py +petstore_api/model/number.pyi petstore_api/model/number_only.py +petstore_api/model/number_only.pyi petstore_api/model/number_with_validations.py +petstore_api/model/number_with_validations.pyi petstore_api/model/object_interface.py +petstore_api/model/object_interface.pyi petstore_api/model/object_model_with_ref_props.py +petstore_api/model/object_model_with_ref_props.pyi +petstore_api/model/object_with_decimal_properties.py +petstore_api/model/object_with_decimal_properties.pyi +petstore_api/model/object_with_difficultly_named_props.py +petstore_api/model/object_with_difficultly_named_props.pyi +petstore_api/model/object_with_inline_composition_property.py +petstore_api/model/object_with_inline_composition_property.pyi petstore_api/model/object_with_validations.py +petstore_api/model/object_with_validations.pyi petstore_api/model/order.py +petstore_api/model/order.pyi petstore_api/model/parent_pet.py +petstore_api/model/parent_pet.pyi petstore_api/model/pet.py +petstore_api/model/pet.pyi petstore_api/model/pig.py -petstore_api/model/post_inline_additional_properties_payload_request.py -petstore_api/model/post_inline_additional_properties_payload_request_array_data_inner.py -petstore_api/model/publish_options.py -petstore_api/model/publish_options_publish.py +petstore_api/model/pig.pyi +petstore_api/model/player.py +petstore_api/model/player.pyi petstore_api/model/quadrilateral.py +petstore_api/model/quadrilateral.pyi petstore_api/model/quadrilateral_interface.py +petstore_api/model/quadrilateral_interface.pyi petstore_api/model/read_only_first.py -petstore_api/model/readonly.py +petstore_api/model/read_only_first.pyi petstore_api/model/scalene_triangle.py +petstore_api/model/scalene_triangle.pyi petstore_api/model/shape.py -petstore_api/model/shape_interface.py +petstore_api/model/shape.pyi petstore_api/model/shape_or_null.py +petstore_api/model/shape_or_null.pyi petstore_api/model/simple_quadrilateral.py +petstore_api/model/simple_quadrilateral.pyi petstore_api/model/some_object.py -petstore_api/model/some_object_with_self_attr.py +petstore_api/model/some_object.pyi petstore_api/model/special_model_name.py -petstore_api/model/stream_options.py +petstore_api/model/special_model_name.pyi +petstore_api/model/string.py +petstore_api/model/string.pyi petstore_api/model/string_boolean_map.py +petstore_api/model/string_boolean_map.pyi petstore_api/model/string_enum.py +petstore_api/model/string_enum.pyi petstore_api/model/string_enum_with_default_value.py +petstore_api/model/string_enum_with_default_value.pyi +petstore_api/model/string_with_validation.py +petstore_api/model/string_with_validation.pyi petstore_api/model/tag.py +petstore_api/model/tag.pyi petstore_api/model/triangle.py +petstore_api/model/triangle.pyi petstore_api/model/triangle_interface.py +petstore_api/model/triangle_interface.pyi petstore_api/model/user.py +petstore_api/model/user.pyi +petstore_api/model/uuid_string.py +petstore_api/model/uuid_string.pyi petstore_api/model/whale.py +petstore_api/model/whale.pyi petstore_api/model/zebra.py -petstore_api/model_utils.py +petstore_api/model/zebra.pyi petstore_api/models/__init__.py petstore_api/rest.py +petstore_api/schemas.py petstore_api/signing.py requirements.txt setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_models/__init__.py tox.ini diff --git a/samples/openapi3/client/petstore/python/.travis.yml b/samples/openapi3/client/petstore/python/.travis.yml index 1fcc4b155964..f931f0f74b96 100644 --- a/samples/openapi3/client/petstore/python/.travis.yml +++ b/samples/openapi3/client/petstore/python/.travis.yml @@ -1,10 +1,10 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: + - "3.5" - "3.6" - "3.7" - "3.8" - - "3.9" # command to install dependencies install: - "pip install -r requirements.txt" diff --git a/samples/openapi3/client/petstore/python/Makefile b/samples/openapi3/client/petstore/python/Makefile index f8957d5ed65d..863c380ebef9 100644 --- a/samples/openapi3/client/petstore/python/Makefile +++ b/samples/openapi3/client/petstore/python/Makefile @@ -1,16 +1,16 @@ REQUIREMENTS_FILE=dev-requirements.txt REQUIREMENTS_OUT=dev-requirements.txt.log SETUP_OUT=*.egg-info -VENV=.venv +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 + 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_python.sh + bash ./test_python.sh \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index d877696d65f3..e85cd0648301 100644 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -9,7 +9,98 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python >=3.6 +Python >=3.7 + +## Migration from other generators like python and python-legacy + +### Changes +1. This generator uses spec case for all (object) property names and parameter names. + - So if the spec has a property name like camelCase, it will use camelCase rather than camel_case + - So you will need to update how you input and read properties to use spec case +2. Endpoint parameters are stored in dictionaries to prevent collisions (explanation below) + - So you will need to update how you pass data in to endpoints +3. Endpoint responses now include the original response, the deserialized response body, and (todo)the deserialized headers + - So you will need to update your code to use response.body to access deserialized data +4. All validated data is instantiated in an instance that subclasses all validated Schema classes and Decimal/str/list/tuple/frozendict/NoneClass/BoolClass/bytes/io.FileIO + - This means that you can use isinstance to check if a payload validated against a schema class + - This means that no data will be of type None/True/False + - ingested None will subclass NoneClass + - ingested True will subclass BoolClass + - ingested False will subclass BoolClass + - So if you need to check is True/False/None, instead use instance.is_true_oapg()/.is_false_oapg()/.is_none_oapg() +5. All validated class instances are immutable except for ones based on io.File + - This is because if properties were changed after validation, that validation would no longer apply + - So no changing values or property values after a class has been instantiated +6. String + Number types with formats + - String type data is stored as a string and if you need to access types based on its format like date, + date-time, uuid, number etc then you will need to use accessor functions on the instance + - type string + format: See .as_date_oapg, .as_datetime_oapg, .as_decimal_oapg, .as_uuid_oapg + - type number + format: See .as_float_oapg, .as_int_oapg + - this was done because openapi/json-schema defines constraints. string data may be type string with no format + keyword in one schema, and include a format constraint in another schema + - So if you need to access a string format based type, use as_date_oapg/as_datetime_oapg/as_decimal_oapg/as_uuid_oapg + - So if you need to access a number format based type, use as_int_oapg/as_float_oapg +7. Property access on AnyType(type unset) or object(dict) schemas + - Only required keys with valid python names are properties like .someProp and have type hints + - All optional keys may not exist, so properties are not defined for them + - One can access optional values with dict_instance['optionalProp'] and KeyError will be raised if it does not exist + - Use get_item_oapg if you need a way to always get a value whether or not the key exists + - If the key does not exist, schemas.unset is returned from calling dict_instance.get_item_oapg('optionalProp') + - All required and optional keys have type hints for this method, and @typing.overload is used + - A type hint is also generated for additionalProperties accessed using this method + - So you will need to update you code to use some_instance['optionalProp'] to access optional property + and additionalProperty values +8. The location of the api classes has changed + - Api classes are located in your_package.apis.tags.some_api + - This change was made to eliminate redundant code generation + - Legacy generators generated the same endpoint twice if it had > 1 tag on it + - This generator defines an endpoint in one class, then inherits that class to generate + apis by tags and by paths + - This change reduces code and allows quicker run time if you use the path apis + - path apis are at your_package.apis.paths.some_path + - Those apis will only load their needed models, which is less to load than all of the resources needed in a tag api + - So you will need to update your import paths to the api classes + +### Why are Oapg and _oapg used in class and method names? +Classes can have arbitrarily named properties set on them +Endpoints can have arbitrary operationId method names set +For those reasons, I use the prefix Oapg and _oapg to greatly reduce the likelihood of collisions +on protected + public classes/methods. +oapg stands for OpenApi Python Generator. + +### Object property spec case +This was done because when payloads are ingested, they can be validated against N number of schemas. +If the input signature used a different property name then that has mutated the payload. +So SchemaA and SchemaB must both see the camelCase spec named variable. +Also it is possible to send in two properties, named camelCase and camel_case in the same payload. +That use case should be support so spec case is used. + +### Parameter spec case +Parameters can be included in different locations including: +- query +- path +- header +- cookie + +Any of those parameters could use the same parameter names, so if every parameter +was included as an endpoint parameter in a function signature, they would collide. +For that reason, each of those inputs have been separated out into separate typed dictionaries: +- query_params +- path_params +- header_params +- cookie_params + +So when updating your code, you will need to pass endpoint parameters in using those +dictionaries. + +### Endpoint responses +Endpoint responses have been enriched to now include more information. +Any response reom an endpoint will now include the following properties: +response: urllib3.HTTPResponse +body: typing.Union[Unset, Schema] +headers: typing.Union[Unset, TODO] +Note: response header deserialization has not yet been added + ## Installation & Usage ### pip install @@ -45,11 +136,11 @@ import petstore_api Please follow the [installation procedure](#installation--usage) and then run the following: ```python -import datetime +import datetimeimport datetimeimport datetimeimport datetimeimport datetimeimport datetimeimport datetime import time import petstore_api from pprint import pprint -from petstore_api.api import another_fake_api +from petstore_api.apis import another_fake_api from petstore_api.model.client import Client # 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. @@ -58,7 +149,6 @@ configuration = petstore_api.Configuration( ) - # 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 @@ -81,162 +171,182 @@ 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* | [**additional_properties_with_array_of_enums**](docs/FakeApi.md#additional_properties_with_array_of_enums) | **GET** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums -*FakeApi* | [**array_model**](docs/FakeApi.md#array_model) | **POST** /fake/refs/arraymodel | -*FakeApi* | [**array_of_enums**](docs/FakeApi.md#array_of_enums) | **POST** /fake/refs/array-of-enums | Array of Enums -*FakeApi* | [**boolean**](docs/FakeApi.md#boolean) | **POST** /fake/refs/boolean | -*FakeApi* | [**composed_one_of_number_with_validations**](docs/FakeApi.md#composed_one_of_number_with_validations) | **POST** /fake/refs/composed_one_of_number_with_validations | -*FakeApi* | [**download_attachment**](docs/FakeApi.md#download_attachment) | **GET** /{fileName} | downloads a file using Content-Disposition -*FakeApi* | [**enum_test**](docs/FakeApi.md#enum_test) | **POST** /fake/refs/enum-test | Object contains enum properties and array properties containing enums -*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -*FakeApi* | [**mammal**](docs/FakeApi.md#mammal) | **POST** /fake/refs/mammal | -*FakeApi* | [**number_with_validations**](docs/FakeApi.md#number_with_validations) | **POST** /fake/refs/number | -*FakeApi* | [**object_model_with_ref_props**](docs/FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props | -*FakeApi* | [**post_inline_additional_properties_payload**](docs/FakeApi.md#post_inline_additional_properties_payload) | **POST** /fake/postInlineAdditionalPropertiesPayload | -*FakeApi* | [**post_inline_additional_properties_ref_payload**](docs/FakeApi.md#post_inline_additional_properties_ref_payload) | **POST** /fake/postInlineAdditionalPropertiesRefPayload | -*FakeApi* | [**string**](docs/FakeApi.md#string) | **POST** /fake/refs/string | -*FakeApi* | [**string_enum**](docs/FakeApi.md#string_enum) | **POST** /fake/refs/enum | -*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_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum 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 | -*FakeApi* | [**tx_rx_all_of_model**](docs/FakeApi.md#tx_rx_all_of_model) | **POST** /fake/TxRxAllOfModel | -*FakeApi* | [**tx_rx_any_of_model**](docs/FakeApi.md#tx_rx_any_of_model) | **POST** /fake/TxRxAnyOfModel | -*FakeApi* | [**upload_download_file**](docs/FakeApi.md#upload_download_file) | **POST** /fake/uploadDownloadFile | uploads a file and downloads a file using application/octet-stream -*FakeApi* | [**upload_file**](docs/FakeApi.md#upload_file) | **POST** /fake/uploadFile | uploads a file using multipart/form-data -*FakeApi* | [**upload_files**](docs/FakeApi.md#upload_files) | **POST** /fake/uploadFiles | uploads files using multipart/form-data -*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 -*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 - +*AnotherFakeApi* | [**call_123_test_special_tags**](docs/apis/tags/AnotherFakeApi.md#call_123_test_special_tags) | **patch** /another-fake/dummy | To test special tags +*DefaultApi* | [**foo_get**](docs/apis/tags/DefaultApi.md#foo_get) | **get** /foo | +*FakeApi* | [**additional_properties_with_array_of_enums**](docs/apis/tags/FakeApi.md#additional_properties_with_array_of_enums) | **get** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums +*FakeApi* | [**array_model**](docs/apis/tags/FakeApi.md#array_model) | **post** /fake/refs/arraymodel | +*FakeApi* | [**array_of_enums**](docs/apis/tags/FakeApi.md#array_of_enums) | **post** /fake/refs/array-of-enums | Array of Enums +*FakeApi* | [**body_with_file_schema**](docs/apis/tags/FakeApi.md#body_with_file_schema) | **put** /fake/body-with-file-schema | +*FakeApi* | [**body_with_query_params**](docs/apis/tags/FakeApi.md#body_with_query_params) | **put** /fake/body-with-query-params | +*FakeApi* | [**boolean**](docs/apis/tags/FakeApi.md#boolean) | **post** /fake/refs/boolean | +*FakeApi* | [**case_sensitive_params**](docs/apis/tags/FakeApi.md#case_sensitive_params) | **put** /fake/case-sensitive-params | +*FakeApi* | [**client_model**](docs/apis/tags/FakeApi.md#client_model) | **patch** /fake | To test \"client\" model +*FakeApi* | [**composed_one_of_different_types**](docs/apis/tags/FakeApi.md#composed_one_of_different_types) | **post** /fake/refs/composed_one_of_number_with_validations | +*FakeApi* | [**delete_coffee**](docs/apis/tags/FakeApi.md#delete_coffee) | **delete** /fake/deleteCoffee/{id} | Delete coffee +*FakeApi* | [**endpoint_parameters**](docs/apis/tags/FakeApi.md#endpoint_parameters) | **post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**enum_parameters**](docs/apis/tags/FakeApi.md#enum_parameters) | **get** /fake | To test enum parameters +*FakeApi* | [**fake_health_get**](docs/apis/tags/FakeApi.md#fake_health_get) | **get** /fake/health | Health check endpoint +*FakeApi* | [**group_parameters**](docs/apis/tags/FakeApi.md#group_parameters) | **delete** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**inline_additional_properties**](docs/apis/tags/FakeApi.md#inline_additional_properties) | **post** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**inline_composition**](docs/apis/tags/FakeApi.md#inline_composition) | **post** /fake/inlineComposition/ | testing composed schemas at inline locations +*FakeApi* | [**json_form_data**](docs/apis/tags/FakeApi.md#json_form_data) | **get** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**json_patch**](docs/apis/tags/FakeApi.md#json_patch) | **patch** /fake/jsonPatch | json patch +*FakeApi* | [**json_with_charset**](docs/apis/tags/FakeApi.md#json_with_charset) | **post** /fake/jsonWithCharset | json with charset tx and rx +*FakeApi* | [**mammal**](docs/apis/tags/FakeApi.md#mammal) | **post** /fake/refs/mammal | +*FakeApi* | [**number_with_validations**](docs/apis/tags/FakeApi.md#number_with_validations) | **post** /fake/refs/number | +*FakeApi* | [**object_in_query**](docs/apis/tags/FakeApi.md#object_in_query) | **get** /fake/objInQuery | user list +*FakeApi* | [**object_model_with_ref_props**](docs/apis/tags/FakeApi.md#object_model_with_ref_props) | **post** /fake/refs/object_model_with_ref_props | +*FakeApi* | [**parameter_collisions**](docs/apis/tags/FakeApi.md#parameter_collisions) | **post** /fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/ | parameter collision case +*FakeApi* | [**query_parameter_collection_format**](docs/apis/tags/FakeApi.md#query_parameter_collection_format) | **put** /fake/test-query-paramters | +*FakeApi* | [**ref_object_in_query**](docs/apis/tags/FakeApi.md#ref_object_in_query) | **get** /fake/refObjInQuery | user list +*FakeApi* | [**response_without_schema**](docs/apis/tags/FakeApi.md#response_without_schema) | **get** /fake/responseWithoutSchema | receives a response without schema +*FakeApi* | [**string**](docs/apis/tags/FakeApi.md#string) | **post** /fake/refs/string | +*FakeApi* | [**string_enum**](docs/apis/tags/FakeApi.md#string_enum) | **post** /fake/refs/enum | +*FakeApi* | [**upload_download_file**](docs/apis/tags/FakeApi.md#upload_download_file) | **post** /fake/uploadDownloadFile | uploads a file and downloads a file using application/octet-stream +*FakeApi* | [**upload_file**](docs/apis/tags/FakeApi.md#upload_file) | **post** /fake/uploadFile | uploads a file using multipart/form-data +*FakeApi* | [**upload_files**](docs/apis/tags/FakeApi.md#upload_files) | **post** /fake/uploadFiles | uploads files using multipart/form-data +*FakeClassnameTags123Api* | [**classname**](docs/apis/tags/FakeClassnameTags123Api.md#classname) | **patch** /fake_classname_test | To test class name in snake case +*PetApi* | [**add_pet**](docs/apis/tags/PetApi.md#add_pet) | **post** /pet | Add a new pet to the store +*PetApi* | [**delete_pet**](docs/apis/tags/PetApi.md#delete_pet) | **delete** /pet/{petId} | Deletes a pet +*PetApi* | [**find_pets_by_status**](docs/apis/tags/PetApi.md#find_pets_by_status) | **get** /pet/findByStatus | Finds Pets by status +*PetApi* | [**find_pets_by_tags**](docs/apis/tags/PetApi.md#find_pets_by_tags) | **get** /pet/findByTags | Finds Pets by tags +*PetApi* | [**get_pet_by_id**](docs/apis/tags/PetApi.md#get_pet_by_id) | **get** /pet/{petId} | Find pet by ID +*PetApi* | [**update_pet**](docs/apis/tags/PetApi.md#update_pet) | **put** /pet | Update an existing pet +*PetApi* | [**update_pet_with_form**](docs/apis/tags/PetApi.md#update_pet_with_form) | **post** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**upload_file_with_required_file**](docs/apis/tags/PetApi.md#upload_file_with_required_file) | **post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*PetApi* | [**upload_image**](docs/apis/tags/PetApi.md#upload_image) | **post** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**delete_order**](docs/apis/tags/StoreApi.md#delete_order) | **delete** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**get_inventory**](docs/apis/tags/StoreApi.md#get_inventory) | **get** /store/inventory | Returns pet inventories by status +*StoreApi* | [**get_order_by_id**](docs/apis/tags/StoreApi.md#get_order_by_id) | **get** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**place_order**](docs/apis/tags/StoreApi.md#place_order) | **post** /store/order | Place an order for a pet +*UserApi* | [**create_user**](docs/apis/tags/UserApi.md#create_user) | **post** /user | Create user +*UserApi* | [**create_users_with_array_input**](docs/apis/tags/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/apis/tags/UserApi.md#create_users_with_list_input) | **post** /user/createWithList | Creates list of users with given input array +*UserApi* | [**delete_user**](docs/apis/tags/UserApi.md#delete_user) | **delete** /user/{username} | Delete user +*UserApi* | [**get_user_by_name**](docs/apis/tags/UserApi.md#get_user_by_name) | **get** /user/{username} | Get user by user name +*UserApi* | [**login_user**](docs/apis/tags/UserApi.md#login_user) | **get** /user/login | Logs user into the system +*UserApi* | [**logout_user**](docs/apis/tags/UserApi.md#logout_user) | **get** /user/logout | Logs out current logged in user session +*UserApi* | [**update_user**](docs/apis/tags/UserApi.md#update_user) | **put** /user/{username} | Updated user ## Documentation For Models - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [AdditionalPropertiesWithArrayOfEnums](docs/AdditionalPropertiesWithArrayOfEnums.md) - - [Address](docs/Address.md) - - [Animal](docs/Animal.md) - - [AnimalFarm](docs/AnimalFarm.md) - - [ApiResponse](docs/ApiResponse.md) - - [Apple](docs/Apple.md) - - [AppleReq](docs/AppleReq.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfEnums](docs/ArrayOfEnums.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [Banana](docs/Banana.md) - - [BananaReq](docs/BananaReq.md) - - [BasquePig](docs/BasquePig.md) - - [BooleanEnum](docs/BooleanEnum.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [ChildCat](docs/ChildCat.md) - - [ChildCatAllOf](docs/ChildCatAllOf.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [ComplexQuadrilateral](docs/ComplexQuadrilateral.md) - - [ComposedOneOfNumberWithValidations](docs/ComposedOneOfNumberWithValidations.md) - - [ComposedSchemaWithPropsAndNoAddProps](docs/ComposedSchemaWithPropsAndNoAddProps.md) - - [DanishPig](docs/DanishPig.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [Drawing](docs/Drawing.md) - - [EgressThresholdOptions](docs/EgressThresholdOptions.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [EquilateralTriangle](docs/EquilateralTriangle.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [Foo](docs/Foo.md) - - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md) - - [FooObject](docs/FooObject.md) - - [FormatTest](docs/FormatTest.md) - - [Fruit](docs/Fruit.md) - - [FruitReq](docs/FruitReq.md) - - [GmFruit](docs/GmFruit.md) - - [GmFruitNoProperties](docs/GmFruitNoProperties.md) - - [GrandparentAnimal](docs/GrandparentAnimal.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [HealthCheckResult](docs/HealthCheckResult.md) - - [InlineAdditionalPropertiesRefPayload](docs/InlineAdditionalPropertiesRefPayload.md) - - [IntegerEnum](docs/IntegerEnum.md) - - [IntegerEnumOneValue](docs/IntegerEnumOneValue.md) - - [IntegerEnumWithDefaultValue](docs/IntegerEnumWithDefaultValue.md) - - [IsoscelesTriangle](docs/IsoscelesTriangle.md) - - [Legs](docs/Legs.md) - - [List](docs/List.md) - - [Mammal](docs/Mammal.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [ModelReturn](docs/ModelReturn.md) - - [Mole](docs/Mole.md) - - [Name](docs/Name.md) - - [NullableClass](docs/NullableClass.md) - - [NullableShape](docs/NullableShape.md) - - [NumberOnly](docs/NumberOnly.md) - - [NumberWithValidations](docs/NumberWithValidations.md) - - [ObjectInterface](docs/ObjectInterface.md) - - [ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) - - [ObjectWithValidations](docs/ObjectWithValidations.md) - - [Order](docs/Order.md) - - [ParentPet](docs/ParentPet.md) - - [Pet](docs/Pet.md) - - [Pig](docs/Pig.md) - - [PostInlineAdditionalPropertiesPayloadRequest](docs/PostInlineAdditionalPropertiesPayloadRequest.md) - - [PostInlineAdditionalPropertiesPayloadRequestArrayDataInner](docs/PostInlineAdditionalPropertiesPayloadRequestArrayDataInner.md) - - [PublishOptions](docs/PublishOptions.md) - - [PublishOptionsPublish](docs/PublishOptionsPublish.md) - - [Quadrilateral](docs/Quadrilateral.md) - - [QuadrilateralInterface](docs/QuadrilateralInterface.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [Readonly](docs/Readonly.md) - - [ScaleneTriangle](docs/ScaleneTriangle.md) - - [Shape](docs/Shape.md) - - [ShapeInterface](docs/ShapeInterface.md) - - [ShapeOrNull](docs/ShapeOrNull.md) - - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - - [SomeObject](docs/SomeObject.md) - - [SomeObjectWithSelfAttr](docs/SomeObjectWithSelfAttr.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [StreamOptions](docs/StreamOptions.md) - - [StringBooleanMap](docs/StringBooleanMap.md) - - [StringEnum](docs/StringEnum.md) - - [StringEnumWithDefaultValue](docs/StringEnumWithDefaultValue.md) - - [Tag](docs/Tag.md) - - [Triangle](docs/Triangle.md) - - [TriangleInterface](docs/TriangleInterface.md) - - [User](docs/User.md) - - [Whale](docs/Whale.md) - - [Zebra](docs/Zebra.md) - + - [AdditionalPropertiesClass](docs/models/AdditionalPropertiesClass.md) + - [AdditionalPropertiesValidator](docs/models/AdditionalPropertiesValidator.md) + - [AdditionalPropertiesWithArrayOfEnums](docs/models/AdditionalPropertiesWithArrayOfEnums.md) + - [Address](docs/models/Address.md) + - [Animal](docs/models/Animal.md) + - [AnimalFarm](docs/models/AnimalFarm.md) + - [AnyTypeAndFormat](docs/models/AnyTypeAndFormat.md) + - [AnyTypeNotString](docs/models/AnyTypeNotString.md) + - [ApiResponse](docs/models/ApiResponse.md) + - [Apple](docs/models/Apple.md) + - [AppleReq](docs/models/AppleReq.md) + - [ArrayHoldingAnyType](docs/models/ArrayHoldingAnyType.md) + - [ArrayOfArrayOfNumberOnly](docs/models/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfEnums](docs/models/ArrayOfEnums.md) + - [ArrayOfNumberOnly](docs/models/ArrayOfNumberOnly.md) + - [ArrayTest](docs/models/ArrayTest.md) + - [ArrayWithValidationsInItems](docs/models/ArrayWithValidationsInItems.md) + - [Banana](docs/models/Banana.md) + - [BananaReq](docs/models/BananaReq.md) + - [Bar](docs/models/Bar.md) + - [BasquePig](docs/models/BasquePig.md) + - [Boolean](docs/models/Boolean.md) + - [BooleanEnum](docs/models/BooleanEnum.md) + - [Capitalization](docs/models/Capitalization.md) + - [Cat](docs/models/Cat.md) + - [Category](docs/models/Category.md) + - [ChildCat](docs/models/ChildCat.md) + - [ClassModel](docs/models/ClassModel.md) + - [Client](docs/models/Client.md) + - [ComplexQuadrilateral](docs/models/ComplexQuadrilateral.md) + - [ComposedAnyOfDifferentTypesNoValidations](docs/models/ComposedAnyOfDifferentTypesNoValidations.md) + - [ComposedArray](docs/models/ComposedArray.md) + - [ComposedBool](docs/models/ComposedBool.md) + - [ComposedNone](docs/models/ComposedNone.md) + - [ComposedNumber](docs/models/ComposedNumber.md) + - [ComposedObject](docs/models/ComposedObject.md) + - [ComposedOneOfDifferentTypes](docs/models/ComposedOneOfDifferentTypes.md) + - [ComposedString](docs/models/ComposedString.md) + - [Currency](docs/models/Currency.md) + - [DanishPig](docs/models/DanishPig.md) + - [DateTimeTest](docs/models/DateTimeTest.md) + - [DateTimeWithValidations](docs/models/DateTimeWithValidations.md) + - [DateWithValidations](docs/models/DateWithValidations.md) + - [DecimalPayload](docs/models/DecimalPayload.md) + - [Dog](docs/models/Dog.md) + - [Drawing](docs/models/Drawing.md) + - [EnumArrays](docs/models/EnumArrays.md) + - [EnumClass](docs/models/EnumClass.md) + - [EnumTest](docs/models/EnumTest.md) + - [EquilateralTriangle](docs/models/EquilateralTriangle.md) + - [File](docs/models/File.md) + - [FileSchemaTestClass](docs/models/FileSchemaTestClass.md) + - [Foo](docs/models/Foo.md) + - [FormatTest](docs/models/FormatTest.md) + - [Fruit](docs/models/Fruit.md) + - [FruitReq](docs/models/FruitReq.md) + - [GmFruit](docs/models/GmFruit.md) + - [GrandparentAnimal](docs/models/GrandparentAnimal.md) + - [HasOnlyReadOnly](docs/models/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/models/HealthCheckResult.md) + - [IntegerEnum](docs/models/IntegerEnum.md) + - [IntegerEnumBig](docs/models/IntegerEnumBig.md) + - [IntegerEnumOneValue](docs/models/IntegerEnumOneValue.md) + - [IntegerEnumWithDefaultValue](docs/models/IntegerEnumWithDefaultValue.md) + - [IntegerMax10](docs/models/IntegerMax10.md) + - [IntegerMin15](docs/models/IntegerMin15.md) + - [IsoscelesTriangle](docs/models/IsoscelesTriangle.md) + - [JSONPatchRequest](docs/models/JSONPatchRequest.md) + - [JSONPatchRequestAddReplaceTest](docs/models/JSONPatchRequestAddReplaceTest.md) + - [JSONPatchRequestMoveCopy](docs/models/JSONPatchRequestMoveCopy.md) + - [JSONPatchRequestRemove](docs/models/JSONPatchRequestRemove.md) + - [Mammal](docs/models/Mammal.md) + - [MapTest](docs/models/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/models/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/models/Model200Response.md) + - [ModelReturn](docs/models/ModelReturn.md) + - [Money](docs/models/Money.md) + - [Name](docs/models/Name.md) + - [NoAdditionalProperties](docs/models/NoAdditionalProperties.md) + - [NullableClass](docs/models/NullableClass.md) + - [NullableShape](docs/models/NullableShape.md) + - [NullableString](docs/models/NullableString.md) + - [Number](docs/models/Number.md) + - [NumberOnly](docs/models/NumberOnly.md) + - [NumberWithValidations](docs/models/NumberWithValidations.md) + - [ObjectInterface](docs/models/ObjectInterface.md) + - [ObjectModelWithRefProps](docs/models/ObjectModelWithRefProps.md) + - [ObjectWithDecimalProperties](docs/models/ObjectWithDecimalProperties.md) + - [ObjectWithDifficultlyNamedProps](docs/models/ObjectWithDifficultlyNamedProps.md) + - [ObjectWithInlineCompositionProperty](docs/models/ObjectWithInlineCompositionProperty.md) + - [ObjectWithValidations](docs/models/ObjectWithValidations.md) + - [Order](docs/models/Order.md) + - [ParentPet](docs/models/ParentPet.md) + - [Pet](docs/models/Pet.md) + - [Pig](docs/models/Pig.md) + - [Player](docs/models/Player.md) + - [Quadrilateral](docs/models/Quadrilateral.md) + - [QuadrilateralInterface](docs/models/QuadrilateralInterface.md) + - [ReadOnlyFirst](docs/models/ReadOnlyFirst.md) + - [ScaleneTriangle](docs/models/ScaleneTriangle.md) + - [Shape](docs/models/Shape.md) + - [ShapeOrNull](docs/models/ShapeOrNull.md) + - [SimpleQuadrilateral](docs/models/SimpleQuadrilateral.md) + - [SomeObject](docs/models/SomeObject.md) + - [SpecialModelName](docs/models/SpecialModelName.md) + - [String](docs/models/String.md) + - [StringBooleanMap](docs/models/StringBooleanMap.md) + - [StringEnum](docs/models/StringEnum.md) + - [StringEnumWithDefaultValue](docs/models/StringEnumWithDefaultValue.md) + - [StringWithValidation](docs/models/StringWithValidation.md) + - [Tag](docs/models/Tag.md) + - [Triangle](docs/models/Triangle.md) + - [TriangleInterface](docs/models/TriangleInterface.md) + - [UUIDString](docs/models/UUIDString.md) + - [User](docs/models/User.md) + - [Whale](docs/models/Whale.md) + - [Zebra](docs/models/Zebra.md) ## Documentation For Authorization @@ -269,7 +379,7 @@ Class | Method | HTTP request | Description - **Type**: HTTP signature authentication - + Authentication schemes defined for the API: ## petstore_auth - **Type**: OAuth @@ -285,16 +395,21 @@ Class | Method | HTTP request | Description + + + + + ## Notes for Large OpenAPI documents If the OpenAPI document is large, imports in petstore_api.apis and petstore_api.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: Solution 1: Use specific imports for apis and models like: -- `from petstore_api.api.default_api import DefaultApi` +- `from petstore_api.apis.default_api import DefaultApi` - `from petstore_api.model.pet import Pet` -Solution 2: +Solution 1: Before importing the package, adjust the maximum recursion limit as shown below: ``` import sys @@ -303,4 +418,3 @@ import petstore_api from petstore_api.apis import * from petstore_api.models import * ``` - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/apis/tags/AnotherFakeApi.md b/samples/openapi3/client/petstore/python/docs/apis/tags/AnotherFakeApi.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/apis/tags/AnotherFakeApi.md rename to samples/openapi3/client/petstore/python/docs/apis/tags/AnotherFakeApi.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/apis/tags/DefaultApi.md b/samples/openapi3/client/petstore/python/docs/apis/tags/DefaultApi.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/apis/tags/DefaultApi.md rename to samples/openapi3/client/petstore/python/docs/apis/tags/DefaultApi.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/apis/tags/FakeApi.md b/samples/openapi3/client/petstore/python/docs/apis/tags/FakeApi.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/apis/tags/FakeApi.md rename to samples/openapi3/client/petstore/python/docs/apis/tags/FakeApi.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/apis/tags/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python/docs/apis/tags/FakeClassnameTags123Api.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/apis/tags/FakeClassnameTags123Api.md rename to samples/openapi3/client/petstore/python/docs/apis/tags/FakeClassnameTags123Api.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/apis/tags/PetApi.md b/samples/openapi3/client/petstore/python/docs/apis/tags/PetApi.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/apis/tags/PetApi.md rename to samples/openapi3/client/petstore/python/docs/apis/tags/PetApi.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/apis/tags/StoreApi.md b/samples/openapi3/client/petstore/python/docs/apis/tags/StoreApi.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/apis/tags/StoreApi.md rename to samples/openapi3/client/petstore/python/docs/apis/tags/StoreApi.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/apis/tags/UserApi.md b/samples/openapi3/client/petstore/python/docs/apis/tags/UserApi.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/apis/tags/UserApi.md rename to samples/openapi3/client/petstore/python/docs/apis/tags/UserApi.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python/docs/models/AdditionalPropertiesClass.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/AdditionalPropertiesClass.md rename to samples/openapi3/client/petstore/python/docs/models/AdditionalPropertiesClass.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/AdditionalPropertiesValidator.md b/samples/openapi3/client/petstore/python/docs/models/AdditionalPropertiesValidator.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/AdditionalPropertiesValidator.md rename to samples/openapi3/client/petstore/python/docs/models/AdditionalPropertiesValidator.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/AdditionalPropertiesWithArrayOfEnums.md b/samples/openapi3/client/petstore/python/docs/models/AdditionalPropertiesWithArrayOfEnums.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/AdditionalPropertiesWithArrayOfEnums.md rename to samples/openapi3/client/petstore/python/docs/models/AdditionalPropertiesWithArrayOfEnums.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Address.md b/samples/openapi3/client/petstore/python/docs/models/Address.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Address.md rename to samples/openapi3/client/petstore/python/docs/models/Address.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Animal.md b/samples/openapi3/client/petstore/python/docs/models/Animal.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Animal.md rename to samples/openapi3/client/petstore/python/docs/models/Animal.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/AnimalFarm.md b/samples/openapi3/client/petstore/python/docs/models/AnimalFarm.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/AnimalFarm.md rename to samples/openapi3/client/petstore/python/docs/models/AnimalFarm.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/AnyTypeAndFormat.md b/samples/openapi3/client/petstore/python/docs/models/AnyTypeAndFormat.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/AnyTypeAndFormat.md rename to samples/openapi3/client/petstore/python/docs/models/AnyTypeAndFormat.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/AnyTypeNotString.md b/samples/openapi3/client/petstore/python/docs/models/AnyTypeNotString.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/AnyTypeNotString.md rename to samples/openapi3/client/petstore/python/docs/models/AnyTypeNotString.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ApiResponse.md b/samples/openapi3/client/petstore/python/docs/models/ApiResponse.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ApiResponse.md rename to samples/openapi3/client/petstore/python/docs/models/ApiResponse.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Apple.md b/samples/openapi3/client/petstore/python/docs/models/Apple.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Apple.md rename to samples/openapi3/client/petstore/python/docs/models/Apple.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/AppleReq.md b/samples/openapi3/client/petstore/python/docs/models/AppleReq.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/AppleReq.md rename to samples/openapi3/client/petstore/python/docs/models/AppleReq.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ArrayHoldingAnyType.md b/samples/openapi3/client/petstore/python/docs/models/ArrayHoldingAnyType.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ArrayHoldingAnyType.md rename to samples/openapi3/client/petstore/python/docs/models/ArrayHoldingAnyType.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python/docs/models/ArrayOfArrayOfNumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ArrayOfArrayOfNumberOnly.md rename to samples/openapi3/client/petstore/python/docs/models/ArrayOfArrayOfNumberOnly.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ArrayOfEnums.md b/samples/openapi3/client/petstore/python/docs/models/ArrayOfEnums.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ArrayOfEnums.md rename to samples/openapi3/client/petstore/python/docs/models/ArrayOfEnums.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python/docs/models/ArrayOfNumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ArrayOfNumberOnly.md rename to samples/openapi3/client/petstore/python/docs/models/ArrayOfNumberOnly.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ArrayTest.md b/samples/openapi3/client/petstore/python/docs/models/ArrayTest.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ArrayTest.md rename to samples/openapi3/client/petstore/python/docs/models/ArrayTest.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ArrayWithValidationsInItems.md b/samples/openapi3/client/petstore/python/docs/models/ArrayWithValidationsInItems.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ArrayWithValidationsInItems.md rename to samples/openapi3/client/petstore/python/docs/models/ArrayWithValidationsInItems.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Banana.md b/samples/openapi3/client/petstore/python/docs/models/Banana.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Banana.md rename to samples/openapi3/client/petstore/python/docs/models/Banana.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/BananaReq.md b/samples/openapi3/client/petstore/python/docs/models/BananaReq.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/BananaReq.md rename to samples/openapi3/client/petstore/python/docs/models/BananaReq.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Bar.md b/samples/openapi3/client/petstore/python/docs/models/Bar.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Bar.md rename to samples/openapi3/client/petstore/python/docs/models/Bar.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/BasquePig.md b/samples/openapi3/client/petstore/python/docs/models/BasquePig.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/BasquePig.md rename to samples/openapi3/client/petstore/python/docs/models/BasquePig.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Boolean.md b/samples/openapi3/client/petstore/python/docs/models/Boolean.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Boolean.md rename to samples/openapi3/client/petstore/python/docs/models/Boolean.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/BooleanEnum.md b/samples/openapi3/client/petstore/python/docs/models/BooleanEnum.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/BooleanEnum.md rename to samples/openapi3/client/petstore/python/docs/models/BooleanEnum.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Capitalization.md b/samples/openapi3/client/petstore/python/docs/models/Capitalization.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Capitalization.md rename to samples/openapi3/client/petstore/python/docs/models/Capitalization.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Cat.md b/samples/openapi3/client/petstore/python/docs/models/Cat.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Cat.md rename to samples/openapi3/client/petstore/python/docs/models/Cat.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Category.md b/samples/openapi3/client/petstore/python/docs/models/Category.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Category.md rename to samples/openapi3/client/petstore/python/docs/models/Category.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ChildCat.md b/samples/openapi3/client/petstore/python/docs/models/ChildCat.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ChildCat.md rename to samples/openapi3/client/petstore/python/docs/models/ChildCat.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ClassModel.md b/samples/openapi3/client/petstore/python/docs/models/ClassModel.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ClassModel.md rename to samples/openapi3/client/petstore/python/docs/models/ClassModel.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Client.md b/samples/openapi3/client/petstore/python/docs/models/Client.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Client.md rename to samples/openapi3/client/petstore/python/docs/models/Client.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ComplexQuadrilateral.md b/samples/openapi3/client/petstore/python/docs/models/ComplexQuadrilateral.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ComplexQuadrilateral.md rename to samples/openapi3/client/petstore/python/docs/models/ComplexQuadrilateral.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ComposedAnyOfDifferentTypesNoValidations.md b/samples/openapi3/client/petstore/python/docs/models/ComposedAnyOfDifferentTypesNoValidations.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ComposedAnyOfDifferentTypesNoValidations.md rename to samples/openapi3/client/petstore/python/docs/models/ComposedAnyOfDifferentTypesNoValidations.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ComposedArray.md b/samples/openapi3/client/petstore/python/docs/models/ComposedArray.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ComposedArray.md rename to samples/openapi3/client/petstore/python/docs/models/ComposedArray.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ComposedBool.md b/samples/openapi3/client/petstore/python/docs/models/ComposedBool.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ComposedBool.md rename to samples/openapi3/client/petstore/python/docs/models/ComposedBool.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ComposedNone.md b/samples/openapi3/client/petstore/python/docs/models/ComposedNone.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ComposedNone.md rename to samples/openapi3/client/petstore/python/docs/models/ComposedNone.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ComposedNumber.md b/samples/openapi3/client/petstore/python/docs/models/ComposedNumber.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ComposedNumber.md rename to samples/openapi3/client/petstore/python/docs/models/ComposedNumber.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ComposedObject.md b/samples/openapi3/client/petstore/python/docs/models/ComposedObject.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ComposedObject.md rename to samples/openapi3/client/petstore/python/docs/models/ComposedObject.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ComposedOneOfDifferentTypes.md b/samples/openapi3/client/petstore/python/docs/models/ComposedOneOfDifferentTypes.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ComposedOneOfDifferentTypes.md rename to samples/openapi3/client/petstore/python/docs/models/ComposedOneOfDifferentTypes.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ComposedString.md b/samples/openapi3/client/petstore/python/docs/models/ComposedString.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ComposedString.md rename to samples/openapi3/client/petstore/python/docs/models/ComposedString.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Currency.md b/samples/openapi3/client/petstore/python/docs/models/Currency.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Currency.md rename to samples/openapi3/client/petstore/python/docs/models/Currency.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/DanishPig.md b/samples/openapi3/client/petstore/python/docs/models/DanishPig.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/DanishPig.md rename to samples/openapi3/client/petstore/python/docs/models/DanishPig.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/DateTimeTest.md b/samples/openapi3/client/petstore/python/docs/models/DateTimeTest.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/DateTimeTest.md rename to samples/openapi3/client/petstore/python/docs/models/DateTimeTest.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/DateTimeWithValidations.md b/samples/openapi3/client/petstore/python/docs/models/DateTimeWithValidations.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/DateTimeWithValidations.md rename to samples/openapi3/client/petstore/python/docs/models/DateTimeWithValidations.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/DateWithValidations.md b/samples/openapi3/client/petstore/python/docs/models/DateWithValidations.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/DateWithValidations.md rename to samples/openapi3/client/petstore/python/docs/models/DateWithValidations.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/DecimalPayload.md b/samples/openapi3/client/petstore/python/docs/models/DecimalPayload.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/DecimalPayload.md rename to samples/openapi3/client/petstore/python/docs/models/DecimalPayload.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Dog.md b/samples/openapi3/client/petstore/python/docs/models/Dog.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Dog.md rename to samples/openapi3/client/petstore/python/docs/models/Dog.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Drawing.md b/samples/openapi3/client/petstore/python/docs/models/Drawing.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Drawing.md rename to samples/openapi3/client/petstore/python/docs/models/Drawing.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/EnumArrays.md b/samples/openapi3/client/petstore/python/docs/models/EnumArrays.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/EnumArrays.md rename to samples/openapi3/client/petstore/python/docs/models/EnumArrays.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/EnumClass.md b/samples/openapi3/client/petstore/python/docs/models/EnumClass.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/EnumClass.md rename to samples/openapi3/client/petstore/python/docs/models/EnumClass.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/EnumTest.md b/samples/openapi3/client/petstore/python/docs/models/EnumTest.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/EnumTest.md rename to samples/openapi3/client/petstore/python/docs/models/EnumTest.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/EquilateralTriangle.md b/samples/openapi3/client/petstore/python/docs/models/EquilateralTriangle.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/EquilateralTriangle.md rename to samples/openapi3/client/petstore/python/docs/models/EquilateralTriangle.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/File.md b/samples/openapi3/client/petstore/python/docs/models/File.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/File.md rename to samples/openapi3/client/petstore/python/docs/models/File.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python/docs/models/FileSchemaTestClass.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/FileSchemaTestClass.md rename to samples/openapi3/client/petstore/python/docs/models/FileSchemaTestClass.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Foo.md b/samples/openapi3/client/petstore/python/docs/models/Foo.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Foo.md rename to samples/openapi3/client/petstore/python/docs/models/Foo.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/FormatTest.md b/samples/openapi3/client/petstore/python/docs/models/FormatTest.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/FormatTest.md rename to samples/openapi3/client/petstore/python/docs/models/FormatTest.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Fruit.md b/samples/openapi3/client/petstore/python/docs/models/Fruit.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Fruit.md rename to samples/openapi3/client/petstore/python/docs/models/Fruit.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/FruitReq.md b/samples/openapi3/client/petstore/python/docs/models/FruitReq.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/FruitReq.md rename to samples/openapi3/client/petstore/python/docs/models/FruitReq.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/GmFruit.md b/samples/openapi3/client/petstore/python/docs/models/GmFruit.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/GmFruit.md rename to samples/openapi3/client/petstore/python/docs/models/GmFruit.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/GrandparentAnimal.md b/samples/openapi3/client/petstore/python/docs/models/GrandparentAnimal.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/GrandparentAnimal.md rename to samples/openapi3/client/petstore/python/docs/models/GrandparentAnimal.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python/docs/models/HasOnlyReadOnly.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/HasOnlyReadOnly.md rename to samples/openapi3/client/petstore/python/docs/models/HasOnlyReadOnly.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/HealthCheckResult.md b/samples/openapi3/client/petstore/python/docs/models/HealthCheckResult.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/HealthCheckResult.md rename to samples/openapi3/client/petstore/python/docs/models/HealthCheckResult.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/IntegerEnum.md b/samples/openapi3/client/petstore/python/docs/models/IntegerEnum.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/IntegerEnum.md rename to samples/openapi3/client/petstore/python/docs/models/IntegerEnum.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/IntegerEnumBig.md b/samples/openapi3/client/petstore/python/docs/models/IntegerEnumBig.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/IntegerEnumBig.md rename to samples/openapi3/client/petstore/python/docs/models/IntegerEnumBig.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/IntegerEnumOneValue.md b/samples/openapi3/client/petstore/python/docs/models/IntegerEnumOneValue.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/IntegerEnumOneValue.md rename to samples/openapi3/client/petstore/python/docs/models/IntegerEnumOneValue.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/IntegerEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python/docs/models/IntegerEnumWithDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/IntegerEnumWithDefaultValue.md rename to samples/openapi3/client/petstore/python/docs/models/IntegerEnumWithDefaultValue.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/IntegerMax10.md b/samples/openapi3/client/petstore/python/docs/models/IntegerMax10.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/IntegerMax10.md rename to samples/openapi3/client/petstore/python/docs/models/IntegerMax10.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/IntegerMin15.md b/samples/openapi3/client/petstore/python/docs/models/IntegerMin15.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/IntegerMin15.md rename to samples/openapi3/client/petstore/python/docs/models/IntegerMin15.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/IsoscelesTriangle.md b/samples/openapi3/client/petstore/python/docs/models/IsoscelesTriangle.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/IsoscelesTriangle.md rename to samples/openapi3/client/petstore/python/docs/models/IsoscelesTriangle.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/JSONPatchRequest.md b/samples/openapi3/client/petstore/python/docs/models/JSONPatchRequest.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/JSONPatchRequest.md rename to samples/openapi3/client/petstore/python/docs/models/JSONPatchRequest.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/JSONPatchRequestAddReplaceTest.md b/samples/openapi3/client/petstore/python/docs/models/JSONPatchRequestAddReplaceTest.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/JSONPatchRequestAddReplaceTest.md rename to samples/openapi3/client/petstore/python/docs/models/JSONPatchRequestAddReplaceTest.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/JSONPatchRequestMoveCopy.md b/samples/openapi3/client/petstore/python/docs/models/JSONPatchRequestMoveCopy.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/JSONPatchRequestMoveCopy.md rename to samples/openapi3/client/petstore/python/docs/models/JSONPatchRequestMoveCopy.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/JSONPatchRequestRemove.md b/samples/openapi3/client/petstore/python/docs/models/JSONPatchRequestRemove.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/JSONPatchRequestRemove.md rename to samples/openapi3/client/petstore/python/docs/models/JSONPatchRequestRemove.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Mammal.md b/samples/openapi3/client/petstore/python/docs/models/Mammal.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Mammal.md rename to samples/openapi3/client/petstore/python/docs/models/Mammal.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/MapTest.md b/samples/openapi3/client/petstore/python/docs/models/MapTest.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/MapTest.md rename to samples/openapi3/client/petstore/python/docs/models/MapTest.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md rename to samples/openapi3/client/petstore/python/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Model200Response.md b/samples/openapi3/client/petstore/python/docs/models/Model200Response.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Model200Response.md rename to samples/openapi3/client/petstore/python/docs/models/Model200Response.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ModelReturn.md b/samples/openapi3/client/petstore/python/docs/models/ModelReturn.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ModelReturn.md rename to samples/openapi3/client/petstore/python/docs/models/ModelReturn.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Money.md b/samples/openapi3/client/petstore/python/docs/models/Money.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Money.md rename to samples/openapi3/client/petstore/python/docs/models/Money.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Name.md b/samples/openapi3/client/petstore/python/docs/models/Name.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Name.md rename to samples/openapi3/client/petstore/python/docs/models/Name.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/NoAdditionalProperties.md b/samples/openapi3/client/petstore/python/docs/models/NoAdditionalProperties.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/NoAdditionalProperties.md rename to samples/openapi3/client/petstore/python/docs/models/NoAdditionalProperties.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/NullableClass.md b/samples/openapi3/client/petstore/python/docs/models/NullableClass.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/NullableClass.md rename to samples/openapi3/client/petstore/python/docs/models/NullableClass.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/NullableShape.md b/samples/openapi3/client/petstore/python/docs/models/NullableShape.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/NullableShape.md rename to samples/openapi3/client/petstore/python/docs/models/NullableShape.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/NullableString.md b/samples/openapi3/client/petstore/python/docs/models/NullableString.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/NullableString.md rename to samples/openapi3/client/petstore/python/docs/models/NullableString.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Number.md b/samples/openapi3/client/petstore/python/docs/models/Number.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Number.md rename to samples/openapi3/client/petstore/python/docs/models/Number.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/NumberOnly.md b/samples/openapi3/client/petstore/python/docs/models/NumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/NumberOnly.md rename to samples/openapi3/client/petstore/python/docs/models/NumberOnly.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/NumberWithValidations.md b/samples/openapi3/client/petstore/python/docs/models/NumberWithValidations.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/NumberWithValidations.md rename to samples/openapi3/client/petstore/python/docs/models/NumberWithValidations.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ObjectInterface.md b/samples/openapi3/client/petstore/python/docs/models/ObjectInterface.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ObjectInterface.md rename to samples/openapi3/client/petstore/python/docs/models/ObjectInterface.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ObjectModelWithRefProps.md b/samples/openapi3/client/petstore/python/docs/models/ObjectModelWithRefProps.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ObjectModelWithRefProps.md rename to samples/openapi3/client/petstore/python/docs/models/ObjectModelWithRefProps.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ObjectWithDecimalProperties.md b/samples/openapi3/client/petstore/python/docs/models/ObjectWithDecimalProperties.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ObjectWithDecimalProperties.md rename to samples/openapi3/client/petstore/python/docs/models/ObjectWithDecimalProperties.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ObjectWithDifficultlyNamedProps.md b/samples/openapi3/client/petstore/python/docs/models/ObjectWithDifficultlyNamedProps.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ObjectWithDifficultlyNamedProps.md rename to samples/openapi3/client/petstore/python/docs/models/ObjectWithDifficultlyNamedProps.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ObjectWithInlineCompositionProperty.md b/samples/openapi3/client/petstore/python/docs/models/ObjectWithInlineCompositionProperty.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ObjectWithInlineCompositionProperty.md rename to samples/openapi3/client/petstore/python/docs/models/ObjectWithInlineCompositionProperty.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ObjectWithValidations.md b/samples/openapi3/client/petstore/python/docs/models/ObjectWithValidations.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ObjectWithValidations.md rename to samples/openapi3/client/petstore/python/docs/models/ObjectWithValidations.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Order.md b/samples/openapi3/client/petstore/python/docs/models/Order.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Order.md rename to samples/openapi3/client/petstore/python/docs/models/Order.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ParentPet.md b/samples/openapi3/client/petstore/python/docs/models/ParentPet.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ParentPet.md rename to samples/openapi3/client/petstore/python/docs/models/ParentPet.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Pet.md b/samples/openapi3/client/petstore/python/docs/models/Pet.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Pet.md rename to samples/openapi3/client/petstore/python/docs/models/Pet.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Pig.md b/samples/openapi3/client/petstore/python/docs/models/Pig.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Pig.md rename to samples/openapi3/client/petstore/python/docs/models/Pig.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Player.md b/samples/openapi3/client/petstore/python/docs/models/Player.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Player.md rename to samples/openapi3/client/petstore/python/docs/models/Player.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Quadrilateral.md b/samples/openapi3/client/petstore/python/docs/models/Quadrilateral.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Quadrilateral.md rename to samples/openapi3/client/petstore/python/docs/models/Quadrilateral.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/QuadrilateralInterface.md b/samples/openapi3/client/petstore/python/docs/models/QuadrilateralInterface.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/QuadrilateralInterface.md rename to samples/openapi3/client/petstore/python/docs/models/QuadrilateralInterface.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python/docs/models/ReadOnlyFirst.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ReadOnlyFirst.md rename to samples/openapi3/client/petstore/python/docs/models/ReadOnlyFirst.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ScaleneTriangle.md b/samples/openapi3/client/petstore/python/docs/models/ScaleneTriangle.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ScaleneTriangle.md rename to samples/openapi3/client/petstore/python/docs/models/ScaleneTriangle.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Shape.md b/samples/openapi3/client/petstore/python/docs/models/Shape.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Shape.md rename to samples/openapi3/client/petstore/python/docs/models/Shape.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/ShapeOrNull.md b/samples/openapi3/client/petstore/python/docs/models/ShapeOrNull.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/ShapeOrNull.md rename to samples/openapi3/client/petstore/python/docs/models/ShapeOrNull.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/SimpleQuadrilateral.md b/samples/openapi3/client/petstore/python/docs/models/SimpleQuadrilateral.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/SimpleQuadrilateral.md rename to samples/openapi3/client/petstore/python/docs/models/SimpleQuadrilateral.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/SomeObject.md b/samples/openapi3/client/petstore/python/docs/models/SomeObject.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/SomeObject.md rename to samples/openapi3/client/petstore/python/docs/models/SomeObject.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/SpecialModelName.md b/samples/openapi3/client/petstore/python/docs/models/SpecialModelName.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/SpecialModelName.md rename to samples/openapi3/client/petstore/python/docs/models/SpecialModelName.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/String.md b/samples/openapi3/client/petstore/python/docs/models/String.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/String.md rename to samples/openapi3/client/petstore/python/docs/models/String.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/StringBooleanMap.md b/samples/openapi3/client/petstore/python/docs/models/StringBooleanMap.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/StringBooleanMap.md rename to samples/openapi3/client/petstore/python/docs/models/StringBooleanMap.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/StringEnum.md b/samples/openapi3/client/petstore/python/docs/models/StringEnum.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/StringEnum.md rename to samples/openapi3/client/petstore/python/docs/models/StringEnum.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/StringEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python/docs/models/StringEnumWithDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/StringEnumWithDefaultValue.md rename to samples/openapi3/client/petstore/python/docs/models/StringEnumWithDefaultValue.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/StringWithValidation.md b/samples/openapi3/client/petstore/python/docs/models/StringWithValidation.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/StringWithValidation.md rename to samples/openapi3/client/petstore/python/docs/models/StringWithValidation.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Tag.md b/samples/openapi3/client/petstore/python/docs/models/Tag.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Tag.md rename to samples/openapi3/client/petstore/python/docs/models/Tag.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Triangle.md b/samples/openapi3/client/petstore/python/docs/models/Triangle.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Triangle.md rename to samples/openapi3/client/petstore/python/docs/models/Triangle.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/TriangleInterface.md b/samples/openapi3/client/petstore/python/docs/models/TriangleInterface.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/TriangleInterface.md rename to samples/openapi3/client/petstore/python/docs/models/TriangleInterface.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/UUIDString.md b/samples/openapi3/client/petstore/python/docs/models/UUIDString.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/UUIDString.md rename to samples/openapi3/client/petstore/python/docs/models/UUIDString.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/User.md b/samples/openapi3/client/petstore/python/docs/models/User.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/User.md rename to samples/openapi3/client/petstore/python/docs/models/User.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Whale.md b/samples/openapi3/client/petstore/python/docs/models/Whale.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Whale.md rename to samples/openapi3/client/petstore/python/docs/models/Whale.md diff --git a/samples/openapi3/client/petstore/python-experimental/docs/models/Zebra.md b/samples/openapi3/client/petstore/python/docs/models/Zebra.md similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/docs/models/Zebra.md rename to samples/openapi3/client/petstore/python/docs/models/Zebra.md diff --git a/samples/openapi3/client/petstore/python/git_push.sh b/samples/openapi3/client/petstore/python/git_push.sh index f53a75d4fabe..ced3be2b0c7b 100644 --- a/samples/openapi3/client/petstore/python/git_push.sh +++ b/samples/openapi3/client/petstore/python/git_push.sh @@ -1,7 +1,7 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 @@ -38,14 +38,14 @@ git add . git commit -m "$release_note" # Sets the new remote -git_remote=$(git 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 + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -55,3 +55,4 @@ 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/petstore_api/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/__init__.py index e79f5c78b220..26b0467759de 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/__init__.py @@ -1,3 +1,5 @@ +# coding: utf-8 + # flake8: noqa """ @@ -9,7 +11,6 @@ Generated by: https://openapi-generator.tech """ - __version__ = "1.0.0" # import ApiClient diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index c14f1d0f1bca..b5d32822d19e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -1,3 +1,4 @@ +# coding: utf-8 """ OpenAPI Petstore @@ -7,39 +8,952 @@ Generated by: https://openapi-generator.tech """ - +from dataclasses import dataclass +from decimal import Decimal +import enum +import email import json +import os +import io import atexit -import mimetypes from multiprocessing.pool import ThreadPool -import io -import os import re +import tempfile import typing -from urllib.parse import quote -from urllib3.fields import RequestField +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict +from urllib.parse import urlparse, quote +from urllib3.fields import RequestField as RequestFieldBase +import frozendict from petstore_api import rest from petstore_api.configuration import Configuration -from petstore_api.exceptions import ApiTypeError, ApiValueError, ApiException -from petstore_api.model_utils import ( - ModelNormal, - ModelSimple, - ModelComposed, - check_allowed_values, - check_validations, +from petstore_api.exceptions import ApiTypeError, ApiValueError +from petstore_api.schemas import ( + NoneClass, + BoolClass, + Schema, + FileIO, + BinarySchema, date, datetime, - deserialize_file, - file_type, - model_to_dict, none_type, - validate_and_convert_types + Unset, + unset, ) -class ApiClient(object): +class RequestField(RequestFieldBase): + def __eq__(self, other): + if not isinstance(other, RequestField): + return False + return self.__dict__ == other.__dict__ + + +class JSONEncoder(json.JSONEncoder): + def default(self, obj): + if isinstance(obj, str): + return str(obj) + elif isinstance(obj, float): + return float(obj) + elif isinstance(obj, int): + return int(obj) + elif isinstance(obj, Decimal): + if obj.as_tuple().exponent >= 0: + return int(obj) + return float(obj) + elif isinstance(obj, NoneClass): + return None + elif isinstance(obj, BoolClass): + return bool(obj) + elif isinstance(obj, (dict, frozendict.frozendict)): + return {key: self.default(val) for key, val in obj.items()} + elif isinstance(obj, (list, tuple)): + return [self.default(item) for item in obj] + raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) + + +class ParameterInType(enum.Enum): + QUERY = 'query' + HEADER = 'header' + PATH = 'path' + COOKIE = 'cookie' + + +class ParameterStyle(enum.Enum): + MATRIX = 'matrix' + LABEL = 'label' + FORM = 'form' + SIMPLE = 'simple' + SPACE_DELIMITED = 'spaceDelimited' + PIPE_DELIMITED = 'pipeDelimited' + DEEP_OBJECT = 'deepObject' + + +class PrefixSeparatorIterator: + # A class to store prefixes and separators for rfc6570 expansions + + def __init__(self, prefix: str, separator: str): + self.prefix = prefix + self.separator = separator + self.first = True + if separator in {'.', '|', '%20'}: + item_separator = separator + else: + item_separator = ',' + self.item_separator = item_separator + + def __iter__(self): + return self + + def __next__(self): + if self.first: + self.first = False + return self.prefix + return self.separator + + +class ParameterSerializerBase: + @classmethod + def _get_default_explode(cls, style: ParameterStyle) -> bool: + return False + + @staticmethod + def __ref6570_item_value(in_data: typing.Any, percent_encode: bool): + """ + Get representation if str/float/int/None/items in list/ values in dict + None is returned if an item is undefined, use cases are value= + - None + - [] + - {} + - [None, None None] + - {'a': None, 'b': None} + """ + if type(in_data) in {str, float, int}: + if percent_encode: + return quote(str(in_data)) + return str(in_data) + elif isinstance(in_data, none_type): + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + elif isinstance(in_data, list) and not in_data: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + elif isinstance(in_data, dict) and not in_data: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return None + raise ApiValueError('Unable to generate a ref6570 item representation of {}'.format(in_data)) + + @staticmethod + def _to_dict(name: str, value: str): + return {name: value} + + @classmethod + def __ref6570_str_float_int_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_value = cls.__ref6570_item_value(in_data, percent_encode) + if item_value is None or (item_value == '' and prefix_separator_iterator.separator == ';'): + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals = '=' if named_parameter_expansion else '' + return next(prefix_separator_iterator) + var_name_piece + value_pair_equals + item_value + + @classmethod + def __ref6570_list_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + item_values = [cls.__ref6570_item_value(v, percent_encode) for v in in_data] + item_values = [v for v in item_values if v is not None] + if not item_values: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + + value_pair_equals + + prefix_separator_iterator.item_separator.join(item_values) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [var_name_piece + value_pair_equals + val for val in item_values] + ) + + @classmethod + def __ref6570_dict_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator, + var_name_piece: str, + named_parameter_expansion: bool + ) -> str: + in_data_transformed = {key: cls.__ref6570_item_value(val, percent_encode) for key, val in in_data.items()} + in_data_transformed = {key: val for key, val in in_data_transformed.items() if val is not None} + if not in_data_transformed: + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + value_pair_equals = '=' if named_parameter_expansion else '' + if not explode: + return ( + next(prefix_separator_iterator) + + var_name_piece + value_pair_equals + + prefix_separator_iterator.item_separator.join( + prefix_separator_iterator.item_separator.join( + item_pair + ) for item_pair in in_data_transformed.items() + ) + ) + # exploded + return next(prefix_separator_iterator) + next(prefix_separator_iterator).join( + [key + '=' + val for key, val in in_data_transformed.items()] + ) + + @classmethod + def _ref6570_expansion( + cls, + variable_name: str, + in_data: typing.Any, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: PrefixSeparatorIterator + ) -> str: + """ + Separator is for separate variables like dict with explode true, not for array item separation + """ + named_parameter_expansion = prefix_separator_iterator.separator in {'&', ';'} + var_name_piece = variable_name if named_parameter_expansion else '' + if type(in_data) in {str, float, int}: + return cls.__ref6570_str_float_int_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + elif isinstance(in_data, none_type): + # ignored by the expansion process https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.1 + return "" + elif isinstance(in_data, list): + return cls.__ref6570_list_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + elif isinstance(in_data, dict): + return cls.__ref6570_dict_expansion( + variable_name, + in_data, + explode, + percent_encode, + prefix_separator_iterator, + var_name_piece, + named_parameter_expansion + ) + # bool, bytes, etc + raise ApiValueError('Unable to generate a ref6570 representation of {}'.format(in_data)) + + +class StyleFormSerializer(ParameterSerializerBase): + @classmethod + def _get_default_explode(cls, style: ParameterStyle) -> bool: + if style is ParameterStyle.FORM: + return True + return super()._get_default_explode(style) + + def _serialize_form( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + name: str, + explode: bool, + percent_encode: bool, + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None + ) -> str: + if prefix_separator_iterator is None: + prefix_separator_iterator = PrefixSeparatorIterator('?', '&') + return self._ref6570_expansion( + variable_name=name, + in_data=in_data, + explode=explode, + percent_encode=percent_encode, + prefix_separator_iterator=prefix_separator_iterator + ) + + +class StyleSimpleSerializer(ParameterSerializerBase): + + def _serialize_simple( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + name: str, + explode: bool, + percent_encode: bool + ) -> str: + prefix_separator_iterator = PrefixSeparatorIterator('', ',') + return self._ref6570_expansion( + variable_name=name, + in_data=in_data, + explode=explode, + percent_encode=percent_encode, + prefix_separator_iterator=prefix_separator_iterator + ) + + +@dataclass +class ParameterBase: + name: str + in_type: ParameterInType + required: bool + style: typing.Optional[ParameterStyle] + explode: typing.Optional[bool] + allow_reserved: typing.Optional[bool] + schema: typing.Optional[typing.Type[Schema]] + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] + + __style_to_in_type = { + ParameterStyle.MATRIX: {ParameterInType.PATH}, + ParameterStyle.LABEL: {ParameterInType.PATH}, + ParameterStyle.FORM: {ParameterInType.QUERY, ParameterInType.COOKIE}, + ParameterStyle.SIMPLE: {ParameterInType.PATH, ParameterInType.HEADER}, + ParameterStyle.SPACE_DELIMITED: {ParameterInType.QUERY}, + ParameterStyle.PIPE_DELIMITED: {ParameterInType.QUERY}, + ParameterStyle.DEEP_OBJECT: {ParameterInType.QUERY}, + } + __in_type_to_default_style = { + ParameterInType.QUERY: ParameterStyle.FORM, + ParameterInType.PATH: ParameterStyle.SIMPLE, + ParameterInType.HEADER: ParameterStyle.SIMPLE, + ParameterInType.COOKIE: ParameterStyle.FORM, + } + __disallowed_header_names = {'Accept', 'Content-Type', 'Authorization'} + _json_encoder = JSONEncoder() + _json_content_type = 'application/json' + + @classmethod + def __verify_style_to_in_type(cls, style: typing.Optional[ParameterStyle], in_type: ParameterInType): + if style is None: + return + in_type_set = cls.__style_to_in_type[style] + if in_type not in in_type_set: + raise ValueError( + 'Invalid style and in_type combination. For style={} only in_type={} are allowed'.format( + style, in_type_set + ) + ) + + def __init__( + self, + name: str, + in_type: ParameterInType, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + if schema is None and content is None: + raise ValueError('Value missing; Pass in either schema or content') + if schema and content: + raise ValueError('Too many values provided. Both schema and content were provided. Only one may be input') + if name in self.__disallowed_header_names and in_type is ParameterInType.HEADER: + raise ValueError('Invalid name, name may not be one of {}'.format(self.__disallowed_header_names)) + self.__verify_style_to_in_type(style, in_type) + if content is None and style is None: + style = self.__in_type_to_default_style[in_type] + if content is not None and in_type in self.__in_type_to_default_style and len(content) != 1: + raise ValueError('Invalid content length, content length must equal 1') + self.in_type = in_type + self.name = name + self.required = required + self.style = style + self.explode = explode + self.allow_reserved = allow_reserved + self.schema = schema + self.content = content + + def _serialize_json( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> str: + return json.dumps(in_data) + + +class PathParameter(ParameterBase, StyleSimpleSerializer): + + def __init__( + self, + name: str, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + super().__init__( + name, + in_type=ParameterInType.PATH, + required=required, + style=style, + explode=explode, + allow_reserved=allow_reserved, + schema=schema, + content=content + ) + + def __serialize_label( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Dict[str, str]: + prefix_separator_iterator = PrefixSeparatorIterator('.', '.') + value = self._ref6570_expansion( + variable_name=self.name, + in_data=in_data, + explode=self.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return self._to_dict(self.name, value) + + def __serialize_matrix( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Dict[str, str]: + prefix_separator_iterator = PrefixSeparatorIterator(';', ';') + value = self._ref6570_expansion( + variable_name=self.name, + in_data=in_data, + explode=self.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return self._to_dict(self.name, value) + + def __serialize_simple( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + ) -> typing.Dict[str, str]: + value = self._serialize_simple( + in_data=in_data, + name=self.name, + explode=self.explode, + percent_encode=True + ) + return self._to_dict(self.name, value) + + def serialize( + self, + in_data: typing.Union[ + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> typing.Dict[str, str]: + if self.schema: + cast_in_data = self.schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + """ + simple -> path + path: + returns path_params: dict + label -> path + returns path_params + matrix -> path + returns path_params + """ + if self.style: + if self.style is ParameterStyle.SIMPLE: + return self.__serialize_simple(cast_in_data) + elif self.style is ParameterStyle.LABEL: + return self.__serialize_label(cast_in_data) + elif self.style is ParameterStyle.MATRIX: + return self.__serialize_matrix(cast_in_data) + # self.content will be length one + for content_type, schema in self.content.items(): + cast_in_data = schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + if content_type == self._json_content_type: + value = self._serialize_json(cast_in_data) + return self._to_dict(self.name, value) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class QueryParameter(ParameterBase, StyleFormSerializer): + + def __init__( + self, + name: str, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: typing.Optional[bool] = None, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + used_style = ParameterStyle.FORM if style is None and content is None and schema else style + used_explode = self._get_default_explode(used_style) if explode is None else explode + + super().__init__( + name, + in_type=ParameterInType.QUERY, + required=required, + style=used_style, + explode=used_explode, + allow_reserved=allow_reserved, + schema=schema, + content=content + ) + + def __serialize_space_delimited( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = self.get_prefix_separator_iterator() + value = self._ref6570_expansion( + variable_name=self.name, + in_data=in_data, + explode=self.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return self._to_dict(self.name, value) + + def __serialize_pipe_delimited( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = self.get_prefix_separator_iterator() + value = self._ref6570_expansion( + variable_name=self.name, + in_data=in_data, + explode=self.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return self._to_dict(self.name, value) + + def __serialize_form( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] + ) -> typing.Dict[str, str]: + if prefix_separator_iterator is None: + prefix_separator_iterator = self.get_prefix_separator_iterator() + value = self._serialize_form( + in_data, + name=self.name, + explode=self.explode, + percent_encode=True, + prefix_separator_iterator=prefix_separator_iterator + ) + return self._to_dict(self.name, value) + + def get_prefix_separator_iterator(self) -> typing.Optional[PrefixSeparatorIterator]: + if not self.schema: + return None + if self.style is ParameterStyle.FORM: + return PrefixSeparatorIterator('?', '&') + elif self.style is ParameterStyle.SPACE_DELIMITED: + return PrefixSeparatorIterator('', '%20') + elif self.style is ParameterStyle.PIPE_DELIMITED: + return PrefixSeparatorIterator('', '|') + + def serialize( + self, + in_data: typing.Union[ + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict], + prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None + ) -> typing.Dict[str, str]: + if self.schema: + cast_in_data = self.schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + """ + form -> query + query: + - GET/HEAD/DELETE: could use fields + - PUT/POST: must use urlencode to send parameters + returns fields: tuple + spaceDelimited -> query + returns fields + pipeDelimited -> query + returns fields + deepObject -> query, https://github.com/OAI/OpenAPI-Specification/issues/1706 + returns fields + """ + if self.style: + # TODO update query ones to omit setting values when [] {} or None is input + if self.style is ParameterStyle.FORM: + return self.__serialize_form(cast_in_data, prefix_separator_iterator) + elif self.style is ParameterStyle.SPACE_DELIMITED: + return self.__serialize_space_delimited(cast_in_data, prefix_separator_iterator) + elif self.style is ParameterStyle.PIPE_DELIMITED: + return self.__serialize_pipe_delimited(cast_in_data, prefix_separator_iterator) + # self.content will be length one + for content_type, schema in self.content.items(): + cast_in_data = schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + if content_type == self._json_content_type: + value = self._serialize_json(cast_in_data) + return self._to_dict(self.name, value) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class CookieParameter(ParameterBase, StyleFormSerializer): + + def __init__( + self, + name: str, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: typing.Optional[bool] = None, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + used_style = ParameterStyle.FORM if style is None and content is None and schema else style + used_explode = self._get_default_explode(used_style) if explode is None else explode + + super().__init__( + name, + in_type=ParameterInType.COOKIE, + required=required, + style=used_style, + explode=used_explode, + allow_reserved=allow_reserved, + schema=schema, + content=content + ) + + def serialize( + self, + in_data: typing.Union[ + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> typing.Dict[str, str]: + if self.schema: + cast_in_data = self.schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + """ + form -> cookie + returns fields: tuple + """ + if self.style: + """ + TODO add escaping of comma, space, equals + or turn encoding on + """ + value = self._serialize_form( + cast_in_data, + explode=self.explode, + name=self.name, + percent_encode=False, + prefix_separator_iterator=PrefixSeparatorIterator('', '&') + ) + return self._to_dict(self.name, value) + # self.content will be length one + for content_type, schema in self.content.items(): + cast_in_data = schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + if content_type == self._json_content_type: + value = self._serialize_json(cast_in_data) + return self._to_dict(self.name, value) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class HeaderParameter(ParameterBase, StyleSimpleSerializer): + def __init__( + self, + name: str, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + super().__init__( + name, + in_type=ParameterInType.HEADER, + required=required, + style=style, + explode=explode, + allow_reserved=allow_reserved, + schema=schema, + content=content + ) + + @staticmethod + def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHeaderDict: + data = tuple(t for t in in_data if t) + headers = HTTPHeaderDict() + if not data: + return headers + headers.extend(data) + return headers + + def serialize( + self, + in_data: typing.Union[ + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict] + ) -> HTTPHeaderDict: + if self.schema: + cast_in_data = self.schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + """ + simple -> header + headers: PoolManager needs a mapping, tuple is close + returns headers: dict + """ + if self.style: + value = self._serialize_simple(cast_in_data, self.name, self.explode, False) + return self.__to_headers(((self.name, value),)) + # self.content will be length one + for content_type, schema in self.content.items(): + cast_in_data = schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + if content_type == self._json_content_type: + value = self._serialize_json(cast_in_data) + return self.__to_headers(((self.name, value),)) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class Encoding: + def __init__( + self, + content_type: str, + headers: typing.Optional[typing.Dict[str, HeaderParameter]] = None, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: bool = False, + ): + self.content_type = content_type + self.headers = headers + self.style = style + self.explode = explode + self.allow_reserved = allow_reserved + + +@dataclass +class MediaType: + """ + Used to store request and response body schema information + encoding: + A map between a property name and its encoding information. + The key, being the property name, MUST exist in the schema as a property. + The encoding object SHALL only apply to requestBody objects when the media type is + multipart or application/x-www-form-urlencoded. + """ + schema: typing.Optional[typing.Type[Schema]] = None + encoding: typing.Optional[typing.Dict[str, Encoding]] = None + + +@dataclass +class ApiResponse: + response: urllib3.HTTPResponse + body: typing.Union[Unset, Schema] + headers: typing.Union[Unset, typing.List[HeaderParameter]] + + def __init__( + self, + response: urllib3.HTTPResponse, + body: typing.Union[Unset, typing.Type[Schema]], + headers: typing.Union[Unset, typing.List[HeaderParameter]] + ): + """ + pycharm needs this to prevent 'Unexpected argument' warnings + """ + self.response = response + self.body = body + self.headers = headers + + +@dataclass +class ApiResponseWithoutDeserialization(ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[Unset, typing.Type[Schema]] = unset + headers: typing.Union[Unset, typing.List[HeaderParameter]] = unset + + +class JSONDetector: + """ + Works for: + application/json + application/json; charset=UTF-8 + application/json-patch+json + application/geo+json + """ + __json_content_type_pattern = re.compile("application/[^+]*[+]?(json);?.*") + + @classmethod + def _content_type_is_json(cls, content_type: str) -> bool: + if cls.__json_content_type_pattern.match(content_type): + return True + return False + + +class OpenApiResponse(JSONDetector): + __filename_content_disposition_pattern = re.compile('filename="(.+?)"') + + def __init__( + self, + response_cls: typing.Type[ApiResponse] = ApiResponse, + content: typing.Optional[typing.Dict[str, MediaType]] = None, + headers: typing.Optional[typing.List[HeaderParameter]] = None, + ): + self.headers = headers + if content is not None and len(content) == 0: + raise ValueError('Invalid value for content, the content dict must have >= 1 entry') + self.content = content + self.response_cls = response_cls + + @staticmethod + def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: + # python must be >= 3.9 so we can pass in bytes into json.loads + return json.loads(response.data) + + @staticmethod + def __file_name_from_response_url(response_url: typing.Optional[str]) -> typing.Optional[str]: + if response_url is None: + return None + url_path = urlparse(response_url).path + if url_path: + path_basename = os.path.basename(url_path) + if path_basename: + _filename, ext = os.path.splitext(path_basename) + if ext: + return path_basename + return None + + @classmethod + def __file_name_from_content_disposition(cls, content_disposition: typing.Optional[str]) -> typing.Optional[str]: + if content_disposition is None: + return None + match = cls.__filename_content_disposition_pattern.search(content_disposition) + if not match: + return None + return match.group(1) + + def __deserialize_application_octet_stream( + self, response: urllib3.HTTPResponse + ) -> typing.Union[bytes, io.BufferedReader]: + """ + urllib3 use cases: + 1. when preload_content=True (stream=False) then supports_chunked_reads is False and bytes are returned + 2. when preload_content=False (stream=True) then supports_chunked_reads is True and + a file will be written and returned + """ + if response.supports_chunked_reads(): + file_name = ( + self.__file_name_from_content_disposition(response.headers.get('content-disposition')) + or self.__file_name_from_response_url(response.geturl()) + ) + + if file_name is None: + _fd, path = tempfile.mkstemp() + else: + path = os.path.join(tempfile.gettempdir(), file_name) + + with open(path, 'wb') as new_file: + chunk_size = 1024 + while True: + data = response.read(chunk_size) + if not data: + break + new_file.write(data) + # release_conn is needed for streaming connections only + response.release_conn() + new_file = open(path, 'rb') + return new_file + else: + return response.data + + @staticmethod + def __deserialize_multipart_form_data( + response: urllib3.HTTPResponse + ) -> typing.Dict[str, typing.Any]: + msg = email.message_from_bytes(response.data) + return { + part.get_param("name", header="Content-Disposition"): part.get_payload( + decode=True + ).decode(part.get_content_charset()) + if part.get_content_charset() + else part.get_payload() + for part in msg.get_payload() + } + + def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> ApiResponse: + content_type = response.getheader('content-type') + deserialized_body = unset + streamed = response.supports_chunked_reads() + + deserialized_headers = unset + if self.headers is not None: + # TODO add header deserialiation here + pass + + if self.content is not None: + if content_type not in self.content: + raise ApiValueError( + f"Invalid content_type returned. Content_type='{content_type}' was returned " + f"when only {str(set(self.content))} are defined for status_code={str(response.status)}" + ) + body_schema = self.content[content_type].schema + if body_schema is None: + # some specs do not define response content media type schemas + return self.response_cls( + response=response, + headers=deserialized_headers, + body=unset + ) + + if self._content_type_is_json(content_type): + body_data = self.__deserialize_json(response) + elif content_type == 'application/octet-stream': + body_data = self.__deserialize_application_octet_stream(response) + elif content_type.startswith('multipart/form-data'): + body_data = self.__deserialize_multipart_form_data(response) + content_type = 'multipart/form-data' + else: + raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) + deserialized_body = body_schema.from_openapi_data_oapg( + body_data, _configuration=configuration) + elif streamed: + response.release_conn() + + return self.response_cls( + response=response, + headers=deserialized_headers, + body=deserialized_body + ) + + +class ApiClient: """Generic API client for OpenAPI client library builds. OpenAPI generic API client. This client handles the client- @@ -63,10 +977,16 @@ class ApiClient(object): _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + def __init__( + self, + configuration: typing.Optional[Configuration] = None, + header_name: typing.Optional[str] = None, + header_value: typing.Optional[str] = None, + cookie: typing.Optional[str] = None, + pool_threads: int = 1 + ): if configuration is None: - configuration = Configuration.get_default_copy() + configuration = Configuration() self.configuration = configuration self.pool_threads = pool_threads @@ -118,298 +1038,83 @@ def __call_api( self, resource_path: str, method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + headers: typing.Optional[HTTPHeaderDict] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, auth_settings: typing.Optional[typing.List[str]] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): - - config = self.configuration + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + host: typing.Optional[str] = None, + ) -> urllib3.HTTPResponse: # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) + headers = headers or {} + headers.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) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # 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)) - if header_params['Content-Type'].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, - (dict)) - - # body - if body: - body = self.sanitize_for_serialization(body) + headers['Cookie'] = self.cookie # auth setting - self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body, - request_auths=_request_auths) + self.update_params_for_auth(headers, + auth_settings, resource_path, method, body) # request url - if _host is None: + if host is None: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead - url = _host + resource_path - - 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: - 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) - return return_data - - # deserialize response data - if response_type: - if response_type != (file_type,): - encoding = "utf-8" - 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) - if match: - encoding = match.group(1) - response_data.data = response_data.data.decode(encoding) - - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) - else: - return_data = None - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) - - def parameters_to_multipart(self, params, collection_types): - """Get parameters as list of tuples, formatting as json if value is collection_types - - :param params: Parameters as list of two-tuples - :param dict collection_types: Parameter collection types - :return: Parameters as list of tuple or urllib3.fields.RequestField - """ - new_params = [] - if collection_types is None: - collection_types = (dict) - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance( - v, collection_types): # v is instance of collection_type, formatting as application/json - v = json.dumps(v, ensure_ascii=False).encode("utf-8") - field = RequestField(k, v) - field.make_multipart(content_type="application/json; charset=utf-8") - new_params.append(field) - else: - new_params.append((k, v)) - return new_params - - @classmethod - def sanitize_for_serialization(cls, obj): - """Prepares data for transmission before it is sent with the rest client - 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. - If obj is io.IOBase, return the bytes - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if isinstance(obj, (ModelNormal, ModelComposed)): - return { - key: cls.sanitize_for_serialization(val) for key, - val in model_to_dict( - obj, - serialize=True).items()} - elif isinstance(obj, io.IOBase): - return cls.get_file_data_and_close_file(obj) - elif isinstance(obj, (str, int, float, none_type, bool)): - return obj - elif isinstance(obj, (datetime, date)): - return obj.isoformat() - elif isinstance(obj, ModelSimple): - return cls.sanitize_for_serialization(obj.value) - elif isinstance(obj, (list, tuple)): - return [cls.sanitize_for_serialization(item) for item in obj] - if isinstance(obj, dict): - return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} - raise ApiValueError( - 'Unable to prepare type {} for serialization'.format( - obj.__class__.__name__)) - - def deserialize(self, response, response_type, _check_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param _check_type: boolean, whether to check the types of the data - received from the server - :type _check_type: bool - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == (file_type,): - content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, - content_disposition=content_disposition) - - # fetch data from response object - try: - received_data = json.loads(response.data) - except ValueError: - received_data = response.data - - # store our data under the key of 'received_data' so users have some - # context if they are deserializing a string and the data type is wrong - deserialized_data = validate_and_convert_types( - received_data, - response_type, - ['received_data'], - True, - _check_type, - configuration=self.configuration + url = host + resource_path + + # perform request and return response + response = self.request( + method, + url, + headers=headers, + fields=fields, + body=body, + stream=stream, + timeout=timeout, ) - return deserialized_data + return response def call_api( self, resource_path: str, method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + headers: typing.Optional[HTTPHeaderDict] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, auth_settings: typing.Optional[typing.List[str]] = None, async_req: typing.Optional[bool] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + host: typing.Optional[str] = None, + ) -> urllib3.HTTPResponse: """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 + :param headers: Header parameters to be placed in the request header. :param body: Request body. - :param post_params dict: Request post form parameters, + :param fields: 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_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param files: key -> field name, value -> a list of open file - objects for `multipart/form-data`. - :type files: dict - :param async_req bool: execute 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 collection_formats: dict of collection formats for path, query, - header, and post parameters. - :type collection_formats: dict, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will + :param auth_settings: Auth Settings names for the request. + :param async_req: execute request asynchronously + :type async_req: bool, optional TODO remove, unused + :param stream: if True, 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 + data. Also when True, if the openapi spec describes a file download, + the data will be written to a local filesystme file and the BinarySchema + instance will also inherit from FileSchema and FileIO + Default is False. + :type stream: bool, optional + :param 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 _check_type: boolean describing if the data back from the server - should have its type checked. - :type _check_type: bool, optional - :param _request_auths: 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_auths: list, optional + :param host: api endpoint host :return: If async_req parameter is True, the request will be called asynchronously. @@ -417,82 +1122,90 @@ def call_api( 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_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _check_type, _request_auths=_request_auths) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _check_type, None, _request_auths)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): + return self.__call_api( + resource_path, + method, + headers, + body, + fields, + auth_settings, + stream, + timeout, + host, + ) + + return self.pool.apply_async( + self.__call_api, + ( + resource_path, + method, + headers, + body, + json, + fields, + auth_settings, + stream, + timeout, + host, + ) + ) + + def request( + self, + method: str, + url: str, + headers: typing.Optional[HTTPHeaderDict] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: """Makes the HTTP request using RESTClient.""" if method == "GET": return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, + stream=stream, + timeout=timeout, headers=headers) elif method == "HEAD": return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, + stream=stream, + timeout=timeout, headers=headers) elif method == "OPTIONS": return self.rest_client.OPTIONS(url, - query_params=query_params, headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, + fields=fields, + stream=stream, + timeout=timeout, body=body) elif method == "POST": return self.rest_client.POST(url, - query_params=query_params, headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, + fields=fields, + stream=stream, + timeout=timeout, body=body) elif method == "PUT": return self.rest_client.PUT(url, - query_params=query_params, headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, + fields=fields, + stream=stream, + timeout=timeout, body=body) elif method == "PATCH": return self.rest_client.PATCH(url, - query_params=query_params, headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, + fields=fields, + stream=stream, + timeout=timeout, body=body) elif method == "DELETE": return self.rest_client.DELETE(url, - query_params=query_params, headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, + stream=stream, + timeout=timeout, body=body) else: raise ApiValueError( @@ -500,404 +1213,286 @@ def request(self, method, url, query_params=None, headers=None, " `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 - - @staticmethod - def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: - file_data = file_instance.read() - file_instance.close() - return file_data - - def files_parameters(self, - files: typing.Optional[typing.Dict[str, - typing.List[io.IOBase]]] = None): - """Builds form parameters. - - :param files: None or a dict with key=param_name and - value is a list of open file objects - :return: List of tuples of form parameters with file data - """ - if files is None: - return [] - - params = [] - for param_name, file_instances in files.items(): - if file_instances is None: - # if the file field is nullable, skip None values - continue - for file_instance in file_instances: - if file_instance is None: - # if the file field is nullable, skip None values - continue - if file_instance.closed is True: - raise ApiValueError( - "Cannot read a closed file. The passed in file_type " - "for %s must be open." % param_name - ) - filename = os.path.basename(file_instance.name) - filedata = self.get_file_data_and_close_file(file_instance) - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([param_name, 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 - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types, method=None, body=None): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return None - - content_types = [x.lower() for x in content_types] - - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, request_auths=None): + def update_params_for_auth(self, headers, auth_settings, + resource_path, method, body): """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. :param resource_path: A string representation of the HTTP request resource path. :param method: A string representation of the HTTP request method. :param body: A object representing the body of the HTTP request. The object type is the return value of _encoder.default(). - :param request_auths: if set, the provided settings will - override the token in the configuration. """ if not auth_settings: return - if request_auths: - for auth_setting in request_auths: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting) - 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): - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['key'] + "=" + auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] + if not auth_setting: + continue + if auth_setting['in'] == 'cookie': + headers.add('Cookie', auth_setting['value']) + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers.add(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 + querys = tuple() + auth_headers = signing_info.get_http_signature_headers( + resource_path, method, headers, body, querys) + for key, value in auth_headers.items(): + headers.add(key, value) + elif auth_setting['in'] == 'query': + """ TODO implement auth in query + need to pass in prefix_separator_iterator + and need to output resource_path with query params added + """ + raise ApiValueError("Auth in query not yet implemented") 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`' - ) - - -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called - """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type', - '_content_type', - '_spec_property_naming', - '_request_auths' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (none_type, int), - '_preload_content': (bool,), - '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,), - '_spec_property_naming': (bool,), - '_content_type': (none_type, str), - '_request_auths': (none_type, list) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] + raise ApiValueError( + 'Authentication token must be in `query` or `header`' ) - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param], - configuration=self.api_client.configuration - ) - if kwargs['_check_input_type'] is False: - return +class Api: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech - for key, value in kwargs.items(): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - kwargs['_spec_property_naming'], - kwargs['_check_input_type'], - configuration=self.api_client.configuration - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } + Do not edit the class manually. + """ - for param_name, param_value in kwargs.items(): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - params['file'][base_name] = [param_value] - elif (param_location == 'form' and - self.openapi_types[param_name] == ([file_type],)): - # param_value is already a list - params['file'][base_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format - - return params - - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: - - api_instance = AnotherFakeApi() - api_instance.call_123_test_special_tags # this is an instance of the class Endpoint - api_instance.call_123_test_special_tags() # this invokes api_instance.call_123_test_special_tags.__call__() - which then invokes the callable functions stored in that endpoint at - api_instance.call_123_test_special_tags.callable or self.callable in this class + def __init__(self, api_client: typing.Optional[ApiClient] = None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + @staticmethod + def _verify_typed_dict_inputs_oapg(cls: typing.Type[typing_extensions.TypedDict], data: typing.Dict[str, typing.Any]): """ - return self.callable(self, *args, **kwargs) + Ensures that: + - required keys are present + - additional properties are not input + - value stored under required keys do not have the value unset + Note: detailed value checking is done in schema classes + """ + missing_required_keys = [] + required_keys_with_unset_values = [] + for required_key in cls.__required_keys__: + if required_key not in data: + missing_required_keys.append(required_key) + continue + value = data[required_key] + if value is unset: + required_keys_with_unset_values.append(required_key) + if missing_required_keys: + raise ApiTypeError( + '{} missing {} required arguments: {}'.format( + cls.__name__, len(missing_required_keys), missing_required_keys + ) + ) + if required_keys_with_unset_values: + raise ApiValueError( + '{} contains invalid unset values for {} required keys: {}'.format( + cls.__name__, len(required_keys_with_unset_values), required_keys_with_unset_values + ) + ) - def call_with_http_info(self, **kwargs): + disallowed_additional_keys = [] + for key in data: + if key in cls.__required_keys__ or key in cls.__optional_keys__: + continue + disallowed_additional_keys.append(key) + if disallowed_additional_keys: + raise ApiTypeError( + '{} got {} unexpected keyword arguments: {}'.format( + cls.__name__, len(disallowed_additional_keys), disallowed_additional_keys + ) + ) + def _get_host_oapg( + self, + operation_id: str, + servers: typing.Tuple[typing.Dict[str, str], ...] = tuple(), + host_index: typing.Optional[int] = None + ) -> typing.Optional[str]: + configuration = self.api_client.configuration try: - index = self.api_client.configuration.server_operation_index.get( - self.settings['operation_id'], self.api_client.configuration.server_index - ) if kwargs['_host_index'] is None else kwargs['_host_index'] - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings['operation_id'], self.api_client.configuration.server_variables + if host_index is None: + index = configuration.server_operation_index.get( + operation_id, configuration.server_index + ) + else: + index = host_index + server_variables = configuration.server_operation_variables.get( + operation_id, configuration.server_variables ) - _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings['servers'] + host = configuration.get_host_from_settings( + index, variables=server_variables, servers=servers ) except IndexError: - if self.settings['servers']: + if servers: raise ApiValueError( "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in kwargs.items(): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) + len(servers) ) + host = None + return host - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) - self.__validate_inputs(kwargs) +class SerializedRequestBody(typing_extensions.TypedDict, total=False): + body: typing.Union[str, bytes] + fields: typing.Tuple[typing.Union[RequestField, typing.Tuple[str, str]], ...] - params = self.__gather_params(kwargs) - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) +class RequestBody(StyleFormSerializer, JSONDetector): + """ + A request body parameter + content: content_type to MediaType Schema info + """ + __json_encoder = JSONEncoder() - if kwargs.get('_content_type'): - params['header']['Content-Type'] = kwargs['_content_type'] + def __init__( + self, + content: typing.Dict[str, MediaType], + required: bool = False, + ): + self.required = required + if len(content) == 0: + raise ValueError('Invalid value for content, the content dict must have >= 1 entry') + self.content = content + + def __serialize_json( + self, + in_data: typing.Any + ) -> typing.Dict[str, bytes]: + in_data = self.__json_encoder.default(in_data) + json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( + "utf-8" + ) + return dict(body=json_str) + + @staticmethod + def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: + if isinstance(in_data, frozendict.frozendict): + raise ValueError('Unable to serialize type frozendict.frozendict to text/plain') + elif isinstance(in_data, tuple): + raise ValueError('Unable to serialize type tuple to text/plain') + elif isinstance(in_data, NoneClass): + raise ValueError('Unable to serialize type NoneClass to text/plain') + elif isinstance(in_data, BoolClass): + raise ValueError('Unable to serialize type BoolClass to text/plain') + return dict(body=str(in_data)) + + def __multipart_json_item(self, key: str, value: Schema) -> RequestField: + json_value = self.__json_encoder.default(value) + return RequestField(name=key, data=json.dumps(json_value), headers={'Content-Type': 'application/json'}) + + def __multipart_form_item(self, key: str, value: Schema) -> RequestField: + if isinstance(value, str): + return RequestField(name=key, data=str(value), headers={'Content-Type': 'text/plain'}) + elif isinstance(value, bytes): + return RequestField(name=key, data=value, headers={'Content-Type': 'application/octet-stream'}) + elif isinstance(value, FileIO): + request_field = RequestField( + name=key, + data=value.read(), + filename=os.path.basename(value.name), + headers={'Content-Type': 'application/octet-stream'} + ) + value.close() + return request_field + else: + return self.__multipart_json_item(key=key, value=value) + + def __serialize_multipart_form_data( + self, in_data: Schema + ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: + if not isinstance(in_data, frozendict.frozendict): + raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') + """ + In a multipart/form-data request body, each schema property, or each element of a schema array property, + takes a section in the payload with an internal header as defined by RFC7578. The serialization strategy + for each property of a multipart/form-data request body can be specified in an associated Encoding Object. + + When passing in multipart types, boundaries MAY be used to separate sections of the content being + transferred – thus, the following default Content-Types are defined for multipart: + + If the (object) property is a primitive, or an array of primitive values, the default Content-Type is text/plain + If the property is complex, or an array of complex values, the default Content-Type is application/json + Question: how is the array of primitives encoded? + If the property is a type: string with a contentEncoding, the default Content-Type is application/octet-stream + """ + fields = [] + for key, value in in_data.items(): + if isinstance(value, tuple): + if value: + # values use explode = True, so the code makes a RequestField for each item with name=key + for item in value: + request_field = self.__multipart_form_item(key=key, value=item) + fields.append(request_field) + else: + # send an empty array as json because exploding will not send it + request_field = self.__multipart_json_item(key=key, value=value) + fields.append(request_field) + else: + request_field = self.__multipart_form_item(key=key, value=value) + fields.append(request_field) + + return dict(fields=tuple(fields)) + + def __serialize_application_octet_stream(self, in_data: BinarySchema) -> typing.Dict[str, bytes]: + if isinstance(in_data, bytes): + return dict(body=in_data) + # FileIO type + result = dict(body=in_data.read()) + in_data.close() + return result + + def __serialize_application_x_www_form_data( + self, in_data: typing.Any + ) -> SerializedRequestBody: + """ + POST submission of form data in body + """ + if not isinstance(in_data, frozendict.frozendict): + raise ValueError( + f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') + cast_in_data = self.__json_encoder.default(in_data) + value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=False) + return dict(body=value) + + def serialize( + self, in_data: typing.Any, content_type: str + ) -> SerializedRequestBody: + """ + If a str is returned then the result will be assigned to data when making the request + If a tuple is returned then the result will be used as fields input in encode_multipart_formdata + Return a tuple of + + The key of the return dict is + - body for application/json + - encode_multipart and fields for multipart/form-data + """ + media_type = self.content[content_type] + if isinstance(in_data, media_type.schema): + cast_in_data = in_data + elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: + cast_in_data = media_type.schema(**in_data) else: - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - content_types_list = self.api_client.select_header_content_type( - content_type_headers_list, self.settings['http_method'], - params['body']) - if content_types_list: - params['header']['Content-Type'] = content_types_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - _request_auths=kwargs['_request_auths'], - collection_formats=params['collection_format']) + cast_in_data = media_type.schema(in_data) + # TODO check for and use encoding if it exists + # and content_type is multipart or application/x-www-form-urlencoded + if self._content_type_is_json(content_type): + return self.__serialize_json(cast_in_data) + elif content_type == 'text/plain': + return self.__serialize_text_plain(cast_in_data) + elif content_type == 'multipart/form-data': + return self.__serialize_multipart_form_data(cast_in_data) + elif content_type == 'application/x-www-form-urlencoded': + return self.__serialize_application_x_www_form_data(cast_in_data) + elif content_type == 'application/octet-stream': + return self.__serialize_application_octet_stream(cast_in_data) + raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) diff --git a/samples/openapi3/client/petstore/python/petstore_api/apis/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/apis/__init__.py index 381ad9572b17..7840f7726f6a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/apis/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/apis/__init__.py @@ -1,23 +1,3 @@ - -# flake8: noqa - -# Import all APIs into this package. -# If you have many APIs here with many many models used in each API this may -# raise a `RecursionError`. -# In order to avoid this, import only the API that you directly need like: -# -# from petstore_api.api.another_fake_api import AnotherFakeApi -# -# or import this package, but before doing it, use: -# -# import sys -# sys.setrecursionlimit(n) - -# 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 +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints then import them from +# tags, paths, or path_to_api, or tag_to_api \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/path_to_api.py b/samples/openapi3/client/petstore/python/petstore_api/apis/path_to_api.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/path_to_api.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/path_to_api.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/another_fake_dummy.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/another_fake_dummy.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/another_fake_dummy.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/another_fake_dummy.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_additional_properties_with_array_of_enums.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_additional_properties_with_array_of_enums.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_additional_properties_with_array_of_enums.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_body_with_file_schema.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_body_with_file_schema.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_body_with_file_schema.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_body_with_file_schema.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_body_with_query_params.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_body_with_query_params.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_body_with_query_params.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_body_with_query_params.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_case_sensitive_params.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_case_sensitive_params.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_case_sensitive_params.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_case_sensitive_params.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_classname_test.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_classname_test.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_classname_test.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_classname_test.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_delete_coffee_id.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_delete_coffee_id.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_delete_coffee_id.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_delete_coffee_id.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_health.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_health.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_health.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_health.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_inline_additional_properties.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_inline_additional_properties.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_inline_additional_properties.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_inline_additional_properties.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_inline_composition_.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_inline_composition_.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_inline_composition_.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_inline_composition_.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_json_form_data.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_json_form_data.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_json_form_data.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_json_form_data.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_json_patch.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_json_patch.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_json_patch.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_json_patch.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_json_with_charset.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_json_with_charset.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_json_with_charset.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_json_with_charset.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_obj_in_query.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_obj_in_query.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_obj_in_query.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_obj_in_query.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_pet_id_upload_image_with_required_file.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_pet_id_upload_image_with_required_file.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_pet_id_upload_image_with_required_file.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_pet_id_upload_image_with_required_file.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_ref_obj_in_query.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_ref_obj_in_query.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_ref_obj_in_query.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_ref_obj_in_query.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_refs_array_of_enums.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_array_of_enums.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_refs_array_of_enums.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_array_of_enums.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_refs_arraymodel.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_arraymodel.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_refs_arraymodel.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_arraymodel.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_refs_boolean.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_boolean.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_refs_boolean.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_boolean.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_refs_composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_composed_one_of_number_with_validations.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_refs_composed_one_of_number_with_validations.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_composed_one_of_number_with_validations.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_refs_enum.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_enum.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_refs_enum.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_enum.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_refs_mammal.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_mammal.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_refs_mammal.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_mammal.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_refs_number.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_number.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_refs_number.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_number.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_refs_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_object_model_with_ref_props.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_refs_object_model_with_ref_props.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_object_model_with_ref_props.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_refs_string.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_string.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_refs_string.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_refs_string.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_response_without_schema.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_response_without_schema.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_response_without_schema.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_response_without_schema.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_test_query_paramters.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_test_query_paramters.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_test_query_paramters.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_test_query_paramters.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_upload_download_file.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_upload_download_file.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_upload_download_file.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_upload_download_file.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_upload_file.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_upload_file.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_upload_file.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_upload_file.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_upload_files.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_upload_files.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/fake_upload_files.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/fake_upload_files.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/foo.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/foo.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/foo.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/foo.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/pet.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/pet.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/pet_find_by_status.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_find_by_status.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/pet_find_by_status.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_find_by_status.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/pet_find_by_tags.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_find_by_tags.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/pet_find_by_tags.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_find_by_tags.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/pet_pet_id.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_pet_id.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/pet_pet_id.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_pet_id.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/pet_pet_id_upload_image.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_pet_id_upload_image.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/pet_pet_id_upload_image.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/pet_pet_id_upload_image.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/store_inventory.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/store_inventory.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/store_inventory.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/store_inventory.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/store_order.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/store_order.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/store_order.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/store_order.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/store_order_order_id.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/store_order_order_id.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/store_order_order_id.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/store_order_order_id.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/user.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/user.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/user.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/user_create_with_array.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_create_with_array.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/user_create_with_array.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_create_with_array.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/user_create_with_list.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_create_with_list.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/user_create_with_list.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_create_with_list.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/user_login.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_login.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/user_login.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_login.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/user_logout.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_logout.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/user_logout.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_logout.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/user_username.py b/samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_username.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/paths/user_username.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/paths/user_username.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/tag_to_api.py b/samples/openapi3/client/petstore/python/petstore_api/apis/tag_to_api.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/tag_to_api.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/tag_to_api.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/tags/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/apis/tags/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/tags/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/tags/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/tags/another_fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/apis/tags/another_fake_api.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/tags/another_fake_api.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/tags/another_fake_api.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/tags/default_api.py b/samples/openapi3/client/petstore/python/petstore_api/apis/tags/default_api.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/tags/default_api.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/tags/default_api.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/tags/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/apis/tags/fake_api.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/tags/fake_api.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/tags/fake_api.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/tags/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python/petstore_api/apis/tags/fake_classname_tags123_api.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/tags/fake_classname_tags123_api.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/tags/fake_classname_tags123_api.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/tags/pet_api.py b/samples/openapi3/client/petstore/python/petstore_api/apis/tags/pet_api.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/tags/pet_api.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/tags/pet_api.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/tags/store_api.py b/samples/openapi3/client/petstore/python/petstore_api/apis/tags/store_api.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/tags/store_api.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/tags/store_api.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/tags/user_api.py b/samples/openapi3/client/petstore/python/petstore_api/apis/tags/user_api.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/apis/tags/user_api.py rename to samples/openapi3/client/petstore/python/petstore_api/apis/tags/user_api.py diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index 0c4db4c52afd..f7c2a3ff91eb 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,7 +9,6 @@ Generated by: https://openapi-generator.tech """ - import copy import logging import multiprocessing @@ -21,7 +22,8 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' + 'minLength', 'pattern', 'maxItems', 'minItems', + 'uniqueItems', 'maxProperties', 'minProperties', } class Configuration(object): @@ -75,8 +77,6 @@ class Configuration(object): :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: @@ -131,7 +131,7 @@ class Configuration(object): '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 + This is beccause 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. @@ -159,14 +159,12 @@ class Configuration(object): def __init__(self, host=None, api_key=None, api_key_prefix=None, - access_token=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 """ @@ -185,7 +183,6 @@ def __init__(self, host=None, """Temp file folder for downloading files """ # Authentication Settings - self.access_token = access_token self.api_key = {} if api_key: self.api_key = api_key @@ -212,6 +209,9 @@ def __init__(self, host=None, self.signing_info = signing_info """The HTTP signing configuration """ + self.access_token = None + """access token for OAuth/Bearer + """ self.logger = {} """Logging Settings """ @@ -238,7 +238,7 @@ def __init__(self, host=None, Set this to false to skip verifying SSL certificate when calling API from https server. """ - self.ssl_ca_cert = ssl_ca_cert + self.ssl_ca_cert = None """Set this to customize the certificate file to verify the peer. """ self.cert_file = None @@ -262,9 +262,6 @@ def __init__(self, host=None, self.proxy = None """Proxy URL """ - self.no_proxy = None - """bypass proxy for host in the no_proxy list. - """ self.proxy_headers = None """Proxy headers """ @@ -304,7 +301,7 @@ def __setattr__(self, name, value): "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 + # Ensure the host paramater from signing info is the same as # Configuration.host. value.host = self.host @@ -535,7 +532,7 @@ def get_host_settings(self): "qa-petstore", "dev-petstore" ] - }, + }, 'port': { 'description': "No description provided", 'default_value': "80", @@ -543,8 +540,8 @@ def get_host_settings(self): "80", "8080" ] + } } - } }, { 'url': "https://localhost:8080/{version}", @@ -557,8 +554,8 @@ def get_host_settings(self): "v1", "v2" ] + } } - } } ] diff --git a/samples/openapi3/client/petstore/python/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python/petstore_api/exceptions.py index d223cb4876ce..ed422fd2d0e2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/exceptions.py +++ b/samples/openapi3/client/petstore/python/petstore_api/exceptions.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -97,12 +99,12 @@ def __init__(self, msg, path_to_item=None): 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() + def __init__(self, status=None, reason=None, api_response: 'petstore_api.api_client.ApiResponse' = None): + if api_response: + self.status = api_response.response.status + self.reason = api_response.response.reason + self.body = api_response.response.data + self.headers = api_response.response.getheaders() else: self.status = status self.reason = reason @@ -111,7 +113,7 @@ def __init__(self, status=None, reason=None, http_resp=None): def __str__(self): """Custom error messages for exception""" - error_message = "Status Code: {0}\n"\ + error_message = "({0})\n"\ "Reason: {1}\n".format(self.status, self.reason) if self.headers: error_message += "HTTP response headers: {0}\n".format( @@ -123,30 +125,6 @@ def __str__(self): 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 = "" diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.py index 307a8c772ff0..79ca58cf2307 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,285 +9,299 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class AdditionalPropertiesClass(ModelNormal): +class AdditionalPropertiesClass( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'map_property': ({str: (str,)},), # noqa: E501 - 'map_of_map_property': ({str: ({str: (str,)},)},), # noqa: E501 - 'anytype_1': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 - 'map_with_undeclared_properties_anytype_1': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'map_with_undeclared_properties_anytype_2': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'map_with_undeclared_properties_anytype_3': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'empty_map': (dict,), # noqa: E501 - 'map_with_undeclared_properties_string': ({str: (str,)},), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'map_property': 'map_property', # noqa: E501 - 'map_of_map_property': 'map_of_map_property', # noqa: E501 - 'anytype_1': 'anytype_1', # noqa: E501 - 'map_with_undeclared_properties_anytype_1': 'map_with_undeclared_properties_anytype_1', # noqa: E501 - 'map_with_undeclared_properties_anytype_2': 'map_with_undeclared_properties_anytype_2', # noqa: E501 - 'map_with_undeclared_properties_anytype_3': 'map_with_undeclared_properties_anytype_3', # noqa: E501 - 'empty_map': 'empty_map', # noqa: E501 - 'map_with_undeclared_properties_string': 'map_with_undeclared_properties_string', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - map_property ({str: (str,)}): [optional] # noqa: E501 - map_of_map_property ({str: ({str: (str,)},)}): [optional] # noqa: E501 - anytype_1 (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - map_with_undeclared_properties_anytype_1 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - map_with_undeclared_properties_anytype_2 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - map_with_undeclared_properties_anytype_3 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - empty_map (dict): an object with no declared properties and no undeclared properties, hence it's an empty map.. [optional] # noqa: E501 - map_with_undeclared_properties_string ({str: (str,)}): [optional] # noqa: E501 - """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + class MetaOapg: + + class properties: + + + class map_property( + schemas.DictSchema + ): + + + class MetaOapg: + additional_properties = schemas.StrSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, str, ], + ) -> 'map_property': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - map_property ({str: (str,)}): [optional] # noqa: E501 - map_of_map_property ({str: ({str: (str,)},)}): [optional] # noqa: E501 - anytype_1 (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - map_with_undeclared_properties_anytype_1 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - map_with_undeclared_properties_anytype_2 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - map_with_undeclared_properties_anytype_3 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - empty_map (dict): an object with no declared properties and no undeclared properties, hence it's an empty map.. [optional] # noqa: E501 - map_with_undeclared_properties_string ({str: (str,)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + + + class map_of_map_property( + schemas.DictSchema + ): + + + class MetaOapg: + + + class additional_properties( + schemas.DictSchema + ): + + + class MetaOapg: + additional_properties = schemas.StrSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, str, ], + ) -> 'additional_properties': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ], + ) -> 'map_of_map_property': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + anytype_1 = schemas.AnyTypeSchema + map_with_undeclared_properties_anytype_1 = schemas.DictSchema + map_with_undeclared_properties_anytype_2 = schemas.DictSchema + + + class map_with_undeclared_properties_anytype_3( + schemas.DictSchema + ): + + + class MetaOapg: + additional_properties = schemas.AnyTypeSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + ) -> 'map_with_undeclared_properties_anytype_3': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + class empty_map( + schemas.DictSchema + ): + + + class MetaOapg: + additional_properties = schemas.NotAnyTypeSchema + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'empty_map': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) + + + class map_with_undeclared_properties_string( + schemas.DictSchema + ): + + + class MetaOapg: + additional_properties = schemas.StrSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, str, ], + ) -> 'map_with_undeclared_properties_string': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + __annotations__ = { + "map_property": map_property, + "map_of_map_property": map_of_map_property, + "anytype_1": anytype_1, + "map_with_undeclared_properties_anytype_1": map_with_undeclared_properties_anytype_1, + "map_with_undeclared_properties_anytype_2": map_with_undeclared_properties_anytype_2, + "map_with_undeclared_properties_anytype_3": map_with_undeclared_properties_anytype_3, + "empty_map": empty_map, + "map_with_undeclared_properties_string": map_with_undeclared_properties_string, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["map_property"]) -> MetaOapg.properties.map_property: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["map_of_map_property"]) -> MetaOapg.properties.map_of_map_property: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["anytype_1"]) -> MetaOapg.properties.anytype_1: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_1"]) -> MetaOapg.properties.map_with_undeclared_properties_anytype_1: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_2"]) -> MetaOapg.properties.map_with_undeclared_properties_anytype_2: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_3"]) -> MetaOapg.properties.map_with_undeclared_properties_anytype_3: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["empty_map"]) -> MetaOapg.properties.empty_map: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["map_with_undeclared_properties_string"]) -> MetaOapg.properties.map_with_undeclared_properties_string: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["map_property", "map_of_map_property", "anytype_1", "map_with_undeclared_properties_anytype_1", "map_with_undeclared_properties_anytype_2", "map_with_undeclared_properties_anytype_3", "empty_map", "map_with_undeclared_properties_string", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["map_property"]) -> typing.Union[MetaOapg.properties.map_property, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["map_of_map_property"]) -> typing.Union[MetaOapg.properties.map_of_map_property, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["anytype_1"]) -> typing.Union[MetaOapg.properties.anytype_1, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_1"]) -> typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_1, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_2"]) -> typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_2, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["map_with_undeclared_properties_anytype_3"]) -> typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_3, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["empty_map"]) -> typing.Union[MetaOapg.properties.empty_map, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["map_with_undeclared_properties_string"]) -> typing.Union[MetaOapg.properties.map_with_undeclared_properties_string, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["map_property", "map_of_map_property", "anytype_1", "map_with_undeclared_properties_anytype_1", "map_with_undeclared_properties_anytype_2", "map_with_undeclared_properties_anytype_3", "empty_map", "map_with_undeclared_properties_string", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + map_property: typing.Union[MetaOapg.properties.map_property, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_of_map_property: typing.Union[MetaOapg.properties.map_of_map_property, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + anytype_1: typing.Union[MetaOapg.properties.anytype_1, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + map_with_undeclared_properties_anytype_1: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_1, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_with_undeclared_properties_anytype_2: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_2, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_with_undeclared_properties_anytype_3: typing.Union[MetaOapg.properties.map_with_undeclared_properties_anytype_3, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + empty_map: typing.Union[MetaOapg.properties.empty_map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_with_undeclared_properties_string: typing.Union[MetaOapg.properties.map_with_undeclared_properties_string, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'AdditionalPropertiesClass': + return super().__new__( + cls, + *args, + map_property=map_property, + map_of_map_property=map_of_map_property, + anytype_1=anytype_1, + map_with_undeclared_properties_anytype_1=map_with_undeclared_properties_anytype_1, + map_with_undeclared_properties_anytype_2=map_with_undeclared_properties_anytype_2, + map_with_undeclared_properties_anytype_3=map_with_undeclared_properties_anytype_3, + empty_map=empty_map, + map_with_undeclared_properties_string=map_with_undeclared_properties_string, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_validator.py b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_validator.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_validator.py rename to samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_validator.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_validator.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_validator.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_validator.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_validator.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_with_array_of_enums.py index 9b33b4689d5f..2a0bbc303134 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_with_array_of_enums.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_with_array_of_enums.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,259 +9,76 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.enum_class import EnumClass - globals()['EnumClass'] = EnumClass - -class AdditionalPropertiesWithArrayOfEnums(ModelNormal): +class AdditionalPropertiesWithArrayOfEnums( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ([EnumClass],) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesWithArrayOfEnums - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AdditionalPropertiesWithArrayOfEnums - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + + + class additional_properties( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['EnumClass']: + return EnumClass + + def __new__( + cls, + arg: typing.Union[typing.Tuple['EnumClass'], typing.List['EnumClass']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'additional_properties': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'EnumClass': + return super().__getitem__(i) + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, list, tuple, ], + ) -> 'AdditionalPropertiesWithArrayOfEnums': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.enum_class import EnumClass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_with_array_of_enums.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_with_array_of_enums.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/address.py b/samples/openapi3/client/petstore/python/petstore_api/model/address.py index 6ab145672442..64fb96cfb9fa 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/address.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/address.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,253 +9,49 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class Address(ModelNormal): +class Address( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (int,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Address - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Address - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + additional_properties = schemas.IntSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, decimal.Decimal, int, ], + ) -> 'Address': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/address.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/address.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/animal.py b/samples/openapi3/client/petstore/python/petstore_api/model/animal.py index b93180ea0559..06d7246fa33a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/animal.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,286 +9,97 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.cat import Cat - from petstore_api.model.dog import Dog - globals()['Cat'] = Cat - globals()['Dog'] = Dog - -class Animal(ModelNormal): +class Animal( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'class_name': (str,), # noqa: E501 - 'color': (str,), # noqa: E501 - 'tail': (bool,), # noqa: E501 + class MetaOapg: + required = { + "className", } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'Cat': Cat, - 'Dog': Dog, - } - if not val: - return None - return {'class_name': val} - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'color': 'color', # noqa: E501 - 'tail': 'tail', # noqa: E501 - } - - read_only_vars = { - 'tail', # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501 - """Animal - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """Animal - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + @staticmethod + def discriminator(): + return { + 'className': { + 'Cat': Cat, + 'Dog': Dog, + } + } + + class properties: + className = schemas.StrSchema + color = schemas.StrSchema + __annotations__ = { + "className": className, + "color": color, + } + + className: MetaOapg.properties.className + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["color"]) -> MetaOapg.properties.color: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["className", "color", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["color"]) -> typing.Union[MetaOapg.properties.color, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className", "color", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + className: typing.Union[MetaOapg.properties.className, str, ], + color: typing.Union[MetaOapg.properties.color, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Animal': + return super().__new__( + cls, + *args, + className=className, + color=color, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.cat import Cat +from petstore_api.model.dog import Dog diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/animal.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/animal.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.py index 89062cff69cb..082a4988ce73 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,285 +9,48 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.animal import Animal - globals()['Animal'] = Animal - -class AnimalFarm(ModelSimple): +class AnimalFarm( + schemas.ListSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'value': ([Animal],), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """AnimalFarm - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] ([Animal]): # noqa: E501 - - Keyword Args: - value ([Animal]): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """AnimalFarm - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] ([Animal]): # noqa: E501 - - Keyword Args: - value ([Animal]): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + class MetaOapg: + + @staticmethod + def items() -> typing.Type['Animal']: + return Animal - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + def __new__( + cls, + arg: typing.Union[typing.Tuple['Animal'], typing.List['Animal']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'AnimalFarm': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + def __getitem__(self, i: int) -> 'Animal': + return super().__getitem__(i) - return self +from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/any_type_and_format.py b/samples/openapi3/client/petstore/python/petstore_api/model/any_type_and_format.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/any_type_and_format.py rename to samples/openapi3/client/petstore/python/petstore_api/model/any_type_and_format.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/any_type_and_format.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/any_type_and_format.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/any_type_and_format.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/any_type_and_format.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/any_type_not_string.py b/samples/openapi3/client/petstore/python/petstore_api/model/any_type_not_string.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/any_type_not_string.py rename to samples/openapi3/client/petstore/python/petstore_api/model/any_type_not_string.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/any_type_not_string.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/any_type_not_string.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/any_type_not_string.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/any_type_not_string.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/api_response.py b/samples/openapi3/client/petstore/python/petstore_api/model/api_response.py index 5e21cdaf5988..236e29d4e780 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/api_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/api_response.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,265 +9,90 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class ApiResponse(ModelNormal): +class ApiResponse( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'code': (int,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'message': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'code': 'code', # noqa: E501 - 'type': 'type', # noqa: E501 - 'message': 'message', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - code (int): [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - code (int): [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + + class properties: + code = schemas.Int32Schema + type = schemas.StrSchema + message = schemas.StrSchema + __annotations__ = { + "code": code, + "type": type, + "message": message, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["code"]) -> MetaOapg.properties.code: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["type"]) -> MetaOapg.properties.type: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["message"]) -> MetaOapg.properties.message: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["code", "type", "message", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["code"]) -> typing.Union[MetaOapg.properties.code, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["type"]) -> typing.Union[MetaOapg.properties.type, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["message"]) -> typing.Union[MetaOapg.properties.message, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["code", "type", "message", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + code: typing.Union[MetaOapg.properties.code, decimal.Decimal, int, schemas.Unset] = schemas.unset, + type: typing.Union[MetaOapg.properties.type, str, schemas.Unset] = schemas.unset, + message: typing.Union[MetaOapg.properties.message, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'ApiResponse': + return super().__new__( + cls, + *args, + code=code, + type=type, + message=message, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/api_response.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/api_response.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/apple.py b/samples/openapi3/client/petstore/python/petstore_api/model/apple.py index 9909e1994ab7..638edc274dc5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/apple.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/apple.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,278 +9,110 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class Apple(ModelNormal): +class Apple( + schemas.DictBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneFrozenDictMixin +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - ('cultivar',): { - 'regex': { - 'pattern': r'^[a-zA-Z\s]*$', # noqa: E501 - }, - }, - ('origin',): { - 'regex': { - 'pattern': r'^[A-Z\s]*$', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'cultivar': (str,), # noqa: E501 - 'origin': (str,), # noqa: E501 + class MetaOapg: + required = { + "cultivar", } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'cultivar': 'cultivar', # noqa: E501 - 'origin': 'origin', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, cultivar, *args, **kwargs): # noqa: E501 - """Apple - a model defined in OpenAPI - - Args: - cultivar (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - origin (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.cultivar = cultivar - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, cultivar, *args, **kwargs): # noqa: E501 - """Apple - a model defined in OpenAPI - - Args: - cultivar (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - origin (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.cultivar = cultivar - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + class properties: + + + class cultivar( + schemas.StrSchema + ): + + + class MetaOapg: + regex=[{ + 'pattern': r'^[a-zA-Z\s]*$', # noqa: E501 + }] + + + class origin( + schemas.StrSchema + ): + + + class MetaOapg: + regex=[{ + 'pattern': r'^[A-Z\s]*$', # noqa: E501 + 'flags': ( + re.IGNORECASE + ) + }] + __annotations__ = { + "cultivar": cultivar, + "origin": origin, + } + + + cultivar: MetaOapg.properties.cultivar + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["origin"]) -> MetaOapg.properties.origin: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["cultivar", "origin", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["origin"]) -> typing.Union[MetaOapg.properties.origin, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["cultivar", "origin", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, None, ], + origin: typing.Union[MetaOapg.properties.origin, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Apple': + return super().__new__( + cls, + *args, + origin=origin, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/apple.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/apple.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/apple_req.py b/samples/openapi3/client/petstore/python/petstore_api/model/apple_req.py index ce9ae6721e57..03d83c22cffc 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/apple_req.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/apple_req.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,261 +9,76 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class AppleReq(ModelNormal): +class AppleReq( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'cultivar': (str,), # noqa: E501 - 'mealy': (bool,), # noqa: E501 + class MetaOapg: + required = { + "cultivar", } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'cultivar': 'cultivar', # noqa: E501 - 'mealy': 'mealy', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, cultivar, *args, **kwargs): # noqa: E501 - """AppleReq - a model defined in OpenAPI - - Args: - cultivar (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - mealy (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.cultivar = cultivar - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, cultivar, *args, **kwargs): # noqa: E501 - """AppleReq - a model defined in OpenAPI - - Args: - cultivar (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - mealy (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.cultivar = cultivar - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + class properties: + cultivar = schemas.StrSchema + mealy = schemas.BoolSchema + __annotations__ = { + "cultivar": cultivar, + "mealy": mealy, + } + additional_properties = schemas.NotAnyTypeSchema + + cultivar: MetaOapg.properties.cultivar + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["mealy"]) -> MetaOapg.properties.mealy: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["cultivar"], typing_extensions.Literal["mealy"], ]): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["cultivar"]) -> MetaOapg.properties.cultivar: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["mealy"]) -> typing.Union[MetaOapg.properties.mealy, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["cultivar"], typing_extensions.Literal["mealy"], ]): + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + cultivar: typing.Union[MetaOapg.properties.cultivar, str, ], + mealy: typing.Union[MetaOapg.properties.mealy, bool, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'AppleReq': + return super().__new__( + cls, + *args, + cultivar=cultivar, + mealy=mealy, + _configuration=_configuration, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/apple_req.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/apple_req.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_holding_any_type.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py rename to samples/openapi3/client/petstore/python/petstore_api/model/array_holding_any_type.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/array_holding_any_type.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/array_holding_any_type.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py index 41e90e2ae966..5237741d8382 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,257 +9,114 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class ArrayOfArrayOfNumberOnly(ModelNormal): +class ArrayOfArrayOfNumberOnly( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'array_array_number': ([[float]],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'array_array_number': 'ArrayArrayNumber', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_array_number ([[float]]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + class MetaOapg: + + class properties: + + + class ArrayArrayNumber( + schemas.ListSchema + ): + + + class MetaOapg: + + + class items( + schemas.ListSchema + ): + + + class MetaOapg: + items = schemas.NumberSchema + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'items': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, list, tuple, ]], typing.List[typing.Union[MetaOapg.items, list, tuple, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'ArrayArrayNumber': + return super().__new__( + cls, + arg, + _configuration=_configuration, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_array_number ([[float]]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + __annotations__ = { + "ArrayArrayNumber": ArrayArrayNumber, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["ArrayArrayNumber"]) -> MetaOapg.properties.ArrayArrayNumber: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["ArrayArrayNumber", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["ArrayArrayNumber"]) -> typing.Union[MetaOapg.properties.ArrayArrayNumber, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["ArrayArrayNumber", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + ArrayArrayNumber: typing.Union[MetaOapg.properties.ArrayArrayNumber, list, tuple, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'ArrayOfArrayOfNumberOnly': + return super().__new__( + cls, + *args, + ArrayArrayNumber=ArrayArrayNumber, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.py index 8ca15fd6c8fb..d7eb9d4838d5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,285 +9,48 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.string_enum import StringEnum - globals()['StringEnum'] = StringEnum - -class ArrayOfEnums(ModelSimple): +class ArrayOfEnums( + schemas.ListSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'value': ([StringEnum],), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """ArrayOfEnums - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] ([StringEnum]): # noqa: E501 - - Keyword Args: - value ([StringEnum]): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """ArrayOfEnums - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] ([StringEnum]): # noqa: E501 - - Keyword Args: - value ([StringEnum]): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + class MetaOapg: + + @staticmethod + def items() -> typing.Type['StringEnum']: + return StringEnum - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + def __new__( + cls, + arg: typing.Union[typing.Tuple['StringEnum'], typing.List['StringEnum']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'ArrayOfEnums': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + def __getitem__(self, i: int) -> 'StringEnum': + return super().__getitem__(i) - return self +from petstore_api.model.string_enum import StringEnum diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.py index 068dc80b1a90..9c5a9b55d24c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,257 +9,92 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class ArrayOfNumberOnly(ModelNormal): +class ArrayOfNumberOnly( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'array_number': ([float],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'array_number': 'ArrayNumber', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ArrayOfNumberOnly - a model defined in OpenAPI - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_number ([float]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + class MetaOapg: + + class properties: + + + class ArrayNumber( + schemas.ListSchema + ): + + + class MetaOapg: + items = schemas.NumberSchema + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'ArrayNumber': + return super().__new__( + cls, + arg, + _configuration=_configuration, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ArrayOfNumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_number ([float]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + __annotations__ = { + "ArrayNumber": ArrayNumber, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["ArrayNumber"]) -> MetaOapg.properties.ArrayNumber: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["ArrayNumber", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["ArrayNumber"]) -> typing.Union[MetaOapg.properties.ArrayNumber, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["ArrayNumber", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + ArrayNumber: typing.Union[MetaOapg.properties.ArrayNumber, list, tuple, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'ArrayOfNumberOnly': + return super().__new__( + cls, + *args, + ArrayNumber=ArrayNumber, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_test.py index 119a5ad1fdd0..d53b0df62d3e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/array_test.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,271 +9,205 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.read_only_first import ReadOnlyFirst - globals()['ReadOnlyFirst'] = ReadOnlyFirst - -class ArrayTest(ModelNormal): +class ArrayTest( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'array_of_string': ([str],), # noqa: E501 - 'array_array_of_integer': ([[int]],), # noqa: E501 - 'array_array_of_model': ([[ReadOnlyFirst]],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'array_of_string': 'array_of_string', # noqa: E501 - 'array_array_of_integer': 'array_array_of_integer', # noqa: E501 - 'array_array_of_model': 'array_array_of_model', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ArrayTest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_of_string ([str]): [optional] # noqa: E501 - array_array_of_integer ([[int]]): [optional] # noqa: E501 - array_array_of_model ([[ReadOnlyFirst]]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + class MetaOapg: + + class properties: + + + class array_of_string( + schemas.ListSchema + ): + + + class MetaOapg: + items = schemas.StrSchema + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'array_of_string': + return super().__new__( + cls, + arg, + _configuration=_configuration, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ArrayTest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - array_of_string ([str]): [optional] # noqa: E501 - array_array_of_integer ([[int]]): [optional] # noqa: E501 - array_array_of_model ([[ReadOnlyFirst]]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + + class array_array_of_integer( + schemas.ListSchema + ): + + + class MetaOapg: + + + class items( + schemas.ListSchema + ): + + + class MetaOapg: + items = schemas.Int64Schema + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'items': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, list, tuple, ]], typing.List[typing.Union[MetaOapg.items, list, tuple, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'array_array_of_integer': + return super().__new__( + cls, + arg, + _configuration=_configuration, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + + class array_array_of_model( + schemas.ListSchema + ): + + + class MetaOapg: + + + class items( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['ReadOnlyFirst']: + return ReadOnlyFirst + + def __new__( + cls, + arg: typing.Union[typing.Tuple['ReadOnlyFirst'], typing.List['ReadOnlyFirst']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'items': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'ReadOnlyFirst': + return super().__getitem__(i) + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, list, tuple, ]], typing.List[typing.Union[MetaOapg.items, list, tuple, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'array_array_of_model': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + __annotations__ = { + "array_of_string": array_of_string, + "array_array_of_integer": array_array_of_integer, + "array_array_of_model": array_array_of_model, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["array_of_string"]) -> MetaOapg.properties.array_of_string: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["array_array_of_integer"]) -> MetaOapg.properties.array_array_of_integer: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["array_array_of_model"]) -> MetaOapg.properties.array_array_of_model: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["array_of_string", "array_array_of_integer", "array_array_of_model", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["array_of_string"]) -> typing.Union[MetaOapg.properties.array_of_string, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["array_array_of_integer"]) -> typing.Union[MetaOapg.properties.array_array_of_integer, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["array_array_of_model"]) -> typing.Union[MetaOapg.properties.array_array_of_model, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["array_of_string", "array_array_of_integer", "array_array_of_model", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + array_of_string: typing.Union[MetaOapg.properties.array_of_string, list, tuple, schemas.Unset] = schemas.unset, + array_array_of_integer: typing.Union[MetaOapg.properties.array_array_of_integer, list, tuple, schemas.Unset] = schemas.unset, + array_array_of_model: typing.Union[MetaOapg.properties.array_array_of_model, list, tuple, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'ArrayTest': + return super().__new__( + cls, + *args, + array_of_string=array_of_string, + array_array_of_integer=array_array_of_integer, + array_array_of_model=array_array_of_model, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.read_only_first import ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/array_test.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/array_test.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_with_validations_in_items.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py rename to samples/openapi3/client/petstore/python/petstore_api/model/array_with_validations_in_items.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/array_with_validations_in_items.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/array_with_validations_in_items.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/banana.py b/samples/openapi3/client/petstore/python/petstore_api/model/banana.py index f6f6792990d8..b3d1c7d792df 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/banana.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/banana.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,263 +9,75 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class Banana(ModelNormal): +class Banana( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'length_cm': (float,), # noqa: E501 + class MetaOapg: + required = { + "lengthCm", } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'length_cm': 'lengthCm', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, length_cm, *args, **kwargs): # noqa: E501 - """Banana - a model defined in OpenAPI - - Args: - length_cm (float): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.length_cm = length_cm - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, length_cm, *args, **kwargs): # noqa: E501 - """Banana - a model defined in OpenAPI - - Args: - length_cm (float): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.length_cm = length_cm - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + class properties: + lengthCm = schemas.NumberSchema + __annotations__ = { + "lengthCm": lengthCm, + } + + lengthCm: MetaOapg.properties.lengthCm + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["lengthCm", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["lengthCm", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + lengthCm: typing.Union[MetaOapg.properties.lengthCm, decimal.Decimal, int, float, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Banana': + return super().__new__( + cls, + *args, + lengthCm=lengthCm, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/banana.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/banana.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/banana_req.py b/samples/openapi3/client/petstore/python/petstore_api/model/banana_req.py index 1e6d97d13430..1fdfa7d34acf 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/banana_req.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/banana_req.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,261 +9,76 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class BananaReq(ModelNormal): +class BananaReq( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'length_cm': (float,), # noqa: E501 - 'sweet': (bool,), # noqa: E501 + class MetaOapg: + required = { + "lengthCm", } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'length_cm': 'lengthCm', # noqa: E501 - 'sweet': 'sweet', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, length_cm, *args, **kwargs): # noqa: E501 - """BananaReq - a model defined in OpenAPI - - Args: - length_cm (float): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sweet (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.length_cm = length_cm - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, length_cm, *args, **kwargs): # noqa: E501 - """BananaReq - a model defined in OpenAPI - - Args: - length_cm (float): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sweet (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.length_cm = length_cm - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + class properties: + lengthCm = schemas.NumberSchema + sweet = schemas.BoolSchema + __annotations__ = { + "lengthCm": lengthCm, + "sweet": sweet, + } + additional_properties = schemas.NotAnyTypeSchema + + lengthCm: MetaOapg.properties.lengthCm + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["sweet"]) -> MetaOapg.properties.sweet: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["lengthCm"], typing_extensions.Literal["sweet"], ]): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["lengthCm"]) -> MetaOapg.properties.lengthCm: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["sweet"]) -> typing.Union[MetaOapg.properties.sweet, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["lengthCm"], typing_extensions.Literal["sweet"], ]): + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + lengthCm: typing.Union[MetaOapg.properties.lengthCm, decimal.Decimal, int, float, ], + sweet: typing.Union[MetaOapg.properties.sweet, bool, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'BananaReq': + return super().__new__( + cls, + *args, + lengthCm=lengthCm, + sweet=sweet, + _configuration=_configuration, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/banana_req.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/banana_req.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py b/samples/openapi3/client/petstore/python/petstore_api/model/bar.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py rename to samples/openapi3/client/petstore/python/petstore_api/model/bar.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/bar.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/bar.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.py b/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.py index 456066d2ce5e..528cfa498b0d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,263 +9,90 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class BasquePig(ModelNormal): +class BasquePig( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'class_name': (str,), # noqa: E501 + class MetaOapg: + required = { + "className", } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'class_name': 'className', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501 - """BasquePig - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """BasquePig - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + class properties: + + + class className( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "BasquePig": "BASQUE_PIG", + } + + @schemas.classproperty + def BASQUE_PIG(cls): + return cls("BasquePig") + __annotations__ = { + "className": className, + } + + className: MetaOapg.properties.className + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["className", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + className: typing.Union[MetaOapg.properties.className, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'BasquePig': + return super().__new__( + cls, + *args, + className=className, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py b/samples/openapi3/client/petstore/python/petstore_api/model/boolean.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py rename to samples/openapi3/client/petstore/python/petstore_api/model/boolean.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/boolean.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/boolean.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/boolean_enum.py b/samples/openapi3/client/petstore/python/petstore_api/model/boolean_enum.py index e4002fb8f622..66d5be713125 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/boolean_enum.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/boolean_enum.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,275 +9,36 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class BooleanEnum(ModelSimple): +class BooleanEnum( + schemas.EnumBase, + schemas.BoolSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - ('value',): { - 'TRUE': True, - }, - } - - validations = { - } - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (bool,), + class MetaOapg: + enum_value_to_name = { + schemas.BoolClass.TRUE: "TRUE", } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """BooleanEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (bool): if omitted defaults to True, must be one of [True, ] # noqa: E501 - - Keyword Args: - value (bool): if omitted defaults to True, must be one of [True, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = True - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """BooleanEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (bool): if omitted defaults to True, must be one of [True, ] # noqa: E501 - - Keyword Args: - value (bool): if omitted defaults to True, must be one of [True, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = True - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self + + @schemas.classproperty + def TRUE(cls): + return cls(True) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/boolean_enum.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/boolean_enum.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.py b/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.py index d57e30d2c85e..3dc195865d41 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,277 +9,120 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class Capitalization(ModelNormal): +class Capitalization( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'small_camel': (str,), # noqa: E501 - 'capital_camel': (str,), # noqa: E501 - 'small_snake': (str,), # noqa: E501 - 'capital_snake': (str,), # noqa: E501 - 'sca_eth_flow_points': (str,), # noqa: E501 - 'att_name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'small_camel': 'smallCamel', # noqa: E501 - 'capital_camel': 'CapitalCamel', # noqa: E501 - 'small_snake': 'small_Snake', # noqa: E501 - 'capital_snake': 'Capital_Snake', # noqa: E501 - 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', # noqa: E501 - 'att_name': 'ATT_NAME', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Capitalization - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - small_camel (str): [optional] # noqa: E501 - capital_camel (str): [optional] # noqa: E501 - small_snake (str): [optional] # noqa: E501 - capital_snake (str): [optional] # noqa: E501 - sca_eth_flow_points (str): [optional] # noqa: E501 - att_name (str): Name of the pet . [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Capitalization - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - small_camel (str): [optional] # noqa: E501 - capital_camel (str): [optional] # noqa: E501 - small_snake (str): [optional] # noqa: E501 - capital_snake (str): [optional] # noqa: E501 - sca_eth_flow_points (str): [optional] # noqa: E501 - att_name (str): Name of the pet . [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + + class properties: + smallCamel = schemas.StrSchema + CapitalCamel = schemas.StrSchema + small_Snake = schemas.StrSchema + Capital_Snake = schemas.StrSchema + SCA_ETH_Flow_Points = schemas.StrSchema + ATT_NAME = schemas.StrSchema + __annotations__ = { + "smallCamel": smallCamel, + "CapitalCamel": CapitalCamel, + "small_Snake": small_Snake, + "Capital_Snake": Capital_Snake, + "SCA_ETH_Flow_Points": SCA_ETH_Flow_Points, + "ATT_NAME": ATT_NAME, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["smallCamel"]) -> MetaOapg.properties.smallCamel: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["CapitalCamel"]) -> MetaOapg.properties.CapitalCamel: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["small_Snake"]) -> MetaOapg.properties.small_Snake: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["Capital_Snake"]) -> MetaOapg.properties.Capital_Snake: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["SCA_ETH_Flow_Points"]) -> MetaOapg.properties.SCA_ETH_Flow_Points: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["ATT_NAME"]) -> MetaOapg.properties.ATT_NAME: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["smallCamel", "CapitalCamel", "small_Snake", "Capital_Snake", "SCA_ETH_Flow_Points", "ATT_NAME", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["smallCamel"]) -> typing.Union[MetaOapg.properties.smallCamel, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["CapitalCamel"]) -> typing.Union[MetaOapg.properties.CapitalCamel, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["small_Snake"]) -> typing.Union[MetaOapg.properties.small_Snake, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["Capital_Snake"]) -> typing.Union[MetaOapg.properties.Capital_Snake, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["SCA_ETH_Flow_Points"]) -> typing.Union[MetaOapg.properties.SCA_ETH_Flow_Points, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["ATT_NAME"]) -> typing.Union[MetaOapg.properties.ATT_NAME, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["smallCamel", "CapitalCamel", "small_Snake", "Capital_Snake", "SCA_ETH_Flow_Points", "ATT_NAME", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + smallCamel: typing.Union[MetaOapg.properties.smallCamel, str, schemas.Unset] = schemas.unset, + CapitalCamel: typing.Union[MetaOapg.properties.CapitalCamel, str, schemas.Unset] = schemas.unset, + small_Snake: typing.Union[MetaOapg.properties.small_Snake, str, schemas.Unset] = schemas.unset, + Capital_Snake: typing.Union[MetaOapg.properties.Capital_Snake, str, schemas.Unset] = schemas.unset, + SCA_ETH_Flow_Points: typing.Union[MetaOapg.properties.SCA_ETH_Flow_Points, str, schemas.Unset] = schemas.unset, + ATT_NAME: typing.Union[MetaOapg.properties.ATT_NAME, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Capitalization': + return super().__new__( + cls, + *args, + smallCamel=smallCamel, + CapitalCamel=CapitalCamel, + small_Snake=small_Snake, + Capital_Snake=Capital_Snake, + SCA_ETH_Flow_Points=SCA_ETH_Flow_Points, + ATT_NAME=ATT_NAME, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/capitalization.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/cat.py b/samples/openapi3/client/petstore/python/petstore_api/model/cat.py index 04a16c49115e..da07def367b4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/cat.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/cat.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,332 +9,109 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.animal import Animal - from petstore_api.model.cat_all_of import CatAllOf - globals()['Animal'] = Animal - globals()['CatAllOf'] = CatAllOf - -class Cat(ModelComposed): +class Cat( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'class_name': (str,), # noqa: E501 - 'declawed': (bool,), # noqa: E501 - 'color': (str,), # noqa: E501 - 'tail': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - val = { - } - if not val: - return None - return {'class_name': val} - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'declawed': 'declawed', # noqa: E501 - 'color': 'color', # noqa: E501 - 'tail': 'tail', # noqa: E501 - } - - read_only_vars = { - 'tail', # noqa: E501 - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Cat - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - declawed (bool): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Cat - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - declawed (bool): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - Animal, - CatAllOf, - ], - 'oneOf': [ - ], - } + class MetaOapg: + + + class all_of_1( + schemas.DictSchema + ): + + + class MetaOapg: + + class properties: + declawed = schemas.BoolSchema + __annotations__ = { + "declawed": declawed, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["declawed"]) -> MetaOapg.properties.declawed: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["declawed", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["declawed"]) -> typing.Union[MetaOapg.properties.declawed, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["declawed", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + declawed: typing.Union[MetaOapg.properties.declawed, bool, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + declawed=declawed, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @functools.lru_cache() + def all_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + Animal, + cls.all_of_1, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Cat': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/cat.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/cat.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/category.py b/samples/openapi3/client/petstore/python/petstore_api/model/category.py index 21fb7bd65b51..5537a4437bbf 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/category.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/category.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,269 +9,85 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class Category(ModelNormal): +class Category( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'id': (int,), # noqa: E501 + class MetaOapg: + required = { + "name", } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - 'id': 'id', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Category - a model defined in OpenAPI - - Args: - - Keyword Args: - name (str): defaults to "default-name" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - """ - - name = kwargs.get('name', "default-name") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Category - a model defined in OpenAPI - - Args: - - Keyword Args: - name (str): defaults to "default-name" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - """ - - name = kwargs.get('name', "default-name") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + class properties: + name = schemas.StrSchema + id = schemas.Int64Schema + __annotations__ = { + "name": name, + "id": id, + } + + name: MetaOapg.properties.name + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "id", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "id", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + name: typing.Union[MetaOapg.properties.name, str, ], + id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Category': + return super().__new__( + cls, + *args, + name=name, + id=id, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/category.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/category.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.py b/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.py index 6d971fd192aa..32db862b8a7a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,323 +9,109 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.child_cat_all_of import ChildCatAllOf - from petstore_api.model.parent_pet import ParentPet - globals()['ChildCatAllOf'] = ChildCatAllOf - globals()['ParentPet'] = ParentPet - -class ChildCat(ModelComposed): +class ChildCat( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'pet_type': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - val = { - } - if not val: - return None - return {'pet_type': val} - - attribute_map = { - 'pet_type': 'pet_type', # noqa: E501 - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ChildCat - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ChildCat - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ChildCatAllOf, - ParentPet, - ], - 'oneOf': [ - ], - } + class MetaOapg: + + + class all_of_1( + schemas.DictSchema + ): + + + class MetaOapg: + + class properties: + name = schemas.StrSchema + __annotations__ = { + "name": name, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + name=name, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @functools.lru_cache() + def all_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + ParentPet, + cls.all_of_1, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'ChildCat': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.parent_pet import ParentPet diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/child_cat.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/class_model.py b/samples/openapi3/client/petstore/python/petstore_api/model/class_model.py index cbbd0ff1e81c..75d36e823c2a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/class_model.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/class_model.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,257 +9,73 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class ClassModel(ModelNormal): +class ClassModel( + schemas.AnyTypeSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. + Model for testing model with "_class" property """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - '_class': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - '_class': '_class', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ClassModel - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ClassModel - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + + class properties: + _class = schemas.StrSchema + __annotations__ = { + "_class": _class, + } + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["_class"]) -> MetaOapg.properties._class: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["_class", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["_class"]) -> typing.Union[MetaOapg.properties._class, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["_class", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _class: typing.Union[MetaOapg.properties._class, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'ClassModel': + return super().__new__( + cls, + *args, + _class=_class, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/class_model.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/class_model.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/client.py b/samples/openapi3/client/petstore/python/petstore_api/model/client.py index 82c5a6ed6bb4..4c7c16b564eb 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/client.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,257 +9,70 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class Client(ModelNormal): +class Client( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'client': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'client': 'client', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Client - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - client (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Client - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - client (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + + class properties: + client = schemas.StrSchema + __annotations__ = { + "client": client, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["client"]) -> MetaOapg.properties.client: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["client", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["client"]) -> typing.Union[MetaOapg.properties.client, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["client", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + client: typing.Union[MetaOapg.properties.client, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Client': + return super().__new__( + cls, + *args, + client=client, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/client.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/client.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.py b/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.py index 3ad5b7a7180f..434c2c0c77ae 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,320 +9,124 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.quadrilateral_interface import QuadrilateralInterface - from petstore_api.model.shape_interface import ShapeInterface - globals()['QuadrilateralInterface'] = QuadrilateralInterface - globals()['ShapeInterface'] = ShapeInterface - -class ComplexQuadrilateral(ModelComposed): +class ComplexQuadrilateral( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'shape_type': (str,), # noqa: E501 - 'quadrilateral_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'shape_type': 'shapeType', # noqa: E501 - 'quadrilateral_type': 'quadrilateralType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ComplexQuadrilateral - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - quadrilateral_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ComplexQuadrilateral - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - quadrilateral_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - QuadrilateralInterface, - ShapeInterface, - ], - 'oneOf': [ - ], - } + class MetaOapg: + + + class all_of_1( + schemas.DictSchema + ): + + + class MetaOapg: + + class properties: + + + class quadrilateralType( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "ComplexQuadrilateral": "COMPLEX_QUADRILATERAL", + } + + @schemas.classproperty + def COMPLEX_QUADRILATERAL(cls): + return cls("ComplexQuadrilateral") + __annotations__ = { + "quadrilateralType": quadrilateralType, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["quadrilateralType", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["quadrilateralType"]) -> typing.Union[MetaOapg.properties.quadrilateralType, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["quadrilateralType", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + quadrilateralType: typing.Union[MetaOapg.properties.quadrilateralType, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + quadrilateralType=quadrilateralType, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @functools.lru_cache() + def all_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + QuadrilateralInterface, + cls.all_of_1, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'ComplexQuadrilateral': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.quadrilateral_interface import QuadrilateralInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_any_of_different_types_no_validations.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py rename to samples/openapi3/client/petstore/python/petstore_api/model/composed_any_of_different_types_no_validations.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/composed_any_of_different_types_no_validations.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/composed_any_of_different_types_no_validations.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_array.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py rename to samples/openapi3/client/petstore/python/petstore_api/model/composed_array.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/composed_array.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/composed_array.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_bool.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py rename to samples/openapi3/client/petstore/python/petstore_api/model/composed_bool.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/composed_bool.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/composed_bool.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_none.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py rename to samples/openapi3/client/petstore/python/petstore_api/model/composed_none.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/composed_none.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/composed_none.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_number.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py rename to samples/openapi3/client/petstore/python/petstore_api/model/composed_number.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/composed_number.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/composed_number.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_object.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py rename to samples/openapi3/client/petstore/python/petstore_api/model/composed_object.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/composed_object.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/composed_object.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_different_types.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py rename to samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_different_types.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_different_types.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_different_types.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_string.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py rename to samples/openapi3/client/petstore/python/petstore_api/model/composed_string.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/composed_string.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/composed_string.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.py b/samples/openapi3/client/petstore/python/petstore_api/model/currency.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.py rename to samples/openapi3/client/petstore/python/petstore_api/model/currency.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/currency.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/currency.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.py b/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.py index 3a37b353933c..bcffd8ff006d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,263 +9,90 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class DanishPig(ModelNormal): +class DanishPig( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'class_name': (str,), # noqa: E501 + class MetaOapg: + required = { + "className", } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'class_name': 'className', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501 - """DanishPig - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """DanishPig - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + class properties: + + + class className( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "DanishPig": "DANISH_PIG", + } + + @schemas.classproperty + def DANISH_PIG(cls): + return cls("DanishPig") + __annotations__ = { + "className": className, + } + + className: MetaOapg.properties.className + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["className", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + className: typing.Union[MetaOapg.properties.className, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'DanishPig': + return super().__new__( + cls, + *args, + className=className, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/date_time_test.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py rename to samples/openapi3/client/petstore/python/petstore_api/model/date_time_test.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/date_time_test.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/date_time_test.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py b/samples/openapi3/client/petstore/python/petstore_api/model/date_time_with_validations.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py rename to samples/openapi3/client/petstore/python/petstore_api/model/date_time_with_validations.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/date_time_with_validations.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/date_time_with_validations.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py b/samples/openapi3/client/petstore/python/petstore_api/model/date_with_validations.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py rename to samples/openapi3/client/petstore/python/petstore_api/model/date_with_validations.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/date_with_validations.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/date_with_validations.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.py b/samples/openapi3/client/petstore/python/petstore_api/model/decimal_payload.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.py rename to samples/openapi3/client/petstore/python/petstore_api/model/decimal_payload.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/decimal_payload.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/decimal_payload.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/dog.py b/samples/openapi3/client/petstore/python/petstore_api/model/dog.py index f5b4d580f081..a8dd43038d34 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/dog.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/dog.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,338 +9,109 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.animal import Animal - from petstore_api.model.dog_all_of import DogAllOf - from petstore_api.model.legs import Legs - globals()['Animal'] = Animal - globals()['DogAllOf'] = DogAllOf - globals()['Legs'] = Legs - -class Dog(ModelComposed): +class Dog( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'class_name': (str,), # noqa: E501 - 'breed': (str,), # noqa: E501 - 'legs': (Legs,), # noqa: E501 - 'color': (str,), # noqa: E501 - 'tail': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - val = { - } - if not val: - return None - return {'class_name': val} - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'breed': 'breed', # noqa: E501 - 'legs': 'legs', # noqa: E501 - 'color': 'color', # noqa: E501 - 'tail': 'tail', # noqa: E501 - } - - read_only_vars = { - 'tail', # noqa: E501 - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Dog - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - breed (str): [optional] # noqa: E501 - legs (Legs): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Dog - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - breed (str): [optional] # noqa: E501 - legs (Legs): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of "red" # noqa: E501 - tail (bool): [optional] if omitted the server will use the default value of True # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - Animal, - DogAllOf, - ], - 'oneOf': [ - ], - } + class MetaOapg: + + + class all_of_1( + schemas.DictSchema + ): + + + class MetaOapg: + + class properties: + breed = schemas.StrSchema + __annotations__ = { + "breed": breed, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["breed"]) -> MetaOapg.properties.breed: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["breed", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["breed"]) -> typing.Union[MetaOapg.properties.breed, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["breed", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + breed: typing.Union[MetaOapg.properties.breed, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + breed=breed, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @functools.lru_cache() + def all_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + Animal, + cls.all_of_1, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Dog': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/dog.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/dog.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/drawing.py b/samples/openapi3/client/petstore/python/petstore_api/model/drawing.py index c08b8d2a0bee..9c7b54ae9cd4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/drawing.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/drawing.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,281 +9,141 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.fruit import Fruit - from petstore_api.model.nullable_shape import NullableShape - from petstore_api.model.shape import Shape - from petstore_api.model.shape_or_null import ShapeOrNull - globals()['Fruit'] = Fruit - globals()['NullableShape'] = NullableShape - globals()['Shape'] = Shape - globals()['ShapeOrNull'] = ShapeOrNull - -class Drawing(ModelNormal): +class Drawing( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (Fruit,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'main_shape': (Shape,), # noqa: E501 - 'shape_or_null': (ShapeOrNull,), # noqa: E501 - 'nullable_shape': (NullableShape,), # noqa: E501 - 'shapes': ([Shape],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'main_shape': 'mainShape', # noqa: E501 - 'shape_or_null': 'shapeOrNull', # noqa: E501 - 'nullable_shape': 'nullableShape', # noqa: E501 - 'shapes': 'shapes', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Drawing - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - main_shape (Shape): [optional] # noqa: E501 - shape_or_null (ShapeOrNull): [optional] # noqa: E501 - nullable_shape (NullableShape): [optional] # noqa: E501 - shapes ([Shape]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Drawing - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - main_shape (Shape): [optional] # noqa: E501 - shape_or_null (ShapeOrNull): [optional] # noqa: E501 - nullable_shape (NullableShape): [optional] # noqa: E501 - shapes ([Shape]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + class MetaOapg: + + class properties: + + @staticmethod + def mainShape() -> typing.Type['Shape']: + return Shape + + @staticmethod + def shapeOrNull() -> typing.Type['ShapeOrNull']: + return ShapeOrNull + + @staticmethod + def nullableShape() -> typing.Type['NullableShape']: + return NullableShape + + + class shapes( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['Shape']: + return Shape + + def __new__( + cls, + arg: typing.Union[typing.Tuple['Shape'], typing.List['Shape']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'shapes': + return super().__new__( + cls, + arg, + _configuration=_configuration, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + def __getitem__(self, i: int) -> 'Shape': + return super().__getitem__(i) + __annotations__ = { + "mainShape": mainShape, + "shapeOrNull": shapeOrNull, + "nullableShape": nullableShape, + "shapes": shapes, + } + + @staticmethod + def additional_properties() -> typing.Type['Fruit']: + return Fruit + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["mainShape"]) -> 'Shape': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["shapeOrNull"]) -> 'ShapeOrNull': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["nullableShape"]) -> 'NullableShape': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["shapes"]) -> MetaOapg.properties.shapes: ... + + @typing.overload + def __getitem__(self, name: str) -> 'Fruit': ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["mainShape"], typing_extensions.Literal["shapeOrNull"], typing_extensions.Literal["nullableShape"], typing_extensions.Literal["shapes"], str, ]): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["mainShape"]) -> typing.Union['Shape', schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["shapeOrNull"]) -> typing.Union['ShapeOrNull', schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["nullableShape"]) -> typing.Union['NullableShape', schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["shapes"]) -> typing.Union[MetaOapg.properties.shapes, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union['Fruit', schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["mainShape"], typing_extensions.Literal["shapeOrNull"], typing_extensions.Literal["nullableShape"], typing_extensions.Literal["shapes"], str, ]): + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + mainShape: typing.Union['Shape', schemas.Unset] = schemas.unset, + shapeOrNull: typing.Union['ShapeOrNull', schemas.Unset] = schemas.unset, + nullableShape: typing.Union['NullableShape', schemas.Unset] = schemas.unset, + shapes: typing.Union[MetaOapg.properties.shapes, list, tuple, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: 'Fruit', + ) -> 'Drawing': + return super().__new__( + cls, + *args, + mainShape=mainShape, + shapeOrNull=shapeOrNull, + nullableShape=nullableShape, + shapes=shapes, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.fruit import Fruit +from petstore_api.model.nullable_shape import NullableShape +from petstore_api.model.shape import Shape +from petstore_api.model.shape_or_null import ShapeOrNull diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/drawing.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/drawing.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.py b/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.py index 65b981ab7be3..1e7e0843da1a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,269 +9,142 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class EnumArrays(ModelNormal): +class EnumArrays( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - ('just_symbol',): { - '>=': ">=", - '$': "$", - }, - ('array_enum',): { - 'FISH': "fish", - 'CRAB': "crab", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'just_symbol': (str,), # noqa: E501 - 'array_enum': ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'just_symbol': 'just_symbol', # noqa: E501 - 'array_enum': 'array_enum', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EnumArrays - a model defined in OpenAPI - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - just_symbol (str): [optional] # noqa: E501 - array_enum ([str]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + class MetaOapg: + + class properties: + + + class just_symbol( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + ">=": "GREATER_THAN_EQUALS", + "$": "DOLLAR", + } + + @schemas.classproperty + def GREATER_THAN_EQUALS(cls): + return cls(">=") + + @schemas.classproperty + def DOLLAR(cls): + return cls("$") + + + class array_enum( + schemas.ListSchema + ): + + + class MetaOapg: + + + class items( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "fish": "FISH", + "crab": "CRAB", + } + + @schemas.classproperty + def FISH(cls): + return cls("fish") + + @schemas.classproperty + def CRAB(cls): + return cls("crab") + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'array_enum': + return super().__new__( + cls, + arg, + _configuration=_configuration, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EnumArrays - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - just_symbol (str): [optional] # noqa: E501 - array_enum ([str]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + __annotations__ = { + "just_symbol": just_symbol, + "array_enum": array_enum, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["just_symbol"]) -> MetaOapg.properties.just_symbol: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["array_enum"]) -> MetaOapg.properties.array_enum: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["just_symbol", "array_enum", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["just_symbol"]) -> typing.Union[MetaOapg.properties.just_symbol, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["array_enum"]) -> typing.Union[MetaOapg.properties.array_enum, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["just_symbol", "array_enum", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + just_symbol: typing.Union[MetaOapg.properties.just_symbol, str, schemas.Unset] = schemas.unset, + array_enum: typing.Union[MetaOapg.properties.array_enum, list, tuple, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'EnumArrays': + return super().__new__( + cls, + *args, + just_symbol=just_symbol, + array_enum=array_enum, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.py index bf9b682bd05d..27018e19a6d4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,277 +9,56 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class EnumClass(ModelSimple): +class EnumClass( + schemas.EnumBase, + schemas.StrSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - ('value',): { - '_ABC': "_abc", - '-EFG': "-efg", - '(XYZ)': "(xyz)", - }, - } - - validations = { - } - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), + class MetaOapg: + enum_value_to_name = { + "_abc": "_ABC", + "-efg": "EFG", + "(xyz)": "XYZ", + "COUNT_1M": "COUNT_1M", + "COUNT_50M": "COUNT_50M", } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """EnumClass - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 - - Keyword Args: - value (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "-efg" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """EnumClass - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 - - Keyword Args: - value (str): if omitted defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "-efg" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self + + @schemas.classproperty + def _ABC(cls): + return cls("_abc") + + @schemas.classproperty + def EFG(cls): + return cls("-efg") + + @schemas.classproperty + def XYZ(cls): + return cls("(xyz)") + + @schemas.classproperty + def COUNT_1M(cls): + return cls("COUNT_1M") + + @schemas.classproperty + def COUNT_50M(cls): + return cls("COUNT_50M") diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/enum_class.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.py index dd47ea4f74c2..094073cddc7f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,350 +9,268 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.array_of_enums import ArrayOfEnums - from petstore_api.model.boolean_enum import BooleanEnum - from petstore_api.model.integer_enum import IntegerEnum - from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue - from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue - from petstore_api.model.string_enum import StringEnum - from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue - globals()['ArrayOfEnums'] = ArrayOfEnums - globals()['BooleanEnum'] = BooleanEnum - globals()['IntegerEnum'] = IntegerEnum - globals()['IntegerEnumOneValue'] = IntegerEnumOneValue - globals()['IntegerEnumWithDefaultValue'] = IntegerEnumWithDefaultValue - globals()['StringEnum'] = StringEnum - globals()['StringEnumWithDefaultValue'] = StringEnumWithDefaultValue - -class EnumTest(ModelNormal): +class EnumTest( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - ('enum_string_required',): { - 'UPPER': "UPPER", - 'LOWER': "lower", - 'EMPTY': "", - }, - ('enum_string',): { - 'UPPER': "UPPER", - 'LOWER': "lower", - 'EMPTY': "", - }, - ('enum_integer',): { - '1': 1, - '-1': -1, - }, - ('enum_number',): { - '1.1': 1.1, - '-1.2': -1.2, - }, - ('enum_bool',): { - 'FALSE': False, - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'enum_string_required': (str,), # noqa: E501 - 'enum_string': (str,), # noqa: E501 - 'enum_integer': (int,), # noqa: E501 - 'enum_number': (float,), # noqa: E501 - 'enum_bool': (bool,), # noqa: E501 - 'bool_enum': (BooleanEnum,), # noqa: E501 - 'string_enum': (StringEnum,), # noqa: E501 - 'integer_enum': (IntegerEnum,), # noqa: E501 - 'string_enum_with_default_value': (StringEnumWithDefaultValue,), # noqa: E501 - 'integer_enum_with_default_value': (IntegerEnumWithDefaultValue,), # noqa: E501 - 'integer_enum_one_value': (IntegerEnumOneValue,), # noqa: E501 - 'inline_array_of_str_enum': ([StringEnum],), # noqa: E501 - 'array_of_str_enum': (ArrayOfEnums,), # noqa: E501 + class MetaOapg: + required = { + "enum_string_required", } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'enum_string_required': 'enum_string_required', # noqa: E501 - 'enum_string': 'enum_string', # noqa: E501 - 'enum_integer': 'enum_integer', # noqa: E501 - 'enum_number': 'enum_number', # noqa: E501 - 'enum_bool': 'enum_bool', # noqa: E501 - 'bool_enum': 'boolEnum', # noqa: E501 - 'string_enum': 'stringEnum', # noqa: E501 - 'integer_enum': 'IntegerEnum', # noqa: E501 - 'string_enum_with_default_value': 'StringEnumWithDefaultValue', # noqa: E501 - 'integer_enum_with_default_value': 'IntegerEnumWithDefaultValue', # noqa: E501 - 'integer_enum_one_value': 'IntegerEnumOneValue', # noqa: E501 - 'inline_array_of_str_enum': 'InlineArrayOfStrEnum', # noqa: E501 - 'array_of_str_enum': 'ArrayOfStrEnum', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, enum_string_required, *args, **kwargs): # noqa: E501 - """EnumTest - a model defined in OpenAPI - - Args: - enum_string_required (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - enum_string (str): [optional] # noqa: E501 - enum_integer (int): [optional] # noqa: E501 - enum_number (float): [optional] # noqa: E501 - enum_bool (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - bool_enum (BooleanEnum): [optional] # noqa: E501 - string_enum (StringEnum): [optional] # noqa: E501 - integer_enum (IntegerEnum): [optional] # noqa: E501 - string_enum_with_default_value (StringEnumWithDefaultValue): [optional] # noqa: E501 - integer_enum_with_default_value (IntegerEnumWithDefaultValue): [optional] # noqa: E501 - integer_enum_one_value (IntegerEnumOneValue): [optional] # noqa: E501 - inline_array_of_str_enum ([StringEnum]): [optional] # noqa: E501 - array_of_str_enum (ArrayOfEnums): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.enum_string_required = enum_string_required - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, enum_string_required, *args, **kwargs): # noqa: E501 - """EnumTest - a model defined in OpenAPI - - Args: - enum_string_required (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - enum_string (str): [optional] # noqa: E501 - enum_integer (int): [optional] # noqa: E501 - enum_number (float): [optional] # noqa: E501 - enum_bool (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - bool_enum (BooleanEnum): [optional] # noqa: E501 - string_enum (StringEnum): [optional] # noqa: E501 - integer_enum (IntegerEnum): [optional] # noqa: E501 - string_enum_with_default_value (StringEnumWithDefaultValue): [optional] # noqa: E501 - integer_enum_with_default_value (IntegerEnumWithDefaultValue): [optional] # noqa: E501 - integer_enum_one_value (IntegerEnumOneValue): [optional] # noqa: E501 - inline_array_of_str_enum ([StringEnum]): [optional] # noqa: E501 - array_of_str_enum (ArrayOfEnums): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.enum_string_required = enum_string_required - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + class properties: + + + class enum_string_required( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "UPPER": "UPPER", + "lower": "LOWER", + "": "EMPTY", + } + + @schemas.classproperty + def UPPER(cls): + return cls("UPPER") + + @schemas.classproperty + def LOWER(cls): + return cls("lower") + + @schemas.classproperty + def EMPTY(cls): + return cls("") + + + class enum_string( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "UPPER": "UPPER", + "lower": "LOWER", + "": "EMPTY", + } + + @schemas.classproperty + def UPPER(cls): + return cls("UPPER") + + @schemas.classproperty + def LOWER(cls): + return cls("lower") + + @schemas.classproperty + def EMPTY(cls): + return cls("") + + + class enum_integer( + schemas.EnumBase, + schemas.Int32Schema + ): + + + class MetaOapg: + format = 'int32' + enum_value_to_name = { + 1: "POSITIVE_1", + -1: "NEGATIVE_1", + } + + @schemas.classproperty + def POSITIVE_1(cls): + return cls(1) + + @schemas.classproperty + def NEGATIVE_1(cls): + return cls(-1) + + + class enum_number( + schemas.EnumBase, + schemas.Float64Schema + ): + + + class MetaOapg: + format = 'double' + enum_value_to_name = { + 1.1: "POSITIVE_1_PT_1", + -1.2: "NEGATIVE_1_PT_2", + } + + @schemas.classproperty + def POSITIVE_1_PT_1(cls): + return cls(1.1) + + @schemas.classproperty + def NEGATIVE_1_PT_2(cls): + return cls(-1.2) + + @staticmethod + def stringEnum() -> typing.Type['StringEnum']: + return StringEnum + + @staticmethod + def IntegerEnum() -> typing.Type['IntegerEnum']: + return IntegerEnum + + @staticmethod + def StringEnumWithDefaultValue() -> typing.Type['StringEnumWithDefaultValue']: + return StringEnumWithDefaultValue + + @staticmethod + def IntegerEnumWithDefaultValue() -> typing.Type['IntegerEnumWithDefaultValue']: + return IntegerEnumWithDefaultValue + + @staticmethod + def IntegerEnumOneValue() -> typing.Type['IntegerEnumOneValue']: + return IntegerEnumOneValue + __annotations__ = { + "enum_string_required": enum_string_required, + "enum_string": enum_string, + "enum_integer": enum_integer, + "enum_number": enum_number, + "stringEnum": stringEnum, + "IntegerEnum": IntegerEnum, + "StringEnumWithDefaultValue": StringEnumWithDefaultValue, + "IntegerEnumWithDefaultValue": IntegerEnumWithDefaultValue, + "IntegerEnumOneValue": IntegerEnumOneValue, + } + + enum_string_required: MetaOapg.properties.enum_string_required + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["enum_string_required"]) -> MetaOapg.properties.enum_string_required: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["enum_string"]) -> MetaOapg.properties.enum_string: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["enum_integer"]) -> MetaOapg.properties.enum_integer: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["enum_number"]) -> MetaOapg.properties.enum_number: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["stringEnum"]) -> 'StringEnum': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["IntegerEnum"]) -> 'IntegerEnum': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["StringEnumWithDefaultValue"]) -> 'StringEnumWithDefaultValue': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["IntegerEnumWithDefaultValue"]) -> 'IntegerEnumWithDefaultValue': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["IntegerEnumOneValue"]) -> 'IntegerEnumOneValue': ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["enum_string_required", "enum_string", "enum_integer", "enum_number", "stringEnum", "IntegerEnum", "StringEnumWithDefaultValue", "IntegerEnumWithDefaultValue", "IntegerEnumOneValue", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["enum_string_required"]) -> MetaOapg.properties.enum_string_required: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["enum_string"]) -> typing.Union[MetaOapg.properties.enum_string, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["enum_integer"]) -> typing.Union[MetaOapg.properties.enum_integer, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["enum_number"]) -> typing.Union[MetaOapg.properties.enum_number, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["stringEnum"]) -> typing.Union['StringEnum', schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["IntegerEnum"]) -> typing.Union['IntegerEnum', schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["StringEnumWithDefaultValue"]) -> typing.Union['StringEnumWithDefaultValue', schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["IntegerEnumWithDefaultValue"]) -> typing.Union['IntegerEnumWithDefaultValue', schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["IntegerEnumOneValue"]) -> typing.Union['IntegerEnumOneValue', schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["enum_string_required", "enum_string", "enum_integer", "enum_number", "stringEnum", "IntegerEnum", "StringEnumWithDefaultValue", "IntegerEnumWithDefaultValue", "IntegerEnumOneValue", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + enum_string_required: typing.Union[MetaOapg.properties.enum_string_required, str, ], + enum_string: typing.Union[MetaOapg.properties.enum_string, str, schemas.Unset] = schemas.unset, + enum_integer: typing.Union[MetaOapg.properties.enum_integer, decimal.Decimal, int, schemas.Unset] = schemas.unset, + enum_number: typing.Union[MetaOapg.properties.enum_number, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, + stringEnum: typing.Union['StringEnum', schemas.Unset] = schemas.unset, + IntegerEnum: typing.Union['IntegerEnum', schemas.Unset] = schemas.unset, + StringEnumWithDefaultValue: typing.Union['StringEnumWithDefaultValue', schemas.Unset] = schemas.unset, + IntegerEnumWithDefaultValue: typing.Union['IntegerEnumWithDefaultValue', schemas.Unset] = schemas.unset, + IntegerEnumOneValue: typing.Union['IntegerEnumOneValue', schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'EnumTest': + return super().__new__( + cls, + *args, + enum_string_required=enum_string_required, + enum_string=enum_string, + enum_integer=enum_integer, + enum_number=enum_number, + stringEnum=stringEnum, + IntegerEnum=IntegerEnum, + StringEnumWithDefaultValue=StringEnumWithDefaultValue, + IntegerEnumWithDefaultValue=IntegerEnumWithDefaultValue, + IntegerEnumOneValue=IntegerEnumOneValue, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.integer_enum import IntegerEnum +from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue +from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue +from petstore_api.model.string_enum import StringEnum +from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/enum_test.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.py index 47e8e9a64f18..a45ac99de806 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,320 +9,124 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.shape_interface import ShapeInterface - from petstore_api.model.triangle_interface import TriangleInterface - globals()['ShapeInterface'] = ShapeInterface - globals()['TriangleInterface'] = TriangleInterface - -class EquilateralTriangle(ModelComposed): +class EquilateralTriangle( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'shape_type': (str,), # noqa: E501 - 'triangle_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'shape_type': 'shapeType', # noqa: E501 - 'triangle_type': 'triangleType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EquilateralTriangle - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - triangle_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EquilateralTriangle - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - triangle_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ShapeInterface, - TriangleInterface, - ], - 'oneOf': [ - ], - } + class MetaOapg: + + + class all_of_1( + schemas.DictSchema + ): + + + class MetaOapg: + + class properties: + + + class triangleType( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "EquilateralTriangle": "EQUILATERAL_TRIANGLE", + } + + @schemas.classproperty + def EQUILATERAL_TRIANGLE(cls): + return cls("EquilateralTriangle") + __annotations__ = { + "triangleType": triangleType, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["triangleType"]) -> typing.Union[MetaOapg.properties.triangleType, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + triangleType: typing.Union[MetaOapg.properties.triangleType, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + triangleType=triangleType, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @functools.lru_cache() + def all_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + TriangleInterface, + cls.all_of_1, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'EquilateralTriangle': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/file.py b/samples/openapi3/client/petstore/python/petstore_api/model/file.py index 6d8d65f45752..886f7a62d343 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/file.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/file.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,257 +9,72 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class File(ModelNormal): +class File( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. + Must be named `File` for test. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'source_uri': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'source_uri': 'sourceURI', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """File - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - source_uri (str): Test capitalization. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """File - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - source_uri (str): Test capitalization. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + + class properties: + sourceURI = schemas.StrSchema + __annotations__ = { + "sourceURI": sourceURI, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["sourceURI"]) -> MetaOapg.properties.sourceURI: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["sourceURI", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["sourceURI"]) -> typing.Union[MetaOapg.properties.sourceURI, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["sourceURI", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + sourceURI: typing.Union[MetaOapg.properties.sourceURI, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'File': + return super().__new__( + cls, + *args, + sourceURI=sourceURI, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/file.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/file.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.py index d8db617ffa80..e9320d9a0e7a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,267 +9,110 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.file import File - globals()['File'] = File - -class FileSchemaTestClass(ModelNormal): +class FileSchemaTestClass( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'file': (File,), # noqa: E501 - 'files': ([File],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'file': 'file', # noqa: E501 - 'files': 'files', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """FileSchemaTestClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - file (File): [optional] # noqa: E501 - files ([File]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """FileSchemaTestClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - file (File): [optional] # noqa: E501 - files ([File]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + class MetaOapg: + + class properties: + + @staticmethod + def file() -> typing.Type['File']: + return File + + + class files( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['File']: + return File + + def __new__( + cls, + arg: typing.Union[typing.Tuple['File'], typing.List['File']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'files': + return super().__new__( + cls, + arg, + _configuration=_configuration, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + def __getitem__(self, i: int) -> 'File': + return super().__getitem__(i) + __annotations__ = { + "file": file, + "files": files, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["file"]) -> 'File': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["files"]) -> MetaOapg.properties.files: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["file", "files", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["file"]) -> typing.Union['File', schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["files"]) -> typing.Union[MetaOapg.properties.files, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["file", "files", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + file: typing.Union['File', schemas.Unset] = schemas.unset, + files: typing.Union[MetaOapg.properties.files, list, tuple, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'FileSchemaTestClass': + return super().__new__( + cls, + *args, + file=file, + files=files, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.file import File diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/foo.py b/samples/openapi3/client/petstore/python/petstore_api/model/foo.py index fd07a6d8ade3..ce7d00afa0a3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/foo.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/foo.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,257 +9,70 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class Foo(ModelNormal): +class Foo( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'bar': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'bar': 'bar', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Foo - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] if omitted the server will use the default value of "bar" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Foo - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] if omitted the server will use the default value of "bar" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + + class properties: + bar = schemas.StrSchema + __annotations__ = { + "bar": bar, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Foo': + return super().__new__( + cls, + *args, + bar=bar, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/foo.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/foo.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/format_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/format_test.py index 5b425f42332d..b16b10a0488f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/format_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/format_test.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,372 +9,398 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class FormatTest(ModelNormal): +class FormatTest( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - ('number',): { - 'inclusive_maximum': 543.2, - 'inclusive_minimum': 32.1, - 'multiple_of': 32.5, - }, - ('password',): { - 'max_length': 64, - 'min_length': 10, - }, - ('integer',): { - 'inclusive_maximum': 100, - 'inclusive_minimum': 10, - 'multiple_of': 2, - }, - ('int32',): { - 'inclusive_maximum': 200, - 'inclusive_minimum': 20, - }, - ('float',): { - 'inclusive_maximum': 987.6, - 'inclusive_minimum': 54.3, - }, - ('double',): { - 'inclusive_maximum': 123.4, - 'inclusive_minimum': 67.8, - }, - ('string',): { - 'regex': { - 'pattern': r'[a-z]', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - ('pattern_with_digits',): { - 'regex': { - 'pattern': r'^\d{10}$', # noqa: E501 - }, - }, - ('pattern_with_digits_and_delimiter',): { - 'regex': { - 'pattern': r'^image_\d{1,3}$', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - } - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'number': (float,), # noqa: E501 - 'byte': (str,), # noqa: E501 - 'date': (date,), # noqa: E501 - 'password': (str,), # noqa: E501 - 'integer': (int,), # noqa: E501 - 'int32': (int,), # noqa: E501 - 'int64': (int,), # noqa: E501 - 'float': (float,), # noqa: E501 - 'double': (float,), # noqa: E501 - 'string': (str,), # noqa: E501 - 'binary': (file_type,), # noqa: E501 - 'date_time': (datetime,), # noqa: E501 - 'uuid': (str,), # noqa: E501 - 'uuid_no_example': (str,), # noqa: E501 - 'pattern_with_digits': (str,), # noqa: E501 - 'pattern_with_digits_and_delimiter': (str,), # noqa: E501 + class MetaOapg: + required = { + "date", + "number", + "password", + "byte", } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'number': 'number', # noqa: E501 - 'byte': 'byte', # noqa: E501 - 'date': 'date', # noqa: E501 - 'password': 'password', # noqa: E501 - 'integer': 'integer', # noqa: E501 - 'int32': 'int32', # noqa: E501 - 'int64': 'int64', # noqa: E501 - 'float': 'float', # noqa: E501 - 'double': 'double', # noqa: E501 - 'string': 'string', # noqa: E501 - 'binary': 'binary', # noqa: E501 - 'date_time': 'dateTime', # noqa: E501 - 'uuid': 'uuid', # noqa: E501 - 'uuid_no_example': 'uuidNoExample', # noqa: E501 - 'pattern_with_digits': 'pattern_with_digits', # noqa: E501 - 'pattern_with_digits_and_delimiter': 'pattern_with_digits_and_delimiter', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, number, byte, date, password, *args, **kwargs): # noqa: E501 - """FormatTest - a model defined in OpenAPI - - Args: - number (float): - byte (str): - date (date): - password (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - integer (int): [optional] # noqa: E501 - int32 (int): [optional] # noqa: E501 - int64 (int): [optional] # noqa: E501 - float (float): [optional] # noqa: E501 - double (float): [optional] # noqa: E501 - string (str): [optional] # noqa: E501 - binary (file_type): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - uuid (str): [optional] # noqa: E501 - uuid_no_example (str): [optional] # noqa: E501 - pattern_with_digits (str): A string that is a 10 digit number. Can have leading zeros.. [optional] # noqa: E501 - pattern_with_digits_and_delimiter (str): A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.number = number - self.byte = byte - self.date = date - self.password = password - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, number, byte, date, password, *args, **kwargs): # noqa: E501 - """FormatTest - a model defined in OpenAPI - - Args: - number (float): - byte (str): - date (date): - password (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - integer (int): [optional] # noqa: E501 - int32 (int): [optional] # noqa: E501 - int64 (int): [optional] # noqa: E501 - float (float): [optional] # noqa: E501 - double (float): [optional] # noqa: E501 - string (str): [optional] # noqa: E501 - binary (file_type): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - uuid (str): [optional] # noqa: E501 - uuid_no_example (str): [optional] # noqa: E501 - pattern_with_digits (str): A string that is a 10 digit number. Can have leading zeros.. [optional] # noqa: E501 - pattern_with_digits_and_delimiter (str): A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + + class properties: + + + class number( + schemas.NumberSchema + ): + + + class MetaOapg: + inclusive_maximum = 543.2 + inclusive_minimum = 32.1 + multiple_of = 32.5 + byte = schemas.StrSchema + date = schemas.DateSchema + + + class password( + schemas.StrSchema + ): + + + class MetaOapg: + format = 'password' + max_length = 64 + min_length = 10 + + + class integer( + schemas.IntSchema + ): + + + class MetaOapg: + inclusive_maximum = 100 + inclusive_minimum = 10 + multiple_of = 2 + int32 = schemas.Int32Schema + + + class int32withValidations( + schemas.Int32Schema + ): + + + class MetaOapg: + format = 'int32' + inclusive_maximum = 200 + inclusive_minimum = 20 + int64 = schemas.Int64Schema + + + class _float( + schemas.Float32Schema + ): + + + class MetaOapg: + format = 'float' + inclusive_maximum = 987.6 + inclusive_minimum = 54.3 + float32 = schemas.Float32Schema + + + class double( + schemas.Float64Schema + ): + + + class MetaOapg: + format = 'double' + inclusive_maximum = 123.4 + inclusive_minimum = 67.8 + float64 = schemas.Float64Schema + + + class arrayWithUniqueItems( + schemas.ListSchema + ): + + + class MetaOapg: + unique_items = True + items = schemas.NumberSchema + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'arrayWithUniqueItems': + return super().__new__( + cls, + arg, + _configuration=_configuration, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.number = number - self.byte = byte - self.date = date - self.password = password - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + + class string( + schemas.StrSchema + ): + + + class MetaOapg: + regex=[{ + 'pattern': r'[a-z]', # noqa: E501 + 'flags': ( + re.IGNORECASE + ) + }] + binary = schemas.BinarySchema + dateTime = schemas.DateTimeSchema + uuid = schemas.UUIDSchema + uuidNoExample = schemas.UUIDSchema + + + class pattern_with_digits( + schemas.StrSchema + ): + + + class MetaOapg: + regex=[{ + 'pattern': r'^\d{10}$', # noqa: E501 + }] + + + class pattern_with_digits_and_delimiter( + schemas.StrSchema + ): + + + class MetaOapg: + regex=[{ + 'pattern': r'^image_\d{1,3}$', # noqa: E501 + 'flags': ( + re.IGNORECASE + ) + }] + noneProp = schemas.NoneSchema + __annotations__ = { + "number": number, + "byte": byte, + "date": date, + "password": password, + "integer": integer, + "int32": int32, + "int32withValidations": int32withValidations, + "int64": int64, + "float": _float, + "float32": float32, + "double": double, + "float64": float64, + "arrayWithUniqueItems": arrayWithUniqueItems, + "string": string, + "binary": binary, + "dateTime": dateTime, + "uuid": uuid, + "uuidNoExample": uuidNoExample, + "pattern_with_digits": pattern_with_digits, + "pattern_with_digits_and_delimiter": pattern_with_digits_and_delimiter, + "noneProp": noneProp, + } + + date: MetaOapg.properties.date + number: MetaOapg.properties.number + password: MetaOapg.properties.password + byte: MetaOapg.properties.byte + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["byte"]) -> MetaOapg.properties.byte: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["date"]) -> MetaOapg.properties.date: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["password"]) -> MetaOapg.properties.password: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["integer"]) -> MetaOapg.properties.integer: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["int32"]) -> MetaOapg.properties.int32: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["int32withValidations"]) -> MetaOapg.properties.int32withValidations: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["int64"]) -> MetaOapg.properties.int64: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["float"]) -> MetaOapg.properties._float: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["float32"]) -> MetaOapg.properties.float32: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["double"]) -> MetaOapg.properties.double: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["float64"]) -> MetaOapg.properties.float64: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["arrayWithUniqueItems"]) -> MetaOapg.properties.arrayWithUniqueItems: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["string"]) -> MetaOapg.properties.string: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["binary"]) -> MetaOapg.properties.binary: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["uuid"]) -> MetaOapg.properties.uuid: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["uuidNoExample"]) -> MetaOapg.properties.uuidNoExample: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["pattern_with_digits"]) -> MetaOapg.properties.pattern_with_digits: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["pattern_with_digits_and_delimiter"]) -> MetaOapg.properties.pattern_with_digits_and_delimiter: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["noneProp"]) -> MetaOapg.properties.noneProp: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["number", "byte", "date", "password", "integer", "int32", "int32withValidations", "int64", "float", "float32", "double", "float64", "arrayWithUniqueItems", "string", "binary", "dateTime", "uuid", "uuidNoExample", "pattern_with_digits", "pattern_with_digits_and_delimiter", "noneProp", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["byte"]) -> MetaOapg.properties.byte: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["date"]) -> MetaOapg.properties.date: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["password"]) -> MetaOapg.properties.password: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["integer"]) -> typing.Union[MetaOapg.properties.integer, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["int32"]) -> typing.Union[MetaOapg.properties.int32, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["int32withValidations"]) -> typing.Union[MetaOapg.properties.int32withValidations, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["int64"]) -> typing.Union[MetaOapg.properties.int64, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["float"]) -> typing.Union[MetaOapg.properties._float, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["float32"]) -> typing.Union[MetaOapg.properties.float32, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["double"]) -> typing.Union[MetaOapg.properties.double, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["float64"]) -> typing.Union[MetaOapg.properties.float64, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["arrayWithUniqueItems"]) -> typing.Union[MetaOapg.properties.arrayWithUniqueItems, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["string"]) -> typing.Union[MetaOapg.properties.string, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["binary"]) -> typing.Union[MetaOapg.properties.binary, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["dateTime"]) -> typing.Union[MetaOapg.properties.dateTime, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["uuid"]) -> typing.Union[MetaOapg.properties.uuid, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["uuidNoExample"]) -> typing.Union[MetaOapg.properties.uuidNoExample, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["pattern_with_digits"]) -> typing.Union[MetaOapg.properties.pattern_with_digits, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["pattern_with_digits_and_delimiter"]) -> typing.Union[MetaOapg.properties.pattern_with_digits_and_delimiter, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["noneProp"]) -> typing.Union[MetaOapg.properties.noneProp, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["number", "byte", "date", "password", "integer", "int32", "int32withValidations", "int64", "float", "float32", "double", "float64", "arrayWithUniqueItems", "string", "binary", "dateTime", "uuid", "uuidNoExample", "pattern_with_digits", "pattern_with_digits_and_delimiter", "noneProp", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + date: typing.Union[MetaOapg.properties.date, str, date, ], + number: typing.Union[MetaOapg.properties.number, decimal.Decimal, int, float, ], + password: typing.Union[MetaOapg.properties.password, str, ], + byte: typing.Union[MetaOapg.properties.byte, str, ], + integer: typing.Union[MetaOapg.properties.integer, decimal.Decimal, int, schemas.Unset] = schemas.unset, + int32: typing.Union[MetaOapg.properties.int32, decimal.Decimal, int, schemas.Unset] = schemas.unset, + int32withValidations: typing.Union[MetaOapg.properties.int32withValidations, decimal.Decimal, int, schemas.Unset] = schemas.unset, + int64: typing.Union[MetaOapg.properties.int64, decimal.Decimal, int, schemas.Unset] = schemas.unset, + float32: typing.Union[MetaOapg.properties.float32, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, + double: typing.Union[MetaOapg.properties.double, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, + float64: typing.Union[MetaOapg.properties.float64, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, + arrayWithUniqueItems: typing.Union[MetaOapg.properties.arrayWithUniqueItems, list, tuple, schemas.Unset] = schemas.unset, + string: typing.Union[MetaOapg.properties.string, str, schemas.Unset] = schemas.unset, + binary: typing.Union[MetaOapg.properties.binary, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + dateTime: typing.Union[MetaOapg.properties.dateTime, str, datetime, schemas.Unset] = schemas.unset, + uuid: typing.Union[MetaOapg.properties.uuid, str, uuid.UUID, schemas.Unset] = schemas.unset, + uuidNoExample: typing.Union[MetaOapg.properties.uuidNoExample, str, uuid.UUID, schemas.Unset] = schemas.unset, + pattern_with_digits: typing.Union[MetaOapg.properties.pattern_with_digits, str, schemas.Unset] = schemas.unset, + pattern_with_digits_and_delimiter: typing.Union[MetaOapg.properties.pattern_with_digits_and_delimiter, str, schemas.Unset] = schemas.unset, + noneProp: typing.Union[MetaOapg.properties.noneProp, None, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'FormatTest': + return super().__new__( + cls, + *args, + date=date, + number=number, + password=password, + byte=byte, + integer=integer, + int32=int32, + int32withValidations=int32withValidations, + int64=int64, + float32=float32, + double=double, + float64=float64, + arrayWithUniqueItems=arrayWithUniqueItems, + string=string, + binary=binary, + dateTime=dateTime, + uuid=uuid, + uuidNoExample=uuidNoExample, + pattern_with_digits=pattern_with_digits, + pattern_with_digits_and_delimiter=pattern_with_digits_and_delimiter, + noneProp=noneProp, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/format_test.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/format_test.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/fruit.py b/samples/openapi3/client/petstore/python/petstore_api/model/fruit.py index 79952ac853aa..056b33f22f5b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/fruit.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/fruit.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,339 +9,89 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.apple import Apple - from petstore_api.model.banana import Banana - globals()['Apple'] = Apple - globals()['Banana'] = Banana - -class Fruit(ModelComposed): +class Fruit( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - ('cultivar',): { - 'regex': { - 'pattern': r'^[a-zA-Z\s]*$', # noqa: E501 - }, - }, - ('origin',): { - 'regex': { - 'pattern': r'^[A-Z\s]*$', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'cultivar': (str,), # noqa: E501 - 'length_cm': (float,), # noqa: E501 - 'color': (str,), # noqa: E501 - 'origin': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'cultivar': 'cultivar', # noqa: E501 - 'length_cm': 'lengthCm', # noqa: E501 - 'color': 'color', # noqa: E501 - 'origin': 'origin', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Fruit - a model defined in OpenAPI - - Keyword Args: - cultivar (str): - length_cm (float): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] # noqa: E501 - origin (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Fruit - a model defined in OpenAPI - - Keyword Args: - cultivar (str): - length_cm (float): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] # noqa: E501 - origin (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - Apple, - Banana, - ], - } + class MetaOapg: + + class properties: + color = schemas.StrSchema + __annotations__ = { + "color": color, + } + + @classmethod + @functools.lru_cache() + def one_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + Apple, + Banana, + ] + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["color"]) -> MetaOapg.properties.color: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["color", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["color"]) -> typing.Union[MetaOapg.properties.color, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["color", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + color: typing.Union[MetaOapg.properties.color, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Fruit': + return super().__new__( + cls, + *args, + color=color, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.apple import Apple +from petstore_api.model.banana import Banana diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/fruit.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/fruit.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.py b/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.py index 62fdc158f582..18879cd45c21 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,329 +9,62 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.apple_req import AppleReq - from petstore_api.model.banana_req import BananaReq - globals()['AppleReq'] = AppleReq - globals()['BananaReq'] = BananaReq - -class FruitReq(ModelComposed): +class FruitReq( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'mealy': (bool,), # noqa: E501 - 'sweet': (bool,), # noqa: E501 - 'cultivar': (str,), # noqa: E501 - 'length_cm': (float,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'mealy': 'mealy', # noqa: E501 - 'sweet': 'sweet', # noqa: E501 - 'cultivar': 'cultivar', # noqa: E501 - 'length_cm': 'lengthCm', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """FruitReq - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - mealy (bool): [optional] # noqa: E501 - sweet (bool): [optional] # noqa: E501 - cultivar (str): [optional] # noqa: E501 - length_cm (float): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """FruitReq - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - mealy (bool): [optional] # noqa: E501 - sweet (bool): [optional] # noqa: E501 - cultivar (str): [optional] # noqa: E501 - length_cm (float): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - AppleReq, - BananaReq, - none_type, - ], - } + class MetaOapg: + one_of_0 = schemas.NoneSchema + + @classmethod + @functools.lru_cache() + def one_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + cls.one_of_0, + AppleReq, + BananaReq, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'FruitReq': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.apple_req import AppleReq +from petstore_api.model.banana_req import BananaReq diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.py b/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.py index 93f102967ff3..5646a4704e20 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,339 +9,89 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.apple import Apple - from petstore_api.model.banana import Banana - globals()['Apple'] = Apple - globals()['Banana'] = Banana - -class GmFruit(ModelComposed): +class GmFruit( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - ('cultivar',): { - 'regex': { - 'pattern': r'^[a-zA-Z\s]*$', # noqa: E501 - }, - }, - ('origin',): { - 'regex': { - 'pattern': r'^[A-Z\s]*$', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'cultivar': (str,), # noqa: E501 - 'length_cm': (float,), # noqa: E501 - 'color': (str,), # noqa: E501 - 'origin': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'cultivar': 'cultivar', # noqa: E501 - 'length_cm': 'lengthCm', # noqa: E501 - 'color': 'color', # noqa: E501 - 'origin': 'origin', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """GmFruit - a model defined in OpenAPI - - Keyword Args: - cultivar (str): - length_cm (float): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] # noqa: E501 - origin (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """GmFruit - a model defined in OpenAPI - - Keyword Args: - cultivar (str): - length_cm (float): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - color (str): [optional] # noqa: E501 - origin (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - Apple, - Banana, - ], - 'allOf': [ - ], - 'oneOf': [ - ], - } + class MetaOapg: + + class properties: + color = schemas.StrSchema + __annotations__ = { + "color": color, + } + + @classmethod + @functools.lru_cache() + def any_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + Apple, + Banana, + ] + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["color"]) -> MetaOapg.properties.color: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["color", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["color"]) -> typing.Union[MetaOapg.properties.color, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["color", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + color: typing.Union[MetaOapg.properties.color, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'GmFruit': + return super().__new__( + cls, + *args, + color=color, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.apple import Apple +from petstore_api.model.banana import Banana diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.py b/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.py index f6d1b0bb2043..838d96a814f4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,277 +9,87 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.child_cat import ChildCat - from petstore_api.model.parent_pet import ParentPet - globals()['ChildCat'] = ChildCat - globals()['ParentPet'] = ParentPet - -class GrandparentAnimal(ModelNormal): +class GrandparentAnimal( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'pet_type': (str,), # noqa: E501 + class MetaOapg: + required = { + "pet_type", } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'ChildCat': ChildCat, - 'ParentPet': ParentPet, - } - if not val: - return None - return {'pet_type': val} - - attribute_map = { - 'pet_type': 'pet_type', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, pet_type, *args, **kwargs): # noqa: E501 - """GrandparentAnimal - a model defined in OpenAPI - - Args: - pet_type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.pet_type = pet_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """GrandparentAnimal - a model defined in OpenAPI - - Args: - pet_type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.pet_type = pet_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + @staticmethod + def discriminator(): + return { + 'pet_type': { + 'ChildCat': ChildCat, + 'ParentPet': ParentPet, + } + } + + class properties: + pet_type = schemas.StrSchema + __annotations__ = { + "pet_type": pet_type, + } + + pet_type: MetaOapg.properties.pet_type + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["pet_type"]) -> MetaOapg.properties.pet_type: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["pet_type", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["pet_type"]) -> MetaOapg.properties.pet_type: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["pet_type", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + pet_type: typing.Union[MetaOapg.properties.pet_type, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'GrandparentAnimal': + return super().__new__( + cls, + *args, + pet_type=pet_type, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.child_cat import ChildCat +from petstore_api.model.parent_pet import ParentPet diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.py index 1ccc67be07a1..f56f17aad800 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,263 +9,80 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class HasOnlyReadOnly(ModelNormal): +class HasOnlyReadOnly( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'bar': (str,), # noqa: E501 - 'foo': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'bar': 'bar', # noqa: E501 - 'foo': 'foo', # noqa: E501 - } - - read_only_vars = { - 'bar', # noqa: E501 - 'foo', # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """HasOnlyReadOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] # noqa: E501 - foo (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """HasOnlyReadOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] # noqa: E501 - foo (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + + class properties: + bar = schemas.StrSchema + foo = schemas.StrSchema + __annotations__ = { + "bar": bar, + "foo": foo, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", "foo", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", "foo", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, + foo: typing.Union[MetaOapg.properties.foo, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'HasOnlyReadOnly': + return super().__new__( + cls, + *args, + bar=bar, + foo=foo, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.py b/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.py index e0f31297fe00..840a5ad96f14 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,257 +9,91 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class HealthCheckResult(ModelNormal): +class HealthCheckResult( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. + Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'nullable_message': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'nullable_message': 'NullableMessage', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """HealthCheckResult - a model defined in OpenAPI - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - nullable_message (str, none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + class MetaOapg: + + class properties: + + + class NullableMessage( + schemas.StrBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneStrMixin + ): + + + def __new__( + cls, + *args: typing.Union[None, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'NullableMessage': + return super().__new__( + cls, + *args, + _configuration=_configuration, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """HealthCheckResult - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - nullable_message (str, none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + __annotations__ = { + "NullableMessage": NullableMessage, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["NullableMessage"]) -> MetaOapg.properties.NullableMessage: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["NullableMessage", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["NullableMessage"]) -> typing.Union[MetaOapg.properties.NullableMessage, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["NullableMessage", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + NullableMessage: typing.Union[MetaOapg.properties.NullableMessage, None, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'HealthCheckResult': + return super().__new__( + cls, + *args, + NullableMessage=NullableMessage, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.py index de46d21f64f6..18cd8df6434d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,285 +9,46 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class IntegerEnum(ModelSimple): +class IntegerEnum( + schemas.EnumBase, + schemas.IntSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - ('value',): { - '0': 0, - '1': 1, - '2': 2, - }, - } - - validations = { - } - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (int,), + class MetaOapg: + enum_value_to_name = { + 0: "POSITIVE_0", + 1: "POSITIVE_1", + 2: "POSITIVE_2", } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """IntegerEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (int):, must be one of [0, 1, 2, ] # noqa: E501 - - Keyword Args: - value (int):, must be one of [0, 1, 2, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """IntegerEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (int):, must be one of [0, 1, 2, ] # noqa: E501 - - Keyword Args: - value (int):, must be one of [0, 1, 2, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self + + @schemas.classproperty + def POSITIVE_0(cls): + return cls(0) + + @schemas.classproperty + def POSITIVE_1(cls): + return cls(1) + + @schemas.classproperty + def POSITIVE_2(cls): + return cls(2) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_big.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py rename to samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_big.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_big.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_big.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.py index 9091039a21a8..6ab7f2f21302 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,275 +9,36 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class IntegerEnumOneValue(ModelSimple): +class IntegerEnumOneValue( + schemas.EnumBase, + schemas.IntSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - ('value',): { - '0': 0, - }, - } - - validations = { - } - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (int,), + class MetaOapg: + enum_value_to_name = { + 0: "POSITIVE_0", } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """IntegerEnumOneValue - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (int): if omitted defaults to 0, must be one of [0, ] # noqa: E501 - - Keyword Args: - value (int): if omitted defaults to 0, must be one of [0, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = 0 - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """IntegerEnumOneValue - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (int): if omitted defaults to 0, must be one of [0, ] # noqa: E501 - - Keyword Args: - value (int): if omitted defaults to 0, must be one of [0, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = 0 - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self + + @schemas.classproperty + def POSITIVE_0(cls): + return cls(0) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.py index f3473cffa273..87b44b36f166 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,277 +9,46 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class IntegerEnumWithDefaultValue(ModelSimple): +class IntegerEnumWithDefaultValue( + schemas.EnumBase, + schemas.IntSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - ('value',): { - '0': 0, - '1': 1, - '2': 2, - }, - } - - validations = { - } - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (int,), + class MetaOapg: + enum_value_to_name = { + 0: "POSITIVE_0", + 1: "POSITIVE_1", + 2: "POSITIVE_2", } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """IntegerEnumWithDefaultValue - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (int): if omitted defaults to 0, must be one of [0, 1, 2, ] # noqa: E501 - - Keyword Args: - value (int): if omitted defaults to 0, must be one of [0, 1, 2, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = 0 - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """IntegerEnumWithDefaultValue - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (int): if omitted defaults to 0, must be one of [0, 1, 2, ] # noqa: E501 - - Keyword Args: - value (int): if omitted defaults to 0, must be one of [0, 1, 2, ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = 0 - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self + + @schemas.classproperty + def POSITIVE_0(cls): + return cls(0) + + @schemas.classproperty + def POSITIVE_1(cls): + return cls(1) + + @schemas.classproperty + def POSITIVE_2(cls): + return cls(2) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_max10.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py rename to samples/openapi3/client/petstore/python/petstore_api/model/integer_max10.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/integer_max10.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/integer_max10.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_min15.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py rename to samples/openapi3/client/petstore/python/petstore_api/model/integer_min15.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/integer_min15.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/integer_min15.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.py index 162f8fedb53a..ddce91c9b96e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,320 +9,124 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.shape_interface import ShapeInterface - from petstore_api.model.triangle_interface import TriangleInterface - globals()['ShapeInterface'] = ShapeInterface - globals()['TriangleInterface'] = TriangleInterface - -class IsoscelesTriangle(ModelComposed): +class IsoscelesTriangle( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'shape_type': (str,), # noqa: E501 - 'triangle_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'shape_type': 'shapeType', # noqa: E501 - 'triangle_type': 'triangleType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """IsoscelesTriangle - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - triangle_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """IsoscelesTriangle - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - triangle_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ShapeInterface, - TriangleInterface, - ], - 'oneOf': [ - ], - } + class MetaOapg: + + + class all_of_1( + schemas.DictSchema + ): + + + class MetaOapg: + + class properties: + + + class triangleType( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "IsoscelesTriangle": "ISOSCELES_TRIANGLE", + } + + @schemas.classproperty + def ISOSCELES_TRIANGLE(cls): + return cls("IsoscelesTriangle") + __annotations__ = { + "triangleType": triangleType, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["triangleType"]) -> typing.Union[MetaOapg.properties.triangleType, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + triangleType: typing.Union[MetaOapg.properties.triangleType, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + triangleType=triangleType, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @functools.lru_cache() + def all_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + TriangleInterface, + cls.all_of_1, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'IsoscelesTriangle': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/json_patch_request.py b/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/json_patch_request.py rename to samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/json_patch_request.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/json_patch_request.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/json_patch_request_add_replace_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_add_replace_test.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/json_patch_request_add_replace_test.py rename to samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_add_replace_test.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/json_patch_request_add_replace_test.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_add_replace_test.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/json_patch_request_add_replace_test.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_add_replace_test.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/json_patch_request_move_copy.py b/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_move_copy.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/json_patch_request_move_copy.py rename to samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_move_copy.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/json_patch_request_move_copy.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_move_copy.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/json_patch_request_move_copy.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_move_copy.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/json_patch_request_remove.py b/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_remove.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/json_patch_request_remove.py rename to samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_remove.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/json_patch_request_remove.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_remove.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/json_patch_request_remove.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/json_patch_request_remove.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/mammal.py b/samples/openapi3/client/petstore/python/petstore_api/model/mammal.py index 0a2d927ea7ac..e90d419cc62c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/mammal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/mammal.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,343 +9,72 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.pig import Pig - from petstore_api.model.whale import Whale - from petstore_api.model.zebra import Zebra - globals()['Pig'] = Pig - globals()['Whale'] = Whale - globals()['Zebra'] = Zebra - -class Mammal(ModelComposed): +class Mammal( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - ('type',): { - 'PLAINS': "plains", - 'MOUNTAIN': "mountain", - 'GREVYS': "grevys", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'class_name': (str,), # noqa: E501 - 'has_baleen': (bool,), # noqa: E501 - 'has_teeth': (bool,), # noqa: E501 - 'type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'Pig': Pig, - 'whale': Whale, - 'zebra': Zebra, - } - if not val: - return None - return {'class_name': val} - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'has_baleen': 'hasBaleen', # noqa: E501 - 'has_teeth': 'hasTeeth', # noqa: E501 - 'type': 'type', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Mammal - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - has_baleen (bool): [optional] # noqa: E501 - has_teeth (bool): [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Mammal - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - has_baleen (bool): [optional] # noqa: E501 - has_teeth (bool): [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - Pig, - Whale, - Zebra, - ], - } + class MetaOapg: + + @staticmethod + def discriminator(): + return { + 'className': { + 'Pig': Pig, + 'whale': Whale, + 'zebra': Zebra, + } + } + + @classmethod + @functools.lru_cache() + def one_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + Whale, + Zebra, + Pig, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Mammal': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.pig import Pig +from petstore_api.model.whale import Whale +from petstore_api.model.zebra import Zebra diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/mammal.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/mammal.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/map_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/map_test.py index eccf9c9e610c..031503142c6b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/map_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/map_test.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,279 +9,237 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.string_boolean_map import StringBooleanMap - globals()['StringBooleanMap'] = StringBooleanMap - -class MapTest(ModelNormal): +class MapTest( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - ('map_of_enum_string',): { - 'UPPER': "UPPER", - 'LOWER': "lower", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'map_map_of_string': ({str: ({str: (str,)},)},), # noqa: E501 - 'map_of_enum_string': ({str: (str,)},), # noqa: E501 - 'direct_map': ({str: (bool,)},), # noqa: E501 - 'indirect_map': (StringBooleanMap,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'map_map_of_string': 'map_map_of_string', # noqa: E501 - 'map_of_enum_string': 'map_of_enum_string', # noqa: E501 - 'direct_map': 'direct_map', # noqa: E501 - 'indirect_map': 'indirect_map', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """MapTest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 - map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 - direct_map ({str: (bool,)}): [optional] # noqa: E501 - indirect_map (StringBooleanMap): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + class MetaOapg: + + class properties: + + + class map_map_of_string( + schemas.DictSchema + ): + + + class MetaOapg: + + + class additional_properties( + schemas.DictSchema + ): + + + class MetaOapg: + additional_properties = schemas.StrSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, str, ], + ) -> 'additional_properties': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ], + ) -> 'map_map_of_string': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """MapTest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 - map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 - direct_map ({str: (bool,)}): [optional] # noqa: E501 - indirect_map (StringBooleanMap): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + + + class map_of_enum_string( + schemas.DictSchema + ): + + + class MetaOapg: + + + class additional_properties( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "UPPER": "UPPER", + "lower": "LOWER", + } + + @schemas.classproperty + def UPPER(cls): + return cls("UPPER") + + @schemas.classproperty + def LOWER(cls): + return cls("lower") + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, str, ], + ) -> 'map_of_enum_string': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + + class direct_map( + schemas.DictSchema + ): + + + class MetaOapg: + additional_properties = schemas.BoolSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], + ) -> 'direct_map': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + @staticmethod + def indirect_map() -> typing.Type['StringBooleanMap']: + return StringBooleanMap + __annotations__ = { + "map_map_of_string": map_map_of_string, + "map_of_enum_string": map_of_enum_string, + "direct_map": direct_map, + "indirect_map": indirect_map, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["map_map_of_string"]) -> MetaOapg.properties.map_map_of_string: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["map_of_enum_string"]) -> MetaOapg.properties.map_of_enum_string: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["direct_map"]) -> MetaOapg.properties.direct_map: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["indirect_map"]) -> 'StringBooleanMap': ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["map_map_of_string", "map_of_enum_string", "direct_map", "indirect_map", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["map_map_of_string"]) -> typing.Union[MetaOapg.properties.map_map_of_string, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["map_of_enum_string"]) -> typing.Union[MetaOapg.properties.map_of_enum_string, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["direct_map"]) -> typing.Union[MetaOapg.properties.direct_map, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["indirect_map"]) -> typing.Union['StringBooleanMap', schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["map_map_of_string", "map_of_enum_string", "direct_map", "indirect_map", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + map_map_of_string: typing.Union[MetaOapg.properties.map_map_of_string, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + map_of_enum_string: typing.Union[MetaOapg.properties.map_of_enum_string, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + direct_map: typing.Union[MetaOapg.properties.direct_map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + indirect_map: typing.Union['StringBooleanMap', schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'MapTest': + return super().__new__( + cls, + *args, + map_map_of_string=map_map_of_string, + map_of_enum_string=map_of_enum_string, + direct_map=direct_map, + indirect_map=indirect_map, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.string_boolean_map import StringBooleanMap diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/map_test.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/map_test.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py index 4d825b8dd46d..b146d15b6a04 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,271 +9,123 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.animal import Animal - globals()['Animal'] = Animal - -class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): +class MixedPropertiesAndAdditionalPropertiesClass( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'uuid': (str,), # noqa: E501 - 'date_time': (datetime,), # noqa: E501 - 'map': ({str: (Animal,)},), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'uuid': 'uuid', # noqa: E501 - 'date_time': 'dateTime', # noqa: E501 - 'map': 'map', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - uuid (str): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - map ({str: (Animal,)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - uuid (str): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - map ({str: (Animal,)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + class MetaOapg: + + class properties: + uuid = schemas.UUIDSchema + dateTime = schemas.DateTimeSchema + + + class map( + schemas.DictSchema + ): + + + class MetaOapg: + + @staticmethod + def additional_properties() -> typing.Type['Animal']: + return Animal + + def __getitem__(self, name: typing.Union[str, ]) -> 'Animal': + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> 'Animal': + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: 'Animal', + ) -> 'map': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + __annotations__ = { + "uuid": uuid, + "dateTime": dateTime, + "map": map, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["uuid"]) -> MetaOapg.properties.uuid: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["dateTime"]) -> MetaOapg.properties.dateTime: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["map"]) -> MetaOapg.properties.map: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["uuid", "dateTime", "map", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["uuid"]) -> typing.Union[MetaOapg.properties.uuid, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["dateTime"]) -> typing.Union[MetaOapg.properties.dateTime, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["map"]) -> typing.Union[MetaOapg.properties.map, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["uuid", "dateTime", "map", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + uuid: typing.Union[MetaOapg.properties.uuid, str, uuid.UUID, schemas.Unset] = schemas.unset, + dateTime: typing.Union[MetaOapg.properties.dateTime, str, datetime, schemas.Unset] = schemas.unset, + map: typing.Union[MetaOapg.properties.map, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'MixedPropertiesAndAdditionalPropertiesClass': + return super().__new__( + cls, + *args, + uuid=uuid, + dateTime=dateTime, + map=map, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.py b/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.py index 9bebea2423fd..7cdc34c57688 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,261 +9,81 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class Model200Response(ModelNormal): +class Model200Response( + schemas.AnyTypeSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. + model with an invalid class name for python, starts with a number """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (int,), # noqa: E501 - '_class': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - '_class': 'class', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Model200Response - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (int): [optional] # noqa: E501 - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Model200Response - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (int): [optional] # noqa: E501 - _class (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + + class properties: + name = schemas.Int32Schema + _class = schemas.StrSchema + __annotations__ = { + "name": name, + "class": _class, + } + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["class"]) -> MetaOapg.properties._class: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "class", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["class"]) -> typing.Union[MetaOapg.properties._class, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "class", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + name: typing.Union[MetaOapg.properties.name, decimal.Decimal, int, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Model200Response': + return super().__new__( + cls, + *args, + name=name, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/model200_response.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/model_return.py b/samples/openapi3/client/petstore/python/petstore_api/model/model_return.py index f3bd5123dd74..1549dc1120d6 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/model_return.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/model_return.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,257 +9,71 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class ModelReturn(ModelNormal): +class ModelReturn( + schemas.AnyTypeSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. + Model for testing reserved words """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - '_return': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - '_return': 'return', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ModelReturn - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _return (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ModelReturn - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - _return (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + + class properties: + _return = schemas.Int32Schema + __annotations__ = { + "return": _return, + } + + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["return"]) -> MetaOapg.properties._return: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["return", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["return"]) -> typing.Union[MetaOapg.properties._return, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["return", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'ModelReturn': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/model_return.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/model_return.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.py b/samples/openapi3/client/petstore/python/petstore_api/model/money.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.py rename to samples/openapi3/client/petstore/python/petstore_api/model/money.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/money.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/money.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/name.py b/samples/openapi3/client/petstore/python/petstore_api/model/name.py index aec8c8b900cb..e67d017f241a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/name.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/name.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,277 +9,96 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class Name(ModelNormal): +class Name( + schemas.AnyTypeSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. + Model for testing model name same as property name """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (int,), # noqa: E501 - 'snake_case': (int,), # noqa: E501 - '_property': (str,), # noqa: E501 - '_123_number': (int,), # noqa: E501 + class MetaOapg: + required = { + "name", } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - 'snake_case': 'snake_case', # noqa: E501 - '_property': 'property', # noqa: E501 - '_123_number': '123Number', # noqa: E501 - } - - read_only_vars = { - 'snake_case', # noqa: E501 - '_123_number', # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 - """Name - a model defined in OpenAPI - - Args: - name (int): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - snake_case (int): [optional] # noqa: E501 - _property (str): [optional] # noqa: E501 - _123_number (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, *args, **kwargs): # noqa: E501 - """Name - a model defined in OpenAPI - - Args: - name (int): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - snake_case (int): [optional] # noqa: E501 - _property (str): [optional] # noqa: E501 - _123_number (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + class properties: + name = schemas.Int32Schema + snake_case = schemas.Int32Schema + _property = schemas.StrSchema + __annotations__ = { + "name": name, + "snake_case": snake_case, + "property": _property, + } + + + name: MetaOapg.properties.name + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["snake_case"]) -> MetaOapg.properties.snake_case: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["property"]) -> MetaOapg.properties._property: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "snake_case", "property", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["snake_case"]) -> typing.Union[MetaOapg.properties.snake_case, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["property"]) -> typing.Union[MetaOapg.properties._property, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "snake_case", "property", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + name: typing.Union[MetaOapg.properties.name, decimal.Decimal, int, ], + snake_case: typing.Union[MetaOapg.properties.snake_case, decimal.Decimal, int, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Name': + return super().__new__( + cls, + *args, + name=name, + snake_case=snake_case, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/name.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/name.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py b/samples/openapi3/client/petstore/python/petstore_api/model/no_additional_properties.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py rename to samples/openapi3/client/petstore/python/petstore_api/model/no_additional_properties.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/no_additional_properties.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/no_additional_properties.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.py index 0c6765a33ca5..0d3c13b45761 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,305 +9,568 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class NullableClass(ModelNormal): +class NullableClass( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'integer_prop': (int, none_type,), # noqa: E501 - 'number_prop': (float, none_type,), # noqa: E501 - 'boolean_prop': (bool, none_type,), # noqa: E501 - 'string_prop': (str, none_type,), # noqa: E501 - 'date_prop': (date, none_type,), # noqa: E501 - 'datetime_prop': (datetime, none_type,), # noqa: E501 - 'array_nullable_prop': ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type,), # noqa: E501 - 'array_and_items_nullable_prop': ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type], none_type,), # noqa: E501 - 'array_items_nullable': ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type],), # noqa: E501 - 'object_nullable': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 - 'object_nullable_prop': ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}, none_type,), # noqa: E501 - 'object_and_items_nullable_prop': ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}, none_type,), # noqa: E501 - 'object_items_nullable': ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)},), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - 'integer_prop': 'integer_prop', # noqa: E501 - 'number_prop': 'number_prop', # noqa: E501 - 'boolean_prop': 'boolean_prop', # noqa: E501 - 'string_prop': 'string_prop', # noqa: E501 - 'date_prop': 'date_prop', # noqa: E501 - 'datetime_prop': 'datetime_prop', # noqa: E501 - 'array_nullable_prop': 'array_nullable_prop', # noqa: E501 - 'array_and_items_nullable_prop': 'array_and_items_nullable_prop', # noqa: E501 - 'array_items_nullable': 'array_items_nullable', # noqa: E501 - 'object_nullable': 'object_nullable', # noqa: E501 - 'object_nullable_prop': 'object_nullable_prop', # noqa: E501 - 'object_and_items_nullable_prop': 'object_and_items_nullable_prop', # noqa: E501 - 'object_items_nullable': 'object_items_nullable', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """NullableClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - integer_prop (int, none_type): [optional] # noqa: E501 - number_prop (float, none_type): [optional] # noqa: E501 - boolean_prop (bool, none_type): [optional] # noqa: E501 - string_prop (str, none_type): [optional] # noqa: E501 - date_prop (date, none_type): [optional] # noqa: E501 - datetime_prop (datetime, none_type): [optional] # noqa: E501 - array_nullable_prop ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type): [optional] # noqa: E501 - array_and_items_nullable_prop ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type], none_type): [optional] # noqa: E501 - array_items_nullable ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type]): [optional] # noqa: E501 - object_nullable ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 - object_nullable_prop ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}, none_type): [optional] # noqa: E501 - object_and_items_nullable_prop ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}, none_type): [optional] # noqa: E501 - object_items_nullable ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + class MetaOapg: + + class properties: + + + class integer_prop( + schemas.IntBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneDecimalMixin + ): + + + def __new__( + cls, + *args: typing.Union[None, decimal.Decimal, int, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'integer_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """NullableClass - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - integer_prop (int, none_type): [optional] # noqa: E501 - number_prop (float, none_type): [optional] # noqa: E501 - boolean_prop (bool, none_type): [optional] # noqa: E501 - string_prop (str, none_type): [optional] # noqa: E501 - date_prop (date, none_type): [optional] # noqa: E501 - datetime_prop (datetime, none_type): [optional] # noqa: E501 - array_nullable_prop ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type): [optional] # noqa: E501 - array_and_items_nullable_prop ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type], none_type): [optional] # noqa: E501 - array_items_nullable ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type]): [optional] # noqa: E501 - object_nullable ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 - object_nullable_prop ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}, none_type): [optional] # noqa: E501 - object_and_items_nullable_prop ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}, none_type): [optional] # noqa: E501 - object_items_nullable ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + + + class number_prop( + schemas.NumberBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneDecimalMixin + ): + + + def __new__( + cls, + *args: typing.Union[None, decimal.Decimal, int, float, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'number_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + + class boolean_prop( + schemas.BoolBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneBoolMixin + ): + + + def __new__( + cls, + *args: typing.Union[None, bool, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'boolean_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) + + + class string_prop( + schemas.StrBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneStrMixin + ): + + + def __new__( + cls, + *args: typing.Union[None, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'string_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) + + + class date_prop( + schemas.DateBase, + schemas.StrBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneStrMixin + ): + + + class MetaOapg: + format = 'date' + + + def __new__( + cls, + *args: typing.Union[None, str, date, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'date_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) + + + class datetime_prop( + schemas.DateTimeBase, + schemas.StrBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneStrMixin + ): + + + class MetaOapg: + format = 'date-time' + + + def __new__( + cls, + *args: typing.Union[None, str, datetime, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'datetime_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) + + + class array_nullable_prop( + schemas.ListBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneTupleMixin + ): + + + class MetaOapg: + items = schemas.DictSchema + + + def __new__( + cls, + *args: typing.Union[list, tuple, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'array_nullable_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) + + + class array_and_items_nullable_prop( + schemas.ListBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneTupleMixin + ): + + + class MetaOapg: + + + class items( + schemas.DictBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneFrozenDictMixin + ): + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'items': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + def __new__( + cls, + *args: typing.Union[list, tuple, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'array_and_items_nullable_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) + + + class array_items_nullable( + schemas.ListSchema + ): + + + class MetaOapg: + + + class items( + schemas.DictBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneFrozenDictMixin + ): + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'items': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, None, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, None, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'array_items_nullable': + return super().__new__( + cls, + arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + + class object_nullable_prop( + schemas.DictBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneFrozenDictMixin + ): + + + class MetaOapg: + additional_properties = schemas.DictSchema + + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ], + ) -> 'object_nullable_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + class object_and_items_nullable_prop( + schemas.DictBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneFrozenDictMixin + ): + + + class MetaOapg: + + + class additional_properties( + schemas.DictBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneFrozenDictMixin + ): + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'additional_properties': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, None, ], + ) -> 'object_and_items_nullable_prop': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + + class object_items_nullable( + schemas.DictSchema + ): + + + class MetaOapg: + + + class additional_properties( + schemas.DictBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneFrozenDictMixin + ): + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'additional_properties': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, None, ], + ) -> 'object_items_nullable': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + __annotations__ = { + "integer_prop": integer_prop, + "number_prop": number_prop, + "boolean_prop": boolean_prop, + "string_prop": string_prop, + "date_prop": date_prop, + "datetime_prop": datetime_prop, + "array_nullable_prop": array_nullable_prop, + "array_and_items_nullable_prop": array_and_items_nullable_prop, + "array_items_nullable": array_items_nullable, + "object_nullable_prop": object_nullable_prop, + "object_and_items_nullable_prop": object_and_items_nullable_prop, + "object_items_nullable": object_items_nullable, + } + + + class additional_properties( + schemas.DictBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneFrozenDictMixin + ): + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'additional_properties': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["integer_prop"]) -> MetaOapg.properties.integer_prop: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["number_prop"]) -> MetaOapg.properties.number_prop: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["boolean_prop"]) -> MetaOapg.properties.boolean_prop: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["string_prop"]) -> MetaOapg.properties.string_prop: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["date_prop"]) -> MetaOapg.properties.date_prop: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["datetime_prop"]) -> MetaOapg.properties.datetime_prop: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["array_nullable_prop"]) -> MetaOapg.properties.array_nullable_prop: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["array_and_items_nullable_prop"]) -> MetaOapg.properties.array_and_items_nullable_prop: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["array_items_nullable"]) -> MetaOapg.properties.array_items_nullable: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["object_nullable_prop"]) -> MetaOapg.properties.object_nullable_prop: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["object_and_items_nullable_prop"]) -> MetaOapg.properties.object_and_items_nullable_prop: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["object_items_nullable"]) -> MetaOapg.properties.object_items_nullable: ... + + @typing.overload + def __getitem__(self, name: str) -> MetaOapg.additional_properties: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["integer_prop"], typing_extensions.Literal["number_prop"], typing_extensions.Literal["boolean_prop"], typing_extensions.Literal["string_prop"], typing_extensions.Literal["date_prop"], typing_extensions.Literal["datetime_prop"], typing_extensions.Literal["array_nullable_prop"], typing_extensions.Literal["array_and_items_nullable_prop"], typing_extensions.Literal["array_items_nullable"], typing_extensions.Literal["object_nullable_prop"], typing_extensions.Literal["object_and_items_nullable_prop"], typing_extensions.Literal["object_items_nullable"], str, ]): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["integer_prop"]) -> typing.Union[MetaOapg.properties.integer_prop, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["number_prop"]) -> typing.Union[MetaOapg.properties.number_prop, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["boolean_prop"]) -> typing.Union[MetaOapg.properties.boolean_prop, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["string_prop"]) -> typing.Union[MetaOapg.properties.string_prop, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["date_prop"]) -> typing.Union[MetaOapg.properties.date_prop, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["datetime_prop"]) -> typing.Union[MetaOapg.properties.datetime_prop, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["array_nullable_prop"]) -> typing.Union[MetaOapg.properties.array_nullable_prop, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["array_and_items_nullable_prop"]) -> typing.Union[MetaOapg.properties.array_and_items_nullable_prop, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["array_items_nullable"]) -> typing.Union[MetaOapg.properties.array_items_nullable, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["object_nullable_prop"]) -> typing.Union[MetaOapg.properties.object_nullable_prop, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["object_and_items_nullable_prop"]) -> typing.Union[MetaOapg.properties.object_and_items_nullable_prop, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["object_items_nullable"]) -> typing.Union[MetaOapg.properties.object_items_nullable, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[MetaOapg.additional_properties, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["integer_prop"], typing_extensions.Literal["number_prop"], typing_extensions.Literal["boolean_prop"], typing_extensions.Literal["string_prop"], typing_extensions.Literal["date_prop"], typing_extensions.Literal["datetime_prop"], typing_extensions.Literal["array_nullable_prop"], typing_extensions.Literal["array_and_items_nullable_prop"], typing_extensions.Literal["array_items_nullable"], typing_extensions.Literal["object_nullable_prop"], typing_extensions.Literal["object_and_items_nullable_prop"], typing_extensions.Literal["object_items_nullable"], str, ]): + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + integer_prop: typing.Union[MetaOapg.properties.integer_prop, None, decimal.Decimal, int, schemas.Unset] = schemas.unset, + number_prop: typing.Union[MetaOapg.properties.number_prop, None, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, + boolean_prop: typing.Union[MetaOapg.properties.boolean_prop, None, bool, schemas.Unset] = schemas.unset, + string_prop: typing.Union[MetaOapg.properties.string_prop, None, str, schemas.Unset] = schemas.unset, + date_prop: typing.Union[MetaOapg.properties.date_prop, None, str, date, schemas.Unset] = schemas.unset, + datetime_prop: typing.Union[MetaOapg.properties.datetime_prop, None, str, datetime, schemas.Unset] = schemas.unset, + array_nullable_prop: typing.Union[MetaOapg.properties.array_nullable_prop, list, tuple, None, schemas.Unset] = schemas.unset, + array_and_items_nullable_prop: typing.Union[MetaOapg.properties.array_and_items_nullable_prop, list, tuple, None, schemas.Unset] = schemas.unset, + array_items_nullable: typing.Union[MetaOapg.properties.array_items_nullable, list, tuple, schemas.Unset] = schemas.unset, + object_nullable_prop: typing.Union[MetaOapg.properties.object_nullable_prop, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, + object_and_items_nullable_prop: typing.Union[MetaOapg.properties.object_and_items_nullable_prop, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, + object_items_nullable: typing.Union[MetaOapg.properties.object_items_nullable, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, None, ], + ) -> 'NullableClass': + return super().__new__( + cls, + *args, + integer_prop=integer_prop, + number_prop=number_prop, + boolean_prop=boolean_prop, + string_prop=string_prop, + date_prop=date_prop, + datetime_prop=datetime_prop, + array_nullable_prop=array_nullable_prop, + array_and_items_nullable_prop=array_and_items_nullable_prop, + array_items_nullable=array_items_nullable, + object_nullable_prop=object_nullable_prop, + object_and_items_nullable_prop=object_and_items_nullable_prop, + object_items_nullable=object_items_nullable, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.py index 75aad1b1b010..e22e8d824e2d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,330 +9,64 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.quadrilateral import Quadrilateral - from petstore_api.model.triangle import Triangle - globals()['Quadrilateral'] = Quadrilateral - globals()['Triangle'] = Triangle - -class NullableShape(ModelComposed): +class NullableShape( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. + The value may be a shape or the 'null' value. For a composed schema to validate a null payload, one of its chosen oneOf schemas must be type null or nullable (introduced in OAS schema >= 3.0) """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'shape_type': (str,), # noqa: E501 - 'quadrilateral_type': (str,), # noqa: E501 - 'triangle_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'Quadrilateral': Quadrilateral, - 'Triangle': Triangle, - } - if not val: - return None - return {'shape_type': val} - - attribute_map = { - 'shape_type': 'shapeType', # noqa: E501 - 'quadrilateral_type': 'quadrilateralType', # noqa: E501 - 'triangle_type': 'triangleType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """NullableShape - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - quadrilateral_type (str): [optional] # noqa: E501 - triangle_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """NullableShape - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - quadrilateral_type (str): [optional] # noqa: E501 - triangle_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - Quadrilateral, - Triangle, - ], - } + class MetaOapg: + one_of_2 = schemas.NoneSchema + + @classmethod + @functools.lru_cache() + def one_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + Triangle, + Quadrilateral, + cls.one_of_2, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'NullableShape': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.quadrilateral import Quadrilateral +from petstore_api.model.triangle import Triangle diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_string.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py rename to samples/openapi3/client/petstore/python/petstore_api/model/nullable_string.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_string.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/nullable_string.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py b/samples/openapi3/client/petstore/python/petstore_api/model/number.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py rename to samples/openapi3/client/petstore/python/petstore_api/model/number.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/number.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/number.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/number_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/number_only.py index 7a586085d7c1..91aaaa507b8a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/number_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/number_only.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,257 +9,70 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class NumberOnly(ModelNormal): +class NumberOnly( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'just_number': (float,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'just_number': 'JustNumber', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """NumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - just_number (float): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """NumberOnly - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - just_number (float): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + + class properties: + JustNumber = schemas.NumberSchema + __annotations__ = { + "JustNumber": JustNumber, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["JustNumber"]) -> MetaOapg.properties.JustNumber: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["JustNumber", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["JustNumber"]) -> typing.Union[MetaOapg.properties.JustNumber, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["JustNumber", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + JustNumber: typing.Union[MetaOapg.properties.JustNumber, decimal.Decimal, int, float, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'NumberOnly': + return super().__new__( + cls, + *args, + JustNumber=JustNumber, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/number_only.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/number_only.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.py index 67e019ad54db..f8b63e35856f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,284 +9,30 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class NumberWithValidations(ModelSimple): +class NumberWithValidations( + schemas.NumberSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - ('value',): { - 'inclusive_maximum': 20, - 'inclusive_minimum': 10, - }, - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (float,), - } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """NumberWithValidations - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (float): # noqa: E501 - - Keyword Args: - value (float): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """NumberWithValidations - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (float): # noqa: E501 - - Keyword Args: - value (float): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - return self + class MetaOapg: + inclusive_maximum = 20 + inclusive_minimum = 10 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_interface.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_interface.py index 4f9e0edf9862..05dc6ddd5658 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_interface.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/object_interface.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,253 +9,16 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError - - - -class ObjectInterface(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ObjectInterface - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ObjectInterface - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) +import frozendict # noqa: F401 - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") +from petstore_api import schemas # noqa: F401 +ObjectInterface = schemas.DictSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/object_interface.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/object_interface.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.py index 085a1533c4bd..e68caff8717c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,277 +9,97 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.number_with_validations import NumberWithValidations - from petstore_api.model.readonly import Readonly - globals()['NumberWithValidations'] = NumberWithValidations - globals()['Readonly'] = Readonly - -class ObjectModelWithRefProps(ModelNormal): +class ObjectModelWithRefProps( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. + a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'my_number': (NumberWithValidations,), # noqa: E501 - 'my_readonly': (Readonly,), # noqa: E501 - 'my_string': (str,), # noqa: E501 - 'my_boolean': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'my_number': 'my_number', # noqa: E501 - 'my_readonly': 'my_readonly', # noqa: E501 - 'my_string': 'my_string', # noqa: E501 - 'my_boolean': 'my_boolean', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ObjectModelWithRefProps - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - my_number (NumberWithValidations): [optional] # noqa: E501 - my_readonly (Readonly): [optional] # noqa: E501 - my_string (str): [optional] # noqa: E501 - my_boolean (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ObjectModelWithRefProps - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - my_number (NumberWithValidations): [optional] # noqa: E501 - my_readonly (Readonly): [optional] # noqa: E501 - my_string (str): [optional] # noqa: E501 - my_boolean (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + + class properties: + + @staticmethod + def myNumber() -> typing.Type['NumberWithValidations']: + return NumberWithValidations + myString = schemas.StrSchema + myBoolean = schemas.BoolSchema + __annotations__ = { + "myNumber": myNumber, + "myString": myString, + "myBoolean": myBoolean, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["myNumber"]) -> 'NumberWithValidations': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["myString"]) -> MetaOapg.properties.myString: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["myBoolean"]) -> MetaOapg.properties.myBoolean: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["myNumber", "myString", "myBoolean", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["myNumber"]) -> typing.Union['NumberWithValidations', schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["myString"]) -> typing.Union[MetaOapg.properties.myString, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["myBoolean"]) -> typing.Union[MetaOapg.properties.myBoolean, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["myNumber", "myString", "myBoolean", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + myNumber: typing.Union['NumberWithValidations', schemas.Unset] = schemas.unset, + myString: typing.Union[MetaOapg.properties.myString, str, schemas.Unset] = schemas.unset, + myBoolean: typing.Union[MetaOapg.properties.myBoolean, bool, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'ObjectModelWithRefProps': + return super().__new__( + cls, + *args, + myNumber=myNumber, + myString=myString, + myBoolean=myBoolean, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.number_with_validations import NumberWithValidations diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_decimal_properties.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.py rename to samples/openapi3/client/petstore/python/petstore_api/model/object_with_decimal_properties.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_decimal_properties.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/object_with_decimal_properties.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_difficultly_named_props.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py rename to samples/openapi3/client/petstore/python/petstore_api/model/object_with_difficultly_named_props.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_difficultly_named_props.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/object_with_difficultly_named_props.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_inline_composition_property.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.py rename to samples/openapi3/client/petstore/python/petstore_api/model/object_with_inline_composition_property.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_inline_composition_property.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_inline_composition_property.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/object_with_inline_composition_property.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_validations.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_validations.py index 16e0c1f1a2d3..50c22698177a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_validations.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_validations.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,256 +9,42 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class ObjectWithValidations(ModelNormal): +class ObjectWithValidations( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - ('value',): { - 'min_properties': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ObjectWithValidations - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ObjectWithValidations - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + min_properties = 2 + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'ObjectWithValidations': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_validations.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/object_with_validations.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/order.py b/samples/openapi3/client/petstore/python/petstore_api/model/order.py index 98fe0b869760..6d653b0ab07e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/order.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/order.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,282 +9,145 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class Order(ModelNormal): +class Order( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - ('status',): { - 'PLACED': "placed", - 'APPROVED': "approved", - 'DELIVERED': "delivered", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'id': (int,), # noqa: E501 - 'pet_id': (int,), # noqa: E501 - 'quantity': (int,), # noqa: E501 - 'ship_date': (datetime,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'complete': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'id': 'id', # noqa: E501 - 'pet_id': 'petId', # noqa: E501 - 'quantity': 'quantity', # noqa: E501 - 'ship_date': 'shipDate', # noqa: E501 - 'status': 'status', # noqa: E501 - 'complete': 'complete', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Order - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - pet_id (int): [optional] # noqa: E501 - quantity (int): [optional] # noqa: E501 - ship_date (datetime): [optional] # noqa: E501 - status (str): Order Status. [optional] # noqa: E501 - complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Order - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - pet_id (int): [optional] # noqa: E501 - quantity (int): [optional] # noqa: E501 - ship_date (datetime): [optional] # noqa: E501 - status (str): Order Status. [optional] # noqa: E501 - complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + + class properties: + id = schemas.Int64Schema + petId = schemas.Int64Schema + quantity = schemas.Int32Schema + shipDate = schemas.DateTimeSchema + + + class status( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "placed": "PLACED", + "approved": "APPROVED", + "delivered": "DELIVERED", + } + + @schemas.classproperty + def PLACED(cls): + return cls("placed") + + @schemas.classproperty + def APPROVED(cls): + return cls("approved") + + @schemas.classproperty + def DELIVERED(cls): + return cls("delivered") + complete = schemas.BoolSchema + __annotations__ = { + "id": id, + "petId": petId, + "quantity": quantity, + "shipDate": shipDate, + "status": status, + "complete": complete, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["petId"]) -> MetaOapg.properties.petId: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["quantity"]) -> MetaOapg.properties.quantity: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["shipDate"]) -> MetaOapg.properties.shipDate: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["status"]) -> MetaOapg.properties.status: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["complete"]) -> MetaOapg.properties.complete: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "petId", "quantity", "shipDate", "status", "complete", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["petId"]) -> typing.Union[MetaOapg.properties.petId, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["quantity"]) -> typing.Union[MetaOapg.properties.quantity, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["shipDate"]) -> typing.Union[MetaOapg.properties.shipDate, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["status"]) -> typing.Union[MetaOapg.properties.status, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["complete"]) -> typing.Union[MetaOapg.properties.complete, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "petId", "quantity", "shipDate", "status", "complete", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, + petId: typing.Union[MetaOapg.properties.petId, decimal.Decimal, int, schemas.Unset] = schemas.unset, + quantity: typing.Union[MetaOapg.properties.quantity, decimal.Decimal, int, schemas.Unset] = schemas.unset, + shipDate: typing.Union[MetaOapg.properties.shipDate, str, datetime, schemas.Unset] = schemas.unset, + status: typing.Union[MetaOapg.properties.status, str, schemas.Unset] = schemas.unset, + complete: typing.Union[MetaOapg.properties.complete, bool, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Order': + return super().__new__( + cls, + *args, + id=id, + petId=petId, + quantity=quantity, + shipDate=shipDate, + status=status, + complete=complete, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/order.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/order.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py b/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py index 8d94006f1591..178eab4e5a13 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,320 +9,68 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.child_cat import ChildCat - from petstore_api.model.grandparent_animal import GrandparentAnimal - globals()['ChildCat'] = ChildCat - globals()['GrandparentAnimal'] = GrandparentAnimal - -class ParentPet(ModelComposed): +class ParentPet( + schemas.ComposedBase, + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'pet_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'ChildCat': ChildCat, - } - if not val: - return None - return {'pet_type': val} - - attribute_map = { - 'pet_type': 'pet_type', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ParentPet - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ParentPet - a model defined in OpenAPI - - Keyword Args: - pet_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - GrandparentAnimal, - ], - 'oneOf': [ - ], - } + class MetaOapg: + + @staticmethod + def discriminator(): + return { + 'pet_type': { + 'ChildCat': ChildCat, + } + } + + @classmethod + @functools.lru_cache() + def all_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + GrandparentAnimal, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'ParentPet': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.child_cat import ChildCat +from petstore_api.model.grandparent_animal import GrandparentAnimal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/pet.py b/samples/openapi3/client/petstore/python/petstore_api/model/pet.py index 5eb4041e91d0..5b1b6b8275e2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/pet.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/pet.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,298 +9,207 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.category import Category - from petstore_api.model.tag import Tag - globals()['Category'] = Category - globals()['Tag'] = Tag - -class Pet(ModelNormal): +class Pet( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. + Pet object that needs to be added to the store """ - allowed_values = { - ('status',): { - 'AVAILABLE': "available", - 'PENDING': "pending", - 'SOLD': "sold", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'name': (str,), # noqa: E501 - 'photo_urls': ([str],), # noqa: E501 - 'id': (int,), # noqa: E501 - 'category': (Category,), # noqa: E501 - 'tags': ([Tag],), # noqa: E501 - 'status': (str,), # noqa: E501 + class MetaOapg: + required = { + "photoUrls", + "name", } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - 'photo_urls': 'photoUrls', # noqa: E501 - 'id': 'id', # noqa: E501 - 'category': 'category', # noqa: E501 - 'tags': 'tags', # noqa: E501 - 'status': 'status', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, photo_urls, *args, **kwargs): # noqa: E501 - """Pet - a model defined in OpenAPI - - Args: - name (str): - photo_urls ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - category (Category): [optional] # noqa: E501 - tags ([Tag]): [optional] # noqa: E501 - status (str): pet status in the store. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + + class properties: + name = schemas.StrSchema + + + class photoUrls( + schemas.ListSchema + ): + + + class MetaOapg: + items = schemas.StrSchema + + def __new__( + cls, + arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'photoUrls': + return super().__new__( + cls, + arg, + _configuration=_configuration, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.photo_urls = photo_urls - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, photo_urls, *args, **kwargs): # noqa: E501 - """Pet - a model defined in OpenAPI - - Args: - name (str): - photo_urls ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - category (Category): [optional] # noqa: E501 - tags ([Tag]): [optional] # noqa: E501 - status (str): pet status in the store. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + id = schemas.Int64Schema + + @staticmethod + def category() -> typing.Type['Category']: + return Category + + + class tags( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['Tag']: + return Tag + + def __new__( + cls, + arg: typing.Union[typing.Tuple['Tag'], typing.List['Tag']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'tags': + return super().__new__( + cls, + arg, + _configuration=_configuration, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.photo_urls = photo_urls - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + def __getitem__(self, i: int) -> 'Tag': + return super().__getitem__(i) + + + class status( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "available": "AVAILABLE", + "pending": "PENDING", + "sold": "SOLD", + } + + @schemas.classproperty + def AVAILABLE(cls): + return cls("available") + + @schemas.classproperty + def PENDING(cls): + return cls("pending") + + @schemas.classproperty + def SOLD(cls): + return cls("sold") + __annotations__ = { + "name": name, + "photoUrls": photoUrls, + "id": id, + "category": category, + "tags": tags, + "status": status, + } + + photoUrls: MetaOapg.properties.photoUrls + name: MetaOapg.properties.name + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["photoUrls"]) -> MetaOapg.properties.photoUrls: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["category"]) -> 'Category': ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["tags"]) -> MetaOapg.properties.tags: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["status"]) -> MetaOapg.properties.status: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "photoUrls", "id", "category", "tags", "status", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["photoUrls"]) -> MetaOapg.properties.photoUrls: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["category"]) -> typing.Union['Category', schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["tags"]) -> typing.Union[MetaOapg.properties.tags, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["status"]) -> typing.Union[MetaOapg.properties.status, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "photoUrls", "id", "category", "tags", "status", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + photoUrls: typing.Union[MetaOapg.properties.photoUrls, list, tuple, ], + name: typing.Union[MetaOapg.properties.name, str, ], + id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, + category: typing.Union['Category', schemas.Unset] = schemas.unset, + tags: typing.Union[MetaOapg.properties.tags, list, tuple, schemas.Unset] = schemas.unset, + status: typing.Union[MetaOapg.properties.status, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Pet': + return super().__new__( + cls, + *args, + photoUrls=photoUrls, + name=name, + id=id, + category=category, + tags=tags, + status=status, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.category import Category +from petstore_api.model.tag import Tag diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/pet.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/pet.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/pig.py b/samples/openapi3/client/petstore/python/petstore_api/model/pig.py index 5c9bcc5bd034..db4887c110ed 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/pig.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,322 +9,69 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.basque_pig import BasquePig - from petstore_api.model.danish_pig import DanishPig - globals()['BasquePig'] = BasquePig - globals()['DanishPig'] = DanishPig - -class Pig(ModelComposed): +class Pig( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'class_name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'BasquePig': BasquePig, - 'DanishPig': DanishPig, - } - if not val: - return None - return {'class_name': val} - - attribute_map = { - 'class_name': 'className', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Pig - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Pig - a model defined in OpenAPI - - Keyword Args: - class_name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - BasquePig, - DanishPig, - ], - } + class MetaOapg: + + @staticmethod + def discriminator(): + return { + 'className': { + 'BasquePig': BasquePig, + 'DanishPig': DanishPig, + } + } + + @classmethod + @functools.lru_cache() + def one_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + BasquePig, + DanishPig, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Pig': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.basque_pig import BasquePig +from petstore_api.model.danish_pig import DanishPig diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/pig.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/pig.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py b/samples/openapi3/client/petstore/python/petstore_api/model/player.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py rename to samples/openapi3/client/petstore/python/petstore_api/model/player.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/player.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/player.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.py b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.py index ddb76e43e806..6a9b08fa1fd0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,326 +9,69 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral - from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral - globals()['ComplexQuadrilateral'] = ComplexQuadrilateral - globals()['SimpleQuadrilateral'] = SimpleQuadrilateral - -class Quadrilateral(ModelComposed): +class Quadrilateral( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'quadrilateral_type': (str,), # noqa: E501 - 'shape_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'ComplexQuadrilateral': ComplexQuadrilateral, - 'SimpleQuadrilateral': SimpleQuadrilateral, - } - if not val: - return None - return {'quadrilateral_type': val} - - attribute_map = { - 'quadrilateral_type': 'quadrilateralType', # noqa: E501 - 'shape_type': 'shapeType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Quadrilateral - a model defined in OpenAPI - - Keyword Args: - quadrilateral_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - shape_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Quadrilateral - a model defined in OpenAPI - - Keyword Args: - quadrilateral_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - shape_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - ComplexQuadrilateral, - SimpleQuadrilateral, - ], - } + class MetaOapg: + + @staticmethod + def discriminator(): + return { + 'quadrilateralType': { + 'ComplexQuadrilateral': ComplexQuadrilateral, + 'SimpleQuadrilateral': SimpleQuadrilateral, + } + } + + @classmethod + @functools.lru_cache() + def one_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + SimpleQuadrilateral, + ComplexQuadrilateral, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Quadrilateral': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral +from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py index 9f61569c9c04..90c85c2388f7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,263 +9,103 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class QuadrilateralInterface(ModelNormal): +class QuadrilateralInterface( + schemas.AnyTypeSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'quadrilateral_type': (str,), # noqa: E501 + class MetaOapg: + required = { + "shapeType", + "quadrilateralType", } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'quadrilateral_type': 'quadrilateralType', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, quadrilateral_type, *args, **kwargs): # noqa: E501 - """QuadrilateralInterface - a model defined in OpenAPI - - Args: - quadrilateral_type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.quadrilateral_type = quadrilateral_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, quadrilateral_type, *args, **kwargs): # noqa: E501 - """QuadrilateralInterface - a model defined in OpenAPI - - Args: - quadrilateral_type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.quadrilateral_type = quadrilateral_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + class properties: + + + class shapeType( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "Quadrilateral": "QUADRILATERAL", + } + + @schemas.classproperty + def QUADRILATERAL(cls): + return cls("Quadrilateral") + quadrilateralType = schemas.StrSchema + __annotations__ = { + "shapeType": shapeType, + "quadrilateralType": quadrilateralType, + } + + + shapeType: MetaOapg.properties.shapeType + quadrilateralType: MetaOapg.properties.quadrilateralType + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["shapeType", "quadrilateralType", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["shapeType", "quadrilateralType", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + shapeType: typing.Union[MetaOapg.properties.shapeType, str, ], + quadrilateralType: typing.Union[MetaOapg.properties.quadrilateralType, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'QuadrilateralInterface': + return super().__new__( + cls, + *args, + shapeType=shapeType, + quadrilateralType=quadrilateralType, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.py b/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.py index 965325c2864d..c849de19067f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,262 +9,80 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class ReadOnlyFirst(ModelNormal): +class ReadOnlyFirst( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'bar': (str,), # noqa: E501 - 'baz': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'bar': 'bar', # noqa: E501 - 'baz': 'baz', # noqa: E501 - } - - read_only_vars = { - 'bar', # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ReadOnlyFirst - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] # noqa: E501 - baz (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ReadOnlyFirst - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bar (str): [optional] # noqa: E501 - baz (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + + class properties: + bar = schemas.StrSchema + baz = schemas.StrSchema + __annotations__ = { + "bar": bar, + "baz": baz, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["baz"]) -> MetaOapg.properties.baz: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", "baz", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["baz"]) -> typing.Union[MetaOapg.properties.baz, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", "baz", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + bar: typing.Union[MetaOapg.properties.bar, str, schemas.Unset] = schemas.unset, + baz: typing.Union[MetaOapg.properties.baz, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'ReadOnlyFirst': + return super().__new__( + cls, + *args, + bar=bar, + baz=baz, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.py index 6a7bfe81bd82..46083ad56443 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,320 +9,124 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.shape_interface import ShapeInterface - from petstore_api.model.triangle_interface import TriangleInterface - globals()['ShapeInterface'] = ShapeInterface - globals()['TriangleInterface'] = TriangleInterface - -class ScaleneTriangle(ModelComposed): +class ScaleneTriangle( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'shape_type': (str,), # noqa: E501 - 'triangle_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'shape_type': 'shapeType', # noqa: E501 - 'triangle_type': 'triangleType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ScaleneTriangle - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - triangle_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ScaleneTriangle - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - triangle_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ShapeInterface, - TriangleInterface, - ], - 'oneOf': [ - ], - } + class MetaOapg: + + + class all_of_1( + schemas.DictSchema + ): + + + class MetaOapg: + + class properties: + + + class triangleType( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "ScaleneTriangle": "SCALENE_TRIANGLE", + } + + @schemas.classproperty + def SCALENE_TRIANGLE(cls): + return cls("ScaleneTriangle") + __annotations__ = { + "triangleType": triangleType, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["triangleType"]) -> typing.Union[MetaOapg.properties.triangleType, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["triangleType", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + triangleType: typing.Union[MetaOapg.properties.triangleType, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + triangleType=triangleType, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @functools.lru_cache() + def all_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + TriangleInterface, + cls.all_of_1, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'ScaleneTriangle': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/shape.py b/samples/openapi3/client/petstore/python/petstore_api/model/shape.py index 025657240278..bab6e983c847 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/shape.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/shape.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,330 +9,69 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.quadrilateral import Quadrilateral - from petstore_api.model.triangle import Triangle - globals()['Quadrilateral'] = Quadrilateral - globals()['Triangle'] = Triangle - -class Shape(ModelComposed): +class Shape( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'shape_type': (str,), # noqa: E501 - 'quadrilateral_type': (str,), # noqa: E501 - 'triangle_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'Quadrilateral': Quadrilateral, - 'Triangle': Triangle, - } - if not val: - return None - return {'shape_type': val} - - attribute_map = { - 'shape_type': 'shapeType', # noqa: E501 - 'quadrilateral_type': 'quadrilateralType', # noqa: E501 - 'triangle_type': 'triangleType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Shape - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - quadrilateral_type (str): [optional] # noqa: E501 - triangle_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Shape - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - quadrilateral_type (str): [optional] # noqa: E501 - triangle_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - Quadrilateral, - Triangle, - ], - } + class MetaOapg: + + @staticmethod + def discriminator(): + return { + 'shapeType': { + 'Quadrilateral': Quadrilateral, + 'Triangle': Triangle, + } + } + + @classmethod + @functools.lru_cache() + def one_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + Triangle, + Quadrilateral, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Shape': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.quadrilateral import Quadrilateral +from petstore_api.model.triangle import Triangle diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/shape.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/shape.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.py b/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.py index 28bd8ecd4b5a..10342b8d037f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,331 +9,73 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.quadrilateral import Quadrilateral - from petstore_api.model.triangle import Triangle - globals()['Quadrilateral'] = Quadrilateral - globals()['Triangle'] = Triangle - -class ShapeOrNull(ModelComposed): +class ShapeOrNull( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. + The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'shape_type': (str,), # noqa: E501 - 'quadrilateral_type': (str,), # noqa: E501 - 'triangle_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'Quadrilateral': Quadrilateral, - 'Triangle': Triangle, - } - if not val: - return None - return {'shape_type': val} - - attribute_map = { - 'shape_type': 'shapeType', # noqa: E501 - 'quadrilateral_type': 'quadrilateralType', # noqa: E501 - 'triangle_type': 'triangleType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ShapeOrNull - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - quadrilateral_type (str): [optional] # noqa: E501 - triangle_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ShapeOrNull - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - quadrilateral_type (str): [optional] # noqa: E501 - triangle_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - Quadrilateral, - Triangle, - none_type, - ], - } + class MetaOapg: + + @staticmethod + def discriminator(): + return { + 'shapeType': { + 'Quadrilateral': Quadrilateral, + 'Triangle': Triangle, + } + } + one_of_0 = schemas.NoneSchema + + @classmethod + @functools.lru_cache() + def one_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + cls.one_of_0, + Triangle, + Quadrilateral, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'ShapeOrNull': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.quadrilateral import Quadrilateral +from petstore_api.model.triangle import Triangle diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.py b/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.py index 7c342851203f..93d3c1f9325a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,320 +9,124 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.quadrilateral_interface import QuadrilateralInterface - from petstore_api.model.shape_interface import ShapeInterface - globals()['QuadrilateralInterface'] = QuadrilateralInterface - globals()['ShapeInterface'] = ShapeInterface - -class SimpleQuadrilateral(ModelComposed): +class SimpleQuadrilateral( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'shape_type': (str,), # noqa: E501 - 'quadrilateral_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'shape_type': 'shapeType', # noqa: E501 - 'quadrilateral_type': 'quadrilateralType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SimpleQuadrilateral - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - quadrilateral_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SimpleQuadrilateral - a model defined in OpenAPI - - Keyword Args: - shape_type (str): - quadrilateral_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - QuadrilateralInterface, - ShapeInterface, - ], - 'oneOf': [ - ], - } + class MetaOapg: + + + class all_of_1( + schemas.DictSchema + ): + + + class MetaOapg: + + class properties: + + + class quadrilateralType( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "SimpleQuadrilateral": "SIMPLE_QUADRILATERAL", + } + + @schemas.classproperty + def SIMPLE_QUADRILATERAL(cls): + return cls("SimpleQuadrilateral") + __annotations__ = { + "quadrilateralType": quadrilateralType, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["quadrilateralType"]) -> MetaOapg.properties.quadrilateralType: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["quadrilateralType", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["quadrilateralType"]) -> typing.Union[MetaOapg.properties.quadrilateralType, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["quadrilateralType", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + quadrilateralType: typing.Union[MetaOapg.properties.quadrilateralType, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + quadrilateralType=quadrilateralType, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @functools.lru_cache() + def all_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + QuadrilateralInterface, + cls.all_of_1, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'SimpleQuadrilateral': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.quadrilateral_interface import QuadrilateralInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/some_object.py b/samples/openapi3/client/petstore/python/petstore_api/model/some_object.py index cee41c9aa7f1..3ce8eab0b42d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/some_object.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/some_object.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,309 +9,58 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.object_interface import ObjectInterface - globals()['ObjectInterface'] = ObjectInterface - -class SomeObject(ModelComposed): +class SomeObject( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SomeObject - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SomeObject - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ObjectInterface, - ], - 'oneOf': [ - ], - } + class MetaOapg: + + @classmethod + @functools.lru_cache() + def all_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + ObjectInterface, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'SomeObject': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.object_interface import ObjectInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/some_object.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/some_object.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.py b/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.py index 6044e5e10084..ca1f5c6ab848 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,257 +9,72 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class SpecialModelName(ModelNormal): +class SpecialModelName( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. + model with an invalid class name for python """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'special_property_name': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'special_property_name': '$special[property.name]', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SpecialModelName - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - special_property_name (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SpecialModelName - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - special_property_name (int): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + + class properties: + a = schemas.StrSchema + __annotations__ = { + "a": a, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["a"]) -> MetaOapg.properties.a: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["a", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["a"]) -> typing.Union[MetaOapg.properties.a, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["a", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + a: typing.Union[MetaOapg.properties.a, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'SpecialModelName': + return super().__new__( + cls, + *args, + a=a, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py b/samples/openapi3/client/petstore/python/petstore_api/model/string.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py rename to samples/openapi3/client/petstore/python/petstore_api/model/string.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/string.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/string.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/string_boolean_map.py b/samples/openapi3/client/petstore/python/petstore_api/model/string_boolean_map.py index 52b6f39964bd..9d4a6136b554 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/string_boolean_map.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/string_boolean_map.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,253 +9,49 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class StringBooleanMap(ModelNormal): +class StringBooleanMap( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """StringBooleanMap - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """StringBooleanMap - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + additional_properties = schemas.BoolSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], + ) -> 'StringBooleanMap': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/string_boolean_map.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/string_boolean_map.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.py index 0fbdcdc6af33..abc1696bc148 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,299 +9,81 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class StringEnum(ModelSimple): +class StringEnum( + schemas.EnumBase, + schemas.StrBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneStrMixin +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - ('value',): { - 'None': None, - 'PLACED': "placed", - 'APPROVED': "approved", - 'DELIVERED': "delivered", - 'SINGLE_QUOTED': "single quoted", - 'MULTIPLE_LINES': '''multiple -lines''', - 'DOUBLE_QUOTE_WITH_NEWLINE': '''double quote - with newline''', - }, - } - - validations = { - } - additional_properties_type = None - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), + class MetaOapg: + enum_value_to_name = { + "placed": "PLACED", + "approved": "APPROVED", + "delivered": "DELIVERED", + "single quoted": "SINGLE_QUOTED", + "multiple\nlines": "MULTIPLE_LINES", + "double quote \n with newline": "DOUBLE_QUOTE_WITH_NEWLINE", + schemas.NoneClass.NONE: "NONE", } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """StringEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["placed", "approved", "delivered", "single quoted", '''multiple -lines''', '''double quote - with newline''', ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["placed", "approved", "delivered", "single quoted", '''multiple -lines''', '''double quote - with newline''', ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """StringEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["placed", "approved", "delivered", "single quoted", '''multiple -lines''', '''double quote - with newline''', ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["placed", "approved", "delivered", "single quoted", '''multiple -lines''', '''double quote - with newline''', ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self + + @schemas.classproperty + def PLACED(cls): + return cls("placed") + + @schemas.classproperty + def APPROVED(cls): + return cls("approved") + + @schemas.classproperty + def DELIVERED(cls): + return cls("delivered") + + @schemas.classproperty + def SINGLE_QUOTED(cls): + return cls("single quoted") + + @schemas.classproperty + def MULTIPLE_LINES(cls): + return cls("multiple\nlines") + + @schemas.classproperty + def DOUBLE_QUOTE_WITH_NEWLINE(cls): + return cls("double quote \n with newline") + + @schemas.classproperty + def NONE(cls): + return cls(None) + + + def __new__( + cls, + *args: typing.Union[None, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'StringEnum': + return super().__new__( + cls, + *args, + _configuration=_configuration, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/string_enum.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.py index 37775c93ca08..852600965552 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,277 +9,46 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class StringEnumWithDefaultValue(ModelSimple): +class StringEnumWithDefaultValue( + schemas.EnumBase, + schemas.StrSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - ('value',): { - 'PLACED': "placed", - 'APPROVED': "approved", - 'DELIVERED': "delivered", - }, - } - - validations = { - } - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), + class MetaOapg: + enum_value_to_name = { + "placed": "PLACED", + "approved": "APPROVED", + "delivered": "DELIVERED", } - - @cached_property - def discriminator(): - return None - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """StringEnumWithDefaultValue - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): if omitted defaults to "placed", must be one of ["placed", "approved", "delivered", ] # noqa: E501 - - Keyword Args: - value (str): if omitted defaults to "placed", must be one of ["placed", "approved", "delivered", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "placed" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """StringEnumWithDefaultValue - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str): if omitted defaults to "placed", must be one of ["placed", "approved", "delivered", ] # noqa: E501 - - Keyword Args: - value (str): if omitted defaults to "placed", must be one of ["placed", "approved", "delivered", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - value = "placed" - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self + + @schemas.classproperty + def PLACED(cls): + return cls("placed") + + @schemas.classproperty + def APPROVED(cls): + return cls("approved") + + @schemas.classproperty + def DELIVERED(cls): + return cls("delivered") diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py b/samples/openapi3/client/petstore/python/petstore_api/model/string_with_validation.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py rename to samples/openapi3/client/petstore/python/petstore_api/model/string_with_validation.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/string_with_validation.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/string_with_validation.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/tag.py b/samples/openapi3/client/petstore/python/petstore_api/model/tag.py index b56728bb6bda..a0176eead362 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/tag.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/tag.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,261 +9,80 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class Tag(ModelNormal): +class Tag( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'id': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'id': 'id', # noqa: E501 - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Tag - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Tag - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + class MetaOapg: + + class properties: + id = schemas.Int64Schema + name = schemas.StrSchema + __annotations__ = { + "id": id, + "name": name, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "name", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "name", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, + name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Tag': + return super().__new__( + cls, + *args, + id=id, + name=name, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/tag.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/tag.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/triangle.py index fd9103c96bd6..0701b6d51113 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/triangle.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/triangle.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,330 +9,72 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -def lazy_import(): - from petstore_api.model.equilateral_triangle import EquilateralTriangle - from petstore_api.model.isosceles_triangle import IsoscelesTriangle - from petstore_api.model.scalene_triangle import ScaleneTriangle - globals()['EquilateralTriangle'] = EquilateralTriangle - globals()['IsoscelesTriangle'] = IsoscelesTriangle - globals()['ScaleneTriangle'] = ScaleneTriangle - -class Triangle(ModelComposed): +class Triangle( + schemas.ComposedSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'triangle_type': (str,), # noqa: E501 - 'shape_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'EquilateralTriangle': EquilateralTriangle, - 'IsoscelesTriangle': IsoscelesTriangle, - 'ScaleneTriangle': ScaleneTriangle, - } - if not val: - return None - return {'triangle_type': val} - - attribute_map = { - 'triangle_type': 'triangleType', # noqa: E501 - 'shape_type': 'shapeType', # noqa: E501 - } - - read_only_vars = { - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Triangle - a model defined in OpenAPI - - Keyword Args: - triangle_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - shape_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Triangle - a model defined in OpenAPI - - Keyword Args: - triangle_type (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - shape_type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - EquilateralTriangle, - IsoscelesTriangle, - ScaleneTriangle, - ], - } + class MetaOapg: + + @staticmethod + def discriminator(): + return { + 'triangleType': { + 'EquilateralTriangle': EquilateralTriangle, + 'IsoscelesTriangle': IsoscelesTriangle, + 'ScaleneTriangle': ScaleneTriangle, + } + } + + @classmethod + @functools.lru_cache() + def one_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + EquilateralTriangle, + IsoscelesTriangle, + ScaleneTriangle, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Triangle': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.equilateral_triangle import EquilateralTriangle +from petstore_api.model.isosceles_triangle import IsoscelesTriangle +from petstore_api.model.scalene_triangle import ScaleneTriangle diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/triangle.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/triangle.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.py b/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.py index 3bb817d86bcc..7ac28c0031c6 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,263 +9,103 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class TriangleInterface(ModelNormal): +class TriangleInterface( + schemas.AnyTypeSchema, +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'triangle_type': (str,), # noqa: E501 + class MetaOapg: + required = { + "shapeType", + "triangleType", } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'triangle_type': 'triangleType', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, triangle_type, *args, **kwargs): # noqa: E501 - """TriangleInterface - a model defined in OpenAPI - - Args: - triangle_type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.triangle_type = triangle_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, triangle_type, *args, **kwargs): # noqa: E501 - """TriangleInterface - a model defined in OpenAPI - - Args: - triangle_type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.triangle_type = triangle_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + class properties: + + + class shapeType( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "Triangle": "TRIANGLE", + } + + @schemas.classproperty + def TRIANGLE(cls): + return cls("Triangle") + triangleType = schemas.StrSchema + __annotations__ = { + "shapeType": shapeType, + "triangleType": triangleType, + } + + + shapeType: MetaOapg.properties.shapeType + triangleType: MetaOapg.properties.triangleType + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["shapeType", "triangleType", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["shapeType"]) -> MetaOapg.properties.shapeType: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["triangleType"]) -> MetaOapg.properties.triangleType: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["shapeType", "triangleType", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + shapeType: typing.Union[MetaOapg.properties.shapeType, str, ], + triangleType: typing.Union[MetaOapg.properties.triangleType, str, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'TriangleInterface': + return super().__new__( + cls, + *args, + shapeType=shapeType, + triangleType=triangleType, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/user.py b/samples/openapi3/client/petstore/python/petstore_api/model/user.py index a8056b29a293..c8beb19d8258 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/user.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/user.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,301 +9,233 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class User(ModelNormal): +class User( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'id': (int,), # noqa: E501 - 'username': (str,), # noqa: E501 - 'first_name': (str,), # noqa: E501 - 'last_name': (str,), # noqa: E501 - 'email': (str,), # noqa: E501 - 'password': (str,), # noqa: E501 - 'phone': (str,), # noqa: E501 - 'user_status': (int,), # noqa: E501 - 'object_with_no_declared_props': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'object_with_no_declared_props_nullable': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 - 'any_type_prop': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 - 'any_type_prop_nullable': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'id': 'id', # noqa: E501 - 'username': 'username', # noqa: E501 - 'first_name': 'firstName', # noqa: E501 - 'last_name': 'lastName', # noqa: E501 - 'email': 'email', # noqa: E501 - 'password': 'password', # noqa: E501 - 'phone': 'phone', # noqa: E501 - 'user_status': 'userStatus', # noqa: E501 - 'object_with_no_declared_props': 'objectWithNoDeclaredProps', # noqa: E501 - 'object_with_no_declared_props_nullable': 'objectWithNoDeclaredPropsNullable', # noqa: E501 - 'any_type_prop': 'anyTypeProp', # noqa: E501 - 'any_type_prop_nullable': 'anyTypePropNullable', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """User - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - username (str): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - password (str): [optional] # noqa: E501 - phone (str): [optional] # noqa: E501 - user_status (int): User Status. [optional] # noqa: E501 - object_with_no_declared_props ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.. [optional] # noqa: E501 - object_with_no_declared_props_nullable ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.. [optional] # noqa: E501 - any_type_prop (bool, date, datetime, dict, float, int, list, str, none_type): test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389. [optional] # noqa: E501 - any_type_prop_nullable (bool, date, datetime, dict, float, int, list, str, none_type): test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + class MetaOapg: + + class properties: + id = schemas.Int64Schema + username = schemas.StrSchema + firstName = schemas.StrSchema + lastName = schemas.StrSchema + email = schemas.StrSchema + password = schemas.StrSchema + phone = schemas.StrSchema + userStatus = schemas.Int32Schema + objectWithNoDeclaredProps = schemas.DictSchema + + + class objectWithNoDeclaredPropsNullable( + schemas.DictBase, + schemas.NoneBase, + schemas.Schema, + schemas.NoneFrozenDictMixin + ): + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, None, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'objectWithNoDeclaredPropsNullable': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """User - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - username (str): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - password (str): [optional] # noqa: E501 - phone (str): [optional] # noqa: E501 - user_status (int): User Status. [optional] # noqa: E501 - object_with_no_declared_props ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.. [optional] # noqa: E501 - object_with_no_declared_props_nullable ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.. [optional] # noqa: E501 - any_type_prop (bool, date, datetime, dict, float, int, list, str, none_type): test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389. [optional] # noqa: E501 - any_type_prop_nullable (bool, date, datetime, dict, float, int, list, str, none_type): test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), + anyTypeProp = schemas.AnyTypeSchema + + + class anyTypeExceptNullProp( + schemas.ComposedSchema, + ): + + + class MetaOapg: + not_schema = schemas.NoneSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'anyTypeExceptNullProp': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + anyTypePropNullable = schemas.AnyTypeSchema + __annotations__ = { + "id": id, + "username": username, + "firstName": firstName, + "lastName": lastName, + "email": email, + "password": password, + "phone": phone, + "userStatus": userStatus, + "objectWithNoDeclaredProps": objectWithNoDeclaredProps, + "objectWithNoDeclaredPropsNullable": objectWithNoDeclaredPropsNullable, + "anyTypeProp": anyTypeProp, + "anyTypeExceptNullProp": anyTypeExceptNullProp, + "anyTypePropNullable": anyTypePropNullable, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["username"]) -> MetaOapg.properties.username: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["firstName"]) -> MetaOapg.properties.firstName: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["lastName"]) -> MetaOapg.properties.lastName: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["email"]) -> MetaOapg.properties.email: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["password"]) -> MetaOapg.properties.password: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["phone"]) -> MetaOapg.properties.phone: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["userStatus"]) -> MetaOapg.properties.userStatus: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["objectWithNoDeclaredProps"]) -> MetaOapg.properties.objectWithNoDeclaredProps: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["objectWithNoDeclaredPropsNullable"]) -> MetaOapg.properties.objectWithNoDeclaredPropsNullable: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["anyTypeProp"]) -> MetaOapg.properties.anyTypeProp: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["anyTypeExceptNullProp"]) -> MetaOapg.properties.anyTypeExceptNullProp: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["anyTypePropNullable"]) -> MetaOapg.properties.anyTypePropNullable: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus", "objectWithNoDeclaredProps", "objectWithNoDeclaredPropsNullable", "anyTypeProp", "anyTypeExceptNullProp", "anyTypePropNullable", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["username"]) -> typing.Union[MetaOapg.properties.username, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["firstName"]) -> typing.Union[MetaOapg.properties.firstName, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["lastName"]) -> typing.Union[MetaOapg.properties.lastName, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["email"]) -> typing.Union[MetaOapg.properties.email, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["password"]) -> typing.Union[MetaOapg.properties.password, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["phone"]) -> typing.Union[MetaOapg.properties.phone, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["userStatus"]) -> typing.Union[MetaOapg.properties.userStatus, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["objectWithNoDeclaredProps"]) -> typing.Union[MetaOapg.properties.objectWithNoDeclaredProps, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["objectWithNoDeclaredPropsNullable"]) -> typing.Union[MetaOapg.properties.objectWithNoDeclaredPropsNullable, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["anyTypeProp"]) -> typing.Union[MetaOapg.properties.anyTypeProp, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["anyTypeExceptNullProp"]) -> typing.Union[MetaOapg.properties.anyTypeExceptNullProp, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["anyTypePropNullable"]) -> typing.Union[MetaOapg.properties.anyTypePropNullable, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus", "objectWithNoDeclaredProps", "objectWithNoDeclaredPropsNullable", "anyTypeProp", "anyTypeExceptNullProp", "anyTypePropNullable", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, + username: typing.Union[MetaOapg.properties.username, str, schemas.Unset] = schemas.unset, + firstName: typing.Union[MetaOapg.properties.firstName, str, schemas.Unset] = schemas.unset, + lastName: typing.Union[MetaOapg.properties.lastName, str, schemas.Unset] = schemas.unset, + email: typing.Union[MetaOapg.properties.email, str, schemas.Unset] = schemas.unset, + password: typing.Union[MetaOapg.properties.password, str, schemas.Unset] = schemas.unset, + phone: typing.Union[MetaOapg.properties.phone, str, schemas.Unset] = schemas.unset, + userStatus: typing.Union[MetaOapg.properties.userStatus, decimal.Decimal, int, schemas.Unset] = schemas.unset, + objectWithNoDeclaredProps: typing.Union[MetaOapg.properties.objectWithNoDeclaredProps, dict, frozendict.frozendict, schemas.Unset] = schemas.unset, + objectWithNoDeclaredPropsNullable: typing.Union[MetaOapg.properties.objectWithNoDeclaredPropsNullable, dict, frozendict.frozendict, None, schemas.Unset] = schemas.unset, + anyTypeProp: typing.Union[MetaOapg.properties.anyTypeProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + anyTypeExceptNullProp: typing.Union[MetaOapg.properties.anyTypeExceptNullProp, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + anyTypePropNullable: typing.Union[MetaOapg.properties.anyTypePropNullable, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'User': + return super().__new__( + cls, + *args, + id=id, + username=username, + firstName=firstName, + lastName=lastName, + email=email, + password=password, + phone=phone, + userStatus=userStatus, + objectWithNoDeclaredProps=objectWithNoDeclaredProps, + objectWithNoDeclaredPropsNullable=objectWithNoDeclaredPropsNullable, + anyTypeProp=anyTypeProp, + anyTypeExceptNullProp=anyTypeExceptNullProp, + anyTypePropNullable=anyTypePropNullable, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/user.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/user.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/uuid_string.py b/samples/openapi3/client/petstore/python/petstore_api/model/uuid_string.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/uuid_string.py rename to samples/openapi3/client/petstore/python/petstore_api/model/uuid_string.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/uuid_string.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/uuid_string.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/uuid_string.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/uuid_string.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/whale.py b/samples/openapi3/client/petstore/python/petstore_api/model/whale.py index 7c1a8426712f..b645789bd151 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/whale.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/whale.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,271 +9,110 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class Whale(ModelNormal): +class Whale( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'class_name': (str,), # noqa: E501 - 'has_baleen': (bool,), # noqa: E501 - 'has_teeth': (bool,), # noqa: E501 + class MetaOapg: + required = { + "className", } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'has_baleen': 'hasBaleen', # noqa: E501 - 'has_teeth': 'hasTeeth', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501 - """Whale - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - has_baleen (bool): [optional] # noqa: E501 - has_teeth (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """Whale - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - has_baleen (bool): [optional] # noqa: E501 - has_teeth (bool): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + class properties: + + + class className( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "whale": "WHALE", + } + + @schemas.classproperty + def WHALE(cls): + return cls("whale") + hasBaleen = schemas.BoolSchema + hasTeeth = schemas.BoolSchema + __annotations__ = { + "className": className, + "hasBaleen": hasBaleen, + "hasTeeth": hasTeeth, + } + + className: MetaOapg.properties.className + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["hasBaleen"]) -> MetaOapg.properties.hasBaleen: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["hasTeeth"]) -> MetaOapg.properties.hasTeeth: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["className", "hasBaleen", "hasTeeth", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["hasBaleen"]) -> typing.Union[MetaOapg.properties.hasBaleen, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["hasTeeth"]) -> typing.Union[MetaOapg.properties.hasTeeth, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className", "hasBaleen", "hasTeeth", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + className: typing.Union[MetaOapg.properties.className, str, ], + hasBaleen: typing.Union[MetaOapg.properties.hasBaleen, bool, schemas.Unset] = schemas.unset, + hasTeeth: typing.Union[MetaOapg.properties.hasTeeth, bool, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'Whale': + return super().__new__( + cls, + *args, + className=className, + hasBaleen=hasBaleen, + hasTeeth=hasTeeth, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/whale.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/whale.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/zebra.py b/samples/openapi3/client/petstore/python/petstore_api/model/zebra.py index b6d2fe934d52..960a43f5921e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/zebra.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/zebra.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,272 +9,124 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from petstore_api.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from petstore_api.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from petstore_api import schemas # noqa: F401 -class Zebra(ModelNormal): +class Zebra( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - ('type',): { - 'PLAINS': "plains", - 'MOUNTAIN': "mountain", - 'GREVYS': "grevys", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'class_name': (str,), # noqa: E501 - 'type': (str,), # noqa: E501 + class MetaOapg: + required = { + "className", } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'type': 'type', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501 - """Zebra - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """Zebra - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.class_name = class_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + class properties: + + + class className( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "zebra": "ZEBRA", + } + + @schemas.classproperty + def ZEBRA(cls): + return cls("zebra") + + + class type( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "plains": "PLAINS", + "mountain": "MOUNTAIN", + "grevys": "GREVYS", + } + + @schemas.classproperty + def PLAINS(cls): + return cls("plains") + + @schemas.classproperty + def MOUNTAIN(cls): + return cls("mountain") + + @schemas.classproperty + def GREVYS(cls): + return cls("grevys") + __annotations__ = { + "className": className, + "type": type, + } + additional_properties = schemas.AnyTypeSchema + + className: MetaOapg.properties.className + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["type"]) -> MetaOapg.properties.type: ... + + @typing.overload + def __getitem__(self, name: str) -> MetaOapg.additional_properties: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["className"], typing_extensions.Literal["type"], str, ]): + # dict_instance[name] accessor + return super().__getitem__(name) + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["className"]) -> MetaOapg.properties.className: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["type"]) -> typing.Union[MetaOapg.properties.type, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[MetaOapg.additional_properties, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["className"], typing_extensions.Literal["type"], str, ]): + return super().get_item_oapg(name) + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + className: typing.Union[MetaOapg.properties.className, str, ], + type: typing.Union[MetaOapg.properties.type, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + ) -> 'Zebra': + return super().__new__( + cls, + *args, + className=className, + type=type, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/zebra.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.pyi rename to samples/openapi3/client/petstore/python/petstore_api/model/zebra.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py index dd8afc1d8bf5..0518982ad969 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py @@ -1,3 +1,5 @@ +# coding: utf-8 + # flake8: noqa # import all models into this package @@ -10,37 +12,51 @@ # sys.setrecursionlimit(n) from petstore_api.model.additional_properties_class import AdditionalPropertiesClass +from petstore_api.model.additional_properties_validator import AdditionalPropertiesValidator from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums from petstore_api.model.address import Address from petstore_api.model.animal import Animal from petstore_api.model.animal_farm import AnimalFarm +from petstore_api.model.any_type_and_format import AnyTypeAndFormat +from petstore_api.model.any_type_not_string import AnyTypeNotString from petstore_api.model.api_response import ApiResponse from petstore_api.model.apple import Apple from petstore_api.model.apple_req import AppleReq +from petstore_api.model.array_holding_any_type import ArrayHoldingAnyType from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly from petstore_api.model.array_of_enums import ArrayOfEnums from petstore_api.model.array_of_number_only import ArrayOfNumberOnly from petstore_api.model.array_test import ArrayTest +from petstore_api.model.array_with_validations_in_items import ArrayWithValidationsInItems from petstore_api.model.banana import Banana from petstore_api.model.banana_req import BananaReq +from petstore_api.model.bar import Bar from petstore_api.model.basque_pig import BasquePig +from petstore_api.model.boolean import Boolean from petstore_api.model.boolean_enum import BooleanEnum from petstore_api.model.capitalization import Capitalization from petstore_api.model.cat import Cat -from petstore_api.model.cat_all_of import CatAllOf from petstore_api.model.category import Category from petstore_api.model.child_cat import ChildCat -from petstore_api.model.child_cat_all_of import ChildCatAllOf from petstore_api.model.class_model import ClassModel from petstore_api.model.client import Client from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral -from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations -from petstore_api.model.composed_schema_with_props_and_no_add_props import ComposedSchemaWithPropsAndNoAddProps +from petstore_api.model.composed_any_of_different_types_no_validations import ComposedAnyOfDifferentTypesNoValidations +from petstore_api.model.composed_array import ComposedArray +from petstore_api.model.composed_bool import ComposedBool +from petstore_api.model.composed_none import ComposedNone +from petstore_api.model.composed_number import ComposedNumber +from petstore_api.model.composed_object import ComposedObject +from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes +from petstore_api.model.composed_string import ComposedString +from petstore_api.model.currency import Currency from petstore_api.model.danish_pig import DanishPig +from petstore_api.model.date_time_test import DateTimeTest +from petstore_api.model.date_time_with_validations import DateTimeWithValidations +from petstore_api.model.date_with_validations import DateWithValidations +from petstore_api.model.decimal_payload import DecimalPayload from petstore_api.model.dog import Dog -from petstore_api.model.dog_all_of import DogAllOf from petstore_api.model.drawing import Drawing -from petstore_api.model.egress_threshold_options import EgressThresholdOptions from petstore_api.model.enum_arrays import EnumArrays from petstore_api.model.enum_class import EnumClass from petstore_api.model.enum_test import EnumTest @@ -48,64 +64,67 @@ from petstore_api.model.file import File from petstore_api.model.file_schema_test_class import FileSchemaTestClass from petstore_api.model.foo import Foo -from petstore_api.model.foo_get_default_response import FooGetDefaultResponse -from petstore_api.model.foo_object import FooObject from petstore_api.model.format_test import FormatTest from petstore_api.model.fruit import Fruit from petstore_api.model.fruit_req import FruitReq from petstore_api.model.gm_fruit import GmFruit -from petstore_api.model.gm_fruit_no_properties import GmFruitNoProperties from petstore_api.model.grandparent_animal import GrandparentAnimal from petstore_api.model.has_only_read_only import HasOnlyReadOnly from petstore_api.model.health_check_result import HealthCheckResult -from petstore_api.model.inline_additional_properties_ref_payload import InlineAdditionalPropertiesRefPayload from petstore_api.model.integer_enum import IntegerEnum +from petstore_api.model.integer_enum_big import IntegerEnumBig from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue +from petstore_api.model.integer_max10 import IntegerMax10 +from petstore_api.model.integer_min15 import IntegerMin15 from petstore_api.model.isosceles_triangle import IsoscelesTriangle -from petstore_api.model.legs import Legs -from petstore_api.model.list import List +from petstore_api.model.json_patch_request import JSONPatchRequest +from petstore_api.model.json_patch_request_add_replace_test import JSONPatchRequestAddReplaceTest +from petstore_api.model.json_patch_request_move_copy import JSONPatchRequestMoveCopy +from petstore_api.model.json_patch_request_remove import JSONPatchRequestRemove from petstore_api.model.mammal import Mammal from petstore_api.model.map_test import MapTest from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass from petstore_api.model.model200_response import Model200Response from petstore_api.model.model_return import ModelReturn -from petstore_api.model.mole import Mole +from petstore_api.model.money import Money from petstore_api.model.name import Name +from petstore_api.model.no_additional_properties import NoAdditionalProperties from petstore_api.model.nullable_class import NullableClass from petstore_api.model.nullable_shape import NullableShape +from petstore_api.model.nullable_string import NullableString +from petstore_api.model.number import Number from petstore_api.model.number_only import NumberOnly from petstore_api.model.number_with_validations import NumberWithValidations from petstore_api.model.object_interface import ObjectInterface from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps +from petstore_api.model.object_with_decimal_properties import ObjectWithDecimalProperties +from petstore_api.model.object_with_difficultly_named_props import ObjectWithDifficultlyNamedProps +from petstore_api.model.object_with_inline_composition_property import ObjectWithInlineCompositionProperty from petstore_api.model.object_with_validations import ObjectWithValidations from petstore_api.model.order import Order from petstore_api.model.parent_pet import ParentPet from petstore_api.model.pet import Pet from petstore_api.model.pig import Pig -from petstore_api.model.post_inline_additional_properties_payload_request import PostInlineAdditionalPropertiesPayloadRequest -from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner -from petstore_api.model.publish_options import PublishOptions -from petstore_api.model.publish_options_publish import PublishOptionsPublish +from petstore_api.model.player import Player from petstore_api.model.quadrilateral import Quadrilateral from petstore_api.model.quadrilateral_interface import QuadrilateralInterface from petstore_api.model.read_only_first import ReadOnlyFirst -from petstore_api.model.readonly import Readonly from petstore_api.model.scalene_triangle import ScaleneTriangle from petstore_api.model.shape import Shape -from petstore_api.model.shape_interface import ShapeInterface from petstore_api.model.shape_or_null import ShapeOrNull from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral from petstore_api.model.some_object import SomeObject -from petstore_api.model.some_object_with_self_attr import SomeObjectWithSelfAttr from petstore_api.model.special_model_name import SpecialModelName -from petstore_api.model.stream_options import StreamOptions +from petstore_api.model.string import String from petstore_api.model.string_boolean_map import StringBooleanMap from petstore_api.model.string_enum import StringEnum from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue +from petstore_api.model.string_with_validation import StringWithValidation from petstore_api.model.tag import Tag from petstore_api.model.triangle import Triangle from petstore_api.model.triangle_interface import TriangleInterface +from petstore_api.model.uuid_string import UUIDString from petstore_api.model.user import User from petstore_api.model.whale import Whale from petstore_api.model.zebra import Zebra diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/another_fake_dummy/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/another_fake_dummy/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/another_fake_dummy/patch.py b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/another_fake_dummy/patch.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/another_fake_dummy/patch.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/another_fake_dummy/patch.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/delete.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/delete.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/delete.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/delete.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/get.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake/get.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/get.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake/get.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/patch.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/patch.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/patch.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/patch.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_additional_properties_with_array_of_enums/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_additional_properties_with_array_of_enums/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_file_schema/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_file_schema/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_file_schema/put.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_file_schema/put.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_file_schema/put.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_file_schema/put.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_query_params/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_query_params/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_query_params/put.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_query_params/put.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_query_params/put.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_body_with_query_params/put.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_case_sensitive_params/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_case_sensitive_params/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_case_sensitive_params/put.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_case_sensitive_params/put.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_case_sensitive_params/put.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_case_sensitive_params/put.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_classname_test/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_classname_test/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_classname_test/patch.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_classname_test/patch.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_classname_test/patch.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_classname_test/patch.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_delete_coffee_id/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_delete_coffee_id/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_delete_coffee_id/delete.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_delete_coffee_id/delete.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_delete_coffee_id/delete.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_delete_coffee_id/delete.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_health/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_health/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_health/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_health/get.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_health/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_health/get.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_additional_properties/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_additional_properties/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_additional_properties/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_additional_properties/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_additional_properties/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_additional_properties/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_composition_/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_composition_/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_composition_/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_composition_/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_composition_/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_inline_composition_/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_form_data/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_form_data/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_form_data/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_form_data/get.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_form_data/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_form_data/get.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_patch/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_patch/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_patch/patch.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_patch/patch.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_patch/patch.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_patch/patch.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_with_charset/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_with_charset/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_with_charset/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_with_charset/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_with_charset/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_json_with_charset/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_obj_in_query/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_obj_in_query/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_obj_in_query/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_obj_in_query/get.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_obj_in_query/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_obj_in_query/get.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_pet_id_upload_image_with_required_file/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_pet_id_upload_image_with_required_file/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_ref_obj_in_query/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_ref_obj_in_query/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_ref_obj_in_query/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_ref_obj_in_query/get.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_ref_obj_in_query/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_ref_obj_in_query/get.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_array_of_enums/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_array_of_enums/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_array_of_enums/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_array_of_enums/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_array_of_enums/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_array_of_enums/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_arraymodel/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_arraymodel/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_arraymodel/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_arraymodel/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_arraymodel/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_arraymodel/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_boolean/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_boolean/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_boolean/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_boolean/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_boolean/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_boolean/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_enum/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_enum/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_enum/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_enum/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_enum/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_enum/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_mammal/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_mammal/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_mammal/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_mammal/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_mammal/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_mammal/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_number/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_number/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_number/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_number/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_number/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_number/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_object_model_with_ref_props/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_object_model_with_ref_props/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_object_model_with_ref_props/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_object_model_with_ref_props/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_object_model_with_ref_props/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_object_model_with_ref_props/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_string/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_string/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_string/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_string/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_string/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_refs_string/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_response_without_schema/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_response_without_schema/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_response_without_schema/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_response_without_schema/get.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_response_without_schema/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_response_without_schema/get.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_test_query_paramters/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_test_query_paramters/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_test_query_paramters/put.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_test_query_paramters/put.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_test_query_paramters/put.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_test_query_paramters/put.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_download_file/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_download_file/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_download_file/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_download_file/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_download_file/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_download_file/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_file/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_file/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_file/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_file/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_file/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_file/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_files/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_files/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_files/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_files/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_files/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/fake_upload_files/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/foo/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/foo/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/foo/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/foo/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/foo/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/foo/get.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/foo/get.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/foo/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/foo/get.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/foo/get.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet/put.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet/put.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet/put.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet/put.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet/put.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet/put.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_status/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_status/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_status/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_status/get.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_status/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_status/get.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_tags/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_tags/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_tags/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_tags/get.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_tags/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_find_by_tags/get.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/delete.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/delete.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/delete.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/delete.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/get.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/get.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_upload_image/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_upload_image/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_upload_image/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_upload_image/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_upload_image/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/pet_pet_id_upload_image/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_inventory/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_inventory/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_inventory/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_inventory/get.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_inventory/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_inventory/get.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/store_order/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id/delete.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id/delete.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id/delete.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id/delete.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id/get.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/store_order_order_id/get.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/user/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/user/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/user/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_array/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_array/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_array/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_array/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_array/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_array/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_list/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_list/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_list/post.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_list/post.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_list/post.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_create_with_list/post.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_login/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_login/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_login/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_login/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_login/get.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_login/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_login/get.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_logout/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_logout/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_logout/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_logout/get.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_logout/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_logout/get.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/__init__.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_username/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/delete.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/delete.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/delete.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/delete.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/get.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/get.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get.pyi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/put.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/put.py rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/put.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put.pyi similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/paths/user_username/put.pyi rename to samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put.pyi diff --git a/samples/openapi3/client/petstore/python/petstore_api/rest.py b/samples/openapi3/client/petstore/python/petstore_api/rest.py index 8ec610c5cc62..40e35989f9af 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/rest.py +++ b/samples/openapi3/client/petstore/python/petstore_api/rest.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,41 +9,21 @@ Generated by: https://openapi-generator.tech """ - -import io -import json import logging -import re import ssl from urllib.parse import urlencode -from urllib.parse import urlparse -from urllib.request import proxy_bypass_environment +import typing + +import certifi import urllib3 -import ipaddress +from urllib3._collections import HTTPHeaderDict -from petstore_api.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError +from petstore_api.exceptions import ApiException, 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): @@ -57,6 +39,13 @@ def __init__(self, configuration, pools_size=4, maxsize=None): else: cert_reqs = ssl.CERT_NONE + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + addition_pool_args = {} if configuration.assert_hostname is not None: addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 @@ -74,13 +63,12 @@ def __init__(self, configuration, pools_size=4, maxsize=None): maxsize = 4 # https pool manager - if configuration.proxy and not should_bypass_proxies( - configuration.host, no_proxy=configuration.no_proxy or ''): + if configuration.proxy: self.pool_manager = urllib3.ProxyManager( num_pools=pools_size, maxsize=maxsize, cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, + ca_certs=ca_certs, cert_file=configuration.cert_file, key_file=configuration.key_file, proxy_url=configuration.proxy, @@ -92,79 +80,75 @@ def __init__(self, configuration, pools_size=4, maxsize=None): num_pools=pools_size, maxsize=maxsize, cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, + ca_certs=ca_certs, 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): + def request( + self, + method: str, + url: str, + headers: typing.Optional[HTTPHeaderDict] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, typing.Any], ...]] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: """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. + :param body: request body, for other types + :param fields: request parameters for + `application/x-www-form-urlencoded` + or `multipart/form-data` + :param stream: if True, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is False. + :param 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: + if fields and body: raise ApiValueError( - "body parameter cannot be used with post_params parameter." + "body parameter cannot be used with fields parameter." ) - post_params = post_params or {} + fields = fields or {} headers = headers or {} - 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]) + if timeout: + if isinstance(timeout, (int, float)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=timeout) + elif (isinstance(timeout, tuple) and + len(timeout) == 2): + timeout = urllib3.Timeout(connect=timeout[0], read=timeout[1]) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != 'DELETE') and ('Content-Type' not in headers): - headers['Content-Type'] = 'application/json' - if query_params: - url += '?' + urlencode(query_params) - if ('Content-Type' not in headers) or (re.search('json', - headers['Content-Type'], re.IGNORECASE)): - request_body = None - if body is not None: - request_body = json.dumps(body) + if 'Content-Type' not in headers and body is None: r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, + method, + url, + preload_content=not stream, timeout=timeout, - headers=headers) + headers=headers + ) elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 r = self.pool_manager.request( method, url, - fields=post_params, + fields=fields, encode_multipart=False, - preload_content=_preload_content, + preload_content=not stream, timeout=timeout, headers=headers) elif headers['Content-Type'] == 'multipart/form-data': @@ -174,9 +158,9 @@ def request(self, method, url, query_params=None, headers=None, del headers['Content-Type'] r = self.pool_manager.request( method, url, - fields=post_params, + fields=fields, encode_multipart=True, - preload_content=_preload_content, + preload_content=not stream, timeout=timeout, headers=headers) # Pass a `string` parameter directly in the body to support @@ -187,7 +171,7 @@ def request(self, method, url, query_params=None, headers=None, r = self.pool_manager.request( method, url, body=request_body, - preload_content=_preload_content, + preload_content=not stream, timeout=timeout, headers=headers) else: @@ -199,154 +183,71 @@ def request(self, method, url, query_params=None, headers=None, # For `GET`, `HEAD` else: r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, + preload_content=not stream, 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) - + if not stream: # 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(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): + def GET(self, url, headers=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: return self.request("GET", url, headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) + stream=stream, + timeout=timeout, + fields=fields) - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): + def HEAD(self, url, headers=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: return self.request("HEAD", url, headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) + stream=stream, + timeout=timeout, + fields=fields) - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): + def OPTIONS(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: 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(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def DELETE(self, url, headers=None, body=None, + stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: return self.request("DELETE", url, headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + stream=stream, + timeout=timeout, + body=body, fields=fields) - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): + def POST(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: 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(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def PUT(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: 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(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def PATCH(self, url, headers=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: 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) - -# end of class RESTClientObject - - -def is_ipv4(target): - """ Test if IPv4 address or not - """ - try: - chk = ipaddress.IPv4Address(target) - return True - except ipaddress.AddressValueError: - return False - - -def in_ipv4net(target, net): - """ Test if target belongs to given IPv4 network - """ - try: - nw = ipaddress.IPv4Network(net) - ip = ipaddress.IPv4Address(target) - if ip in nw: - return True - return False - except ipaddress.AddressValueError: - return False - except ipaddress.NetmaskValueError: - return False - - -def should_bypass_proxies(url, no_proxy=None): - """ Yet another requests.should_bypass_proxies - Test if proxies should not be used for a particular url. - """ - - parsed = urlparse(url) - - # special cases - if parsed.hostname in [None, '']: - return True - - # special cases - if no_proxy in [None, '']: - return False - if no_proxy == '*': - return True - - no_proxy = no_proxy.lower().replace(' ', ''); - entries = ( - host for host in no_proxy.split(',') if host - ) - - if is_ipv4(parsed.hostname): - for item in entries: - if in_ipv4net(parsed.hostname, item): - return True - return proxy_bypass_environment(parsed.hostname, {'no': no_proxy}) + stream=stream, + timeout=timeout, + body=body, fields=fields) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py b/samples/openapi3/client/petstore/python/petstore_api/schemas.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py rename to samples/openapi3/client/petstore/python/petstore_api/schemas.py diff --git a/samples/openapi3/client/petstore/python/petstore_api/signing.py b/samples/openapi3/client/petstore/python/petstore_api/signing.py index 4ea7d8f779eb..22b3bf2bf1d4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/signing.py +++ b/samples/openapi3/client/petstore/python/petstore_api/signing.py @@ -1,3 +1,4 @@ +# coding: utf-8 """ OpenAPI Petstore @@ -7,7 +8,6 @@ Generated by: https://openapi-generator.tech """ - from base64 import b64encode from Crypto.IO import PEM, PKCS8 from Crypto.Hash import SHA256, SHA512 @@ -341,7 +341,7 @@ def _get_message_digest(self, data): :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 + The prefix is a string that identifies the cryptographc hash. It is used to generate the 'Digest' header as specified in RFC 3230. """ if self.hash_algorithm == HASH_SHA512: diff --git a/samples/openapi3/client/petstore/python/pom.xml b/samples/openapi3/client/petstore/python/pom.xml index e7d7d9caf133..7e737c361115 100644 --- a/samples/openapi3/client/petstore/python/pom.xml +++ b/samples/openapi3/client/petstore/python/pom.xml @@ -1,10 +1,10 @@ 4.0.0 org.openapitools - PythonOAS3PetstoreTests + PythonExperimentalOAS3PetstoreTests pom 1.0-SNAPSHOT - Python OpenAPI3 Petstore Client + Python Experimental OpenAPI3 Petstore Client @@ -43,4 +43,4 @@ - + \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/requirements.txt b/samples/openapi3/client/petstore/python/requirements.txt index 96947f60408f..c9227e58a1be 100644 --- a/samples/openapi3/client/petstore/python/requirements.txt +++ b/samples/openapi3/client/petstore/python/requirements.txt @@ -1,3 +1,5 @@ +certifi >= 14.05.14 +frozendict >= 2.0.3 python_dateutil >= 2.5.3 setuptools >= 21.0.0 -urllib3 >= 1.25.3 +urllib3 >= 1.15.1 diff --git a/samples/openapi3/client/petstore/python/setup.py b/samples/openapi3/client/petstore/python/setup.py index 0fdf98480629..2acc6c1cf2ba 100644 --- a/samples/openapi3/client/petstore/python/setup.py +++ b/samples/openapi3/client/petstore/python/setup.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -7,7 +9,6 @@ Generated by: https://openapi-generator.tech """ - from setuptools import setup, find_packages # noqa: H301 NAME = "petstore-api" @@ -20,10 +21,13 @@ # http://pypi.python.org/pypi/setuptools REQUIRES = [ - "urllib3 >= 1.25.3", + "urllib3 >= 1.15", + "certifi", "python-dateutil", + "frozendict >= 2.0.3", "pem>=19.3.0", "pycryptodome>=3.9.0", + "typing_extensions", ] setup( @@ -34,7 +38,7 @@ author_email="team@openapitools.org", url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], - python_requires=">=3.6", + python_requires=">=3.7", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, diff --git a/samples/openapi3/client/petstore/python/test-requirements.txt b/samples/openapi3/client/petstore/python/test-requirements.txt index 4b3736d983e6..36d9b4fa7a8c 100644 --- a/samples/openapi3/client/petstore/python/test-requirements.txt +++ b/samples/openapi3/client/petstore/python/test-requirements.txt @@ -1,2 +1,4 @@ +pytest~=4.6.7 # needed for python 3.4 pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 3.4 pycryptodome>=3.9.0 diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_body_with_file_schema/__init__.py b/samples/openapi3/client/petstore/python/test/test_models/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_body_with_file_schema/__init__.py rename to samples/openapi3/client/petstore/python/test/test_models/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_additional_properties_class.py b/samples/openapi3/client/petstore/python/test/test_models/test_additional_properties_class.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_additional_properties_class.py rename to samples/openapi3/client/petstore/python/test/test_models/test_additional_properties_class.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_additional_properties_validator.py b/samples/openapi3/client/petstore/python/test/test_models/test_additional_properties_validator.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_additional_properties_validator.py rename to samples/openapi3/client/petstore/python/test/test_models/test_additional_properties_validator.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python/test/test_models/test_additional_properties_with_array_of_enums.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_additional_properties_with_array_of_enums.py rename to samples/openapi3/client/petstore/python/test/test_models/test_additional_properties_with_array_of_enums.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_address.py b/samples/openapi3/client/petstore/python/test/test_models/test_address.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_address.py rename to samples/openapi3/client/petstore/python/test/test_models/test_address.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_animal.py b/samples/openapi3/client/petstore/python/test/test_models/test_animal.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_animal.py rename to samples/openapi3/client/petstore/python/test/test_models/test_animal.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_animal_farm.py b/samples/openapi3/client/petstore/python/test/test_models/test_animal_farm.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_animal_farm.py rename to samples/openapi3/client/petstore/python/test/test_models/test_animal_farm.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_any_type_and_format.py b/samples/openapi3/client/petstore/python/test/test_models/test_any_type_and_format.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_any_type_and_format.py rename to samples/openapi3/client/petstore/python/test/test_models/test_any_type_and_format.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_any_type_not_string.py b/samples/openapi3/client/petstore/python/test/test_models/test_any_type_not_string.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_any_type_not_string.py rename to samples/openapi3/client/petstore/python/test/test_models/test_any_type_not_string.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_api_response.py b/samples/openapi3/client/petstore/python/test/test_models/test_api_response.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_api_response.py rename to samples/openapi3/client/petstore/python/test/test_models/test_api_response.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_apple.py b/samples/openapi3/client/petstore/python/test/test_models/test_apple.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_apple.py rename to samples/openapi3/client/petstore/python/test/test_models/test_apple.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_apple_req.py b/samples/openapi3/client/petstore/python/test/test_models/test_apple_req.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_apple_req.py rename to samples/openapi3/client/petstore/python/test/test_models/test_apple_req.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_array_holding_any_type.py b/samples/openapi3/client/petstore/python/test/test_models/test_array_holding_any_type.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_array_holding_any_type.py rename to samples/openapi3/client/petstore/python/test/test_models/test_array_holding_any_type.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python/test/test_models/test_array_of_array_of_number_only.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_array_of_array_of_number_only.py rename to samples/openapi3/client/petstore/python/test/test_models/test_array_of_array_of_number_only.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_array_of_enums.py b/samples/openapi3/client/petstore/python/test/test_models/test_array_of_enums.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_array_of_enums.py rename to samples/openapi3/client/petstore/python/test/test_models/test_array_of_enums.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_array_of_number_only.py b/samples/openapi3/client/petstore/python/test/test_models/test_array_of_number_only.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_array_of_number_only.py rename to samples/openapi3/client/petstore/python/test/test_models/test_array_of_number_only.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_array_test.py b/samples/openapi3/client/petstore/python/test/test_models/test_array_test.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_array_test.py rename to samples/openapi3/client/petstore/python/test/test_models/test_array_test.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_array_with_validations_in_items.py b/samples/openapi3/client/petstore/python/test/test_models/test_array_with_validations_in_items.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_array_with_validations_in_items.py rename to samples/openapi3/client/petstore/python/test/test_models/test_array_with_validations_in_items.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_banana.py b/samples/openapi3/client/petstore/python/test/test_models/test_banana.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_banana.py rename to samples/openapi3/client/petstore/python/test/test_models/test_banana.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_banana_req.py b/samples/openapi3/client/petstore/python/test/test_models/test_banana_req.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_banana_req.py rename to samples/openapi3/client/petstore/python/test/test_models/test_banana_req.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_bar.py b/samples/openapi3/client/petstore/python/test/test_models/test_bar.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_bar.py rename to samples/openapi3/client/petstore/python/test/test_models/test_bar.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_basque_pig.py b/samples/openapi3/client/petstore/python/test/test_models/test_basque_pig.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_basque_pig.py rename to samples/openapi3/client/petstore/python/test/test_models/test_basque_pig.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_boolean.py b/samples/openapi3/client/petstore/python/test/test_models/test_boolean.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_boolean.py rename to samples/openapi3/client/petstore/python/test/test_models/test_boolean.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_boolean_enum.py b/samples/openapi3/client/petstore/python/test/test_models/test_boolean_enum.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_boolean_enum.py rename to samples/openapi3/client/petstore/python/test/test_models/test_boolean_enum.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_capitalization.py b/samples/openapi3/client/petstore/python/test/test_models/test_capitalization.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_capitalization.py rename to samples/openapi3/client/petstore/python/test/test_models/test_capitalization.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_cat.py b/samples/openapi3/client/petstore/python/test/test_models/test_cat.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_cat.py rename to samples/openapi3/client/petstore/python/test/test_models/test_cat.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_category.py b/samples/openapi3/client/petstore/python/test/test_models/test_category.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_category.py rename to samples/openapi3/client/petstore/python/test/test_models/test_category.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_child_cat.py b/samples/openapi3/client/petstore/python/test/test_models/test_child_cat.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_child_cat.py rename to samples/openapi3/client/petstore/python/test/test_models/test_child_cat.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_class_model.py b/samples/openapi3/client/petstore/python/test/test_models/test_class_model.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_class_model.py rename to samples/openapi3/client/petstore/python/test/test_models/test_class_model.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_client.py b/samples/openapi3/client/petstore/python/test/test_models/test_client.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_client.py rename to samples/openapi3/client/petstore/python/test/test_models/test_client.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_complex_quadrilateral.py b/samples/openapi3/client/petstore/python/test/test_models/test_complex_quadrilateral.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_complex_quadrilateral.py rename to samples/openapi3/client/petstore/python/test/test_models/test_complex_quadrilateral.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_composed_any_of_different_types_no_validations.py b/samples/openapi3/client/petstore/python/test/test_models/test_composed_any_of_different_types_no_validations.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_composed_any_of_different_types_no_validations.py rename to samples/openapi3/client/petstore/python/test/test_models/test_composed_any_of_different_types_no_validations.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_composed_array.py b/samples/openapi3/client/petstore/python/test/test_models/test_composed_array.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_composed_array.py rename to samples/openapi3/client/petstore/python/test/test_models/test_composed_array.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_composed_bool.py b/samples/openapi3/client/petstore/python/test/test_models/test_composed_bool.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_composed_bool.py rename to samples/openapi3/client/petstore/python/test/test_models/test_composed_bool.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_composed_none.py b/samples/openapi3/client/petstore/python/test/test_models/test_composed_none.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_composed_none.py rename to samples/openapi3/client/petstore/python/test/test_models/test_composed_none.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_composed_number.py b/samples/openapi3/client/petstore/python/test/test_models/test_composed_number.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_composed_number.py rename to samples/openapi3/client/petstore/python/test/test_models/test_composed_number.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_composed_object.py b/samples/openapi3/client/petstore/python/test/test_models/test_composed_object.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_composed_object.py rename to samples/openapi3/client/petstore/python/test/test_models/test_composed_object.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_composed_one_of_different_types.py b/samples/openapi3/client/petstore/python/test/test_models/test_composed_one_of_different_types.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_composed_one_of_different_types.py rename to samples/openapi3/client/petstore/python/test/test_models/test_composed_one_of_different_types.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_composed_string.py b/samples/openapi3/client/petstore/python/test/test_models/test_composed_string.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_composed_string.py rename to samples/openapi3/client/petstore/python/test/test_models/test_composed_string.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_currency.py b/samples/openapi3/client/petstore/python/test/test_models/test_currency.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_currency.py rename to samples/openapi3/client/petstore/python/test/test_models/test_currency.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_danish_pig.py b/samples/openapi3/client/petstore/python/test/test_models/test_danish_pig.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_danish_pig.py rename to samples/openapi3/client/petstore/python/test/test_models/test_danish_pig.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_date_time_test.py b/samples/openapi3/client/petstore/python/test/test_models/test_date_time_test.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_date_time_test.py rename to samples/openapi3/client/petstore/python/test/test_models/test_date_time_test.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_date_time_with_validations.py b/samples/openapi3/client/petstore/python/test/test_models/test_date_time_with_validations.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_date_time_with_validations.py rename to samples/openapi3/client/petstore/python/test/test_models/test_date_time_with_validations.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_date_with_validations.py b/samples/openapi3/client/petstore/python/test/test_models/test_date_with_validations.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_date_with_validations.py rename to samples/openapi3/client/petstore/python/test/test_models/test_date_with_validations.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_decimal_payload.py b/samples/openapi3/client/petstore/python/test/test_models/test_decimal_payload.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_decimal_payload.py rename to samples/openapi3/client/petstore/python/test/test_models/test_decimal_payload.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_dog.py b/samples/openapi3/client/petstore/python/test/test_models/test_dog.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_dog.py rename to samples/openapi3/client/petstore/python/test/test_models/test_dog.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_drawing.py b/samples/openapi3/client/petstore/python/test/test_models/test_drawing.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_drawing.py rename to samples/openapi3/client/petstore/python/test/test_models/test_drawing.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_enum_arrays.py b/samples/openapi3/client/petstore/python/test/test_models/test_enum_arrays.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_enum_arrays.py rename to samples/openapi3/client/petstore/python/test/test_models/test_enum_arrays.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_enum_class.py b/samples/openapi3/client/petstore/python/test/test_models/test_enum_class.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_enum_class.py rename to samples/openapi3/client/petstore/python/test/test_models/test_enum_class.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_enum_test.py b/samples/openapi3/client/petstore/python/test/test_models/test_enum_test.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_enum_test.py rename to samples/openapi3/client/petstore/python/test/test_models/test_enum_test.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_equilateral_triangle.py b/samples/openapi3/client/petstore/python/test/test_models/test_equilateral_triangle.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_equilateral_triangle.py rename to samples/openapi3/client/petstore/python/test/test_models/test_equilateral_triangle.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_file.py b/samples/openapi3/client/petstore/python/test/test_models/test_file.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_file.py rename to samples/openapi3/client/petstore/python/test/test_models/test_file.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python/test/test_models/test_file_schema_test_class.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_file_schema_test_class.py rename to samples/openapi3/client/petstore/python/test/test_models/test_file_schema_test_class.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_foo.py b/samples/openapi3/client/petstore/python/test/test_models/test_foo.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_foo.py rename to samples/openapi3/client/petstore/python/test/test_models/test_foo.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_format_test.py b/samples/openapi3/client/petstore/python/test/test_models/test_format_test.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_format_test.py rename to samples/openapi3/client/petstore/python/test/test_models/test_format_test.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_fruit.py b/samples/openapi3/client/petstore/python/test/test_models/test_fruit.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_fruit.py rename to samples/openapi3/client/petstore/python/test/test_models/test_fruit.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_fruit_req.py b/samples/openapi3/client/petstore/python/test/test_models/test_fruit_req.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_fruit_req.py rename to samples/openapi3/client/petstore/python/test/test_models/test_fruit_req.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_gm_fruit.py b/samples/openapi3/client/petstore/python/test/test_models/test_gm_fruit.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_gm_fruit.py rename to samples/openapi3/client/petstore/python/test/test_models/test_gm_fruit.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_grandparent_animal.py b/samples/openapi3/client/petstore/python/test/test_models/test_grandparent_animal.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_grandparent_animal.py rename to samples/openapi3/client/petstore/python/test/test_models/test_grandparent_animal.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_has_only_read_only.py b/samples/openapi3/client/petstore/python/test/test_models/test_has_only_read_only.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_has_only_read_only.py rename to samples/openapi3/client/petstore/python/test/test_models/test_has_only_read_only.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_health_check_result.py b/samples/openapi3/client/petstore/python/test/test_models/test_health_check_result.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_health_check_result.py rename to samples/openapi3/client/petstore/python/test/test_models/test_health_check_result.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_integer_enum.py b/samples/openapi3/client/petstore/python/test/test_models/test_integer_enum.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_integer_enum.py rename to samples/openapi3/client/petstore/python/test/test_models/test_integer_enum.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_integer_enum_big.py b/samples/openapi3/client/petstore/python/test/test_models/test_integer_enum_big.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_integer_enum_big.py rename to samples/openapi3/client/petstore/python/test/test_models/test_integer_enum_big.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_integer_enum_one_value.py b/samples/openapi3/client/petstore/python/test/test_models/test_integer_enum_one_value.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_integer_enum_one_value.py rename to samples/openapi3/client/petstore/python/test/test_models/test_integer_enum_one_value.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python/test/test_models/test_integer_enum_with_default_value.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_integer_enum_with_default_value.py rename to samples/openapi3/client/petstore/python/test/test_models/test_integer_enum_with_default_value.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_integer_max10.py b/samples/openapi3/client/petstore/python/test/test_models/test_integer_max10.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_integer_max10.py rename to samples/openapi3/client/petstore/python/test/test_models/test_integer_max10.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_integer_min15.py b/samples/openapi3/client/petstore/python/test/test_models/test_integer_min15.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_integer_min15.py rename to samples/openapi3/client/petstore/python/test/test_models/test_integer_min15.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_isosceles_triangle.py b/samples/openapi3/client/petstore/python/test/test_models/test_isosceles_triangle.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_isosceles_triangle.py rename to samples/openapi3/client/petstore/python/test/test_models/test_isosceles_triangle.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_json_patch_request.py b/samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_json_patch_request.py rename to samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_json_patch_request_add_replace_test.py b/samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request_add_replace_test.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_json_patch_request_add_replace_test.py rename to samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request_add_replace_test.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_json_patch_request_move_copy.py b/samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request_move_copy.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_json_patch_request_move_copy.py rename to samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request_move_copy.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_json_patch_request_remove.py b/samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request_remove.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_json_patch_request_remove.py rename to samples/openapi3/client/petstore/python/test/test_models/test_json_patch_request_remove.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_mammal.py b/samples/openapi3/client/petstore/python/test/test_models/test_mammal.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_mammal.py rename to samples/openapi3/client/petstore/python/test/test_models/test_mammal.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_map_test.py b/samples/openapi3/client/petstore/python/test/test_models/test_map_test.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_map_test.py rename to samples/openapi3/client/petstore/python/test/test_models/test_map_test.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python/test/test_models/test_mixed_properties_and_additional_properties_class.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_mixed_properties_and_additional_properties_class.py rename to samples/openapi3/client/petstore/python/test/test_models/test_mixed_properties_and_additional_properties_class.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_model200_response.py b/samples/openapi3/client/petstore/python/test/test_models/test_model200_response.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_model200_response.py rename to samples/openapi3/client/petstore/python/test/test_models/test_model200_response.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_model_return.py b/samples/openapi3/client/petstore/python/test/test_models/test_model_return.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_model_return.py rename to samples/openapi3/client/petstore/python/test/test_models/test_model_return.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_money.py b/samples/openapi3/client/petstore/python/test/test_models/test_money.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_money.py rename to samples/openapi3/client/petstore/python/test/test_models/test_money.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_name.py b/samples/openapi3/client/petstore/python/test/test_models/test_name.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_name.py rename to samples/openapi3/client/petstore/python/test/test_models/test_name.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_no_additional_properties.py b/samples/openapi3/client/petstore/python/test/test_models/test_no_additional_properties.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_no_additional_properties.py rename to samples/openapi3/client/petstore/python/test/test_models/test_no_additional_properties.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_nullable_class.py b/samples/openapi3/client/petstore/python/test/test_models/test_nullable_class.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_nullable_class.py rename to samples/openapi3/client/petstore/python/test/test_models/test_nullable_class.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_nullable_shape.py b/samples/openapi3/client/petstore/python/test/test_models/test_nullable_shape.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_nullable_shape.py rename to samples/openapi3/client/petstore/python/test/test_models/test_nullable_shape.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_nullable_string.py b/samples/openapi3/client/petstore/python/test/test_models/test_nullable_string.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_nullable_string.py rename to samples/openapi3/client/petstore/python/test/test_models/test_nullable_string.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_number.py b/samples/openapi3/client/petstore/python/test/test_models/test_number.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_number.py rename to samples/openapi3/client/petstore/python/test/test_models/test_number.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_number_only.py b/samples/openapi3/client/petstore/python/test/test_models/test_number_only.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_number_only.py rename to samples/openapi3/client/petstore/python/test/test_models/test_number_only.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_number_with_validations.py b/samples/openapi3/client/petstore/python/test/test_models/test_number_with_validations.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_number_with_validations.py rename to samples/openapi3/client/petstore/python/test/test_models/test_number_with_validations.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_object_interface.py b/samples/openapi3/client/petstore/python/test/test_models/test_object_interface.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_object_interface.py rename to samples/openapi3/client/petstore/python/test/test_models/test_object_interface.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python/test/test_models/test_object_model_with_ref_props.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_object_model_with_ref_props.py rename to samples/openapi3/client/petstore/python/test/test_models/test_object_model_with_ref_props.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_object_with_decimal_properties.py b/samples/openapi3/client/petstore/python/test/test_models/test_object_with_decimal_properties.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_object_with_decimal_properties.py rename to samples/openapi3/client/petstore/python/test/test_models/test_object_with_decimal_properties.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python/test/test_models/test_object_with_difficultly_named_props.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_object_with_difficultly_named_props.py rename to samples/openapi3/client/petstore/python/test/test_models/test_object_with_difficultly_named_props.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_object_with_inline_composition_property.py b/samples/openapi3/client/petstore/python/test/test_models/test_object_with_inline_composition_property.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_object_with_inline_composition_property.py rename to samples/openapi3/client/petstore/python/test/test_models/test_object_with_inline_composition_property.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_object_with_validations.py b/samples/openapi3/client/petstore/python/test/test_models/test_object_with_validations.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_object_with_validations.py rename to samples/openapi3/client/petstore/python/test/test_models/test_object_with_validations.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_order.py b/samples/openapi3/client/petstore/python/test/test_models/test_order.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_order.py rename to samples/openapi3/client/petstore/python/test/test_models/test_order.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_parent_pet.py b/samples/openapi3/client/petstore/python/test/test_models/test_parent_pet.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_parent_pet.py rename to samples/openapi3/client/petstore/python/test/test_models/test_parent_pet.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_pet.py b/samples/openapi3/client/petstore/python/test/test_models/test_pet.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_pet.py rename to samples/openapi3/client/petstore/python/test/test_models/test_pet.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_pig.py b/samples/openapi3/client/petstore/python/test/test_models/test_pig.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_pig.py rename to samples/openapi3/client/petstore/python/test/test_models/test_pig.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_player.py b/samples/openapi3/client/petstore/python/test/test_models/test_player.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_player.py rename to samples/openapi3/client/petstore/python/test/test_models/test_player.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_quadrilateral.py b/samples/openapi3/client/petstore/python/test/test_models/test_quadrilateral.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_quadrilateral.py rename to samples/openapi3/client/petstore/python/test/test_models/test_quadrilateral.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_quadrilateral_interface.py b/samples/openapi3/client/petstore/python/test/test_models/test_quadrilateral_interface.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_quadrilateral_interface.py rename to samples/openapi3/client/petstore/python/test/test_models/test_quadrilateral_interface.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_read_only_first.py b/samples/openapi3/client/petstore/python/test/test_models/test_read_only_first.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_read_only_first.py rename to samples/openapi3/client/petstore/python/test/test_models/test_read_only_first.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_scalene_triangle.py b/samples/openapi3/client/petstore/python/test/test_models/test_scalene_triangle.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_scalene_triangle.py rename to samples/openapi3/client/petstore/python/test/test_models/test_scalene_triangle.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_shape.py b/samples/openapi3/client/petstore/python/test/test_models/test_shape.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_shape.py rename to samples/openapi3/client/petstore/python/test/test_models/test_shape.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_shape_or_null.py b/samples/openapi3/client/petstore/python/test/test_models/test_shape_or_null.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_shape_or_null.py rename to samples/openapi3/client/petstore/python/test/test_models/test_shape_or_null.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_simple_quadrilateral.py b/samples/openapi3/client/petstore/python/test/test_models/test_simple_quadrilateral.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_simple_quadrilateral.py rename to samples/openapi3/client/petstore/python/test/test_models/test_simple_quadrilateral.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_some_object.py b/samples/openapi3/client/petstore/python/test/test_models/test_some_object.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_some_object.py rename to samples/openapi3/client/petstore/python/test/test_models/test_some_object.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_special_model_name.py b/samples/openapi3/client/petstore/python/test/test_models/test_special_model_name.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_special_model_name.py rename to samples/openapi3/client/petstore/python/test/test_models/test_special_model_name.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_string.py b/samples/openapi3/client/petstore/python/test/test_models/test_string.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_string.py rename to samples/openapi3/client/petstore/python/test/test_models/test_string.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_string_boolean_map.py b/samples/openapi3/client/petstore/python/test/test_models/test_string_boolean_map.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_string_boolean_map.py rename to samples/openapi3/client/petstore/python/test/test_models/test_string_boolean_map.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_string_enum.py b/samples/openapi3/client/petstore/python/test/test_models/test_string_enum.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_string_enum.py rename to samples/openapi3/client/petstore/python/test/test_models/test_string_enum.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_string_enum_with_default_value.py b/samples/openapi3/client/petstore/python/test/test_models/test_string_enum_with_default_value.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_string_enum_with_default_value.py rename to samples/openapi3/client/petstore/python/test/test_models/test_string_enum_with_default_value.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_string_with_validation.py b/samples/openapi3/client/petstore/python/test/test_models/test_string_with_validation.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_string_with_validation.py rename to samples/openapi3/client/petstore/python/test/test_models/test_string_with_validation.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_tag.py b/samples/openapi3/client/petstore/python/test/test_models/test_tag.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_tag.py rename to samples/openapi3/client/petstore/python/test/test_models/test_tag.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_triangle.py b/samples/openapi3/client/petstore/python/test/test_models/test_triangle.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_triangle.py rename to samples/openapi3/client/petstore/python/test/test_models/test_triangle.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_triangle_interface.py b/samples/openapi3/client/petstore/python/test/test_models/test_triangle_interface.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_triangle_interface.py rename to samples/openapi3/client/petstore/python/test/test_models/test_triangle_interface.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_user.py b/samples/openapi3/client/petstore/python/test/test_models/test_user.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_user.py rename to samples/openapi3/client/petstore/python/test/test_models/test_user.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_uuid_string.py b/samples/openapi3/client/petstore/python/test/test_models/test_uuid_string.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_uuid_string.py rename to samples/openapi3/client/petstore/python/test/test_models/test_uuid_string.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_whale.py b/samples/openapi3/client/petstore/python/test/test_models/test_whale.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_whale.py rename to samples/openapi3/client/petstore/python/test/test_models/test_whale.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_models/test_zebra.py b/samples/openapi3/client/petstore/python/test/test_models/test_zebra.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_models/test_zebra.py rename to samples/openapi3/client/petstore/python/test/test_models/test_zebra.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/__init__.py similarity index 60% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/__init__.py index 30c8b05d3f63..1309632d3d5a 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/__init__.py +++ b/samples/openapi3/client/petstore/python/test/test_paths/__init__.py @@ -1,50 +1,14 @@ import json import typing -import unittest import urllib3 from urllib3._collections import HTTPHeaderDict -from petstore_api import api_client - -class ApiTestMixin(unittest.TestCase): +class ApiTestMixin: json_content_type = 'application/json' user_agent = 'OpenAPI-Generator/1.0.0/python' - @classmethod - def assert_request_called_with( - cls, - mock_request, - url: str, - method: str = 'POST', - body: typing.Optional[bytes] = None, - content_type: typing.Optional[str] = 'application/json', - fields: typing.Optional[typing.Tuple[api_client.RequestField, ...]] = None, - accept_content_type: typing.Optional[str] = 'application/json', - stream: bool = False, - ): - headers = { - 'User-Agent': cls.user_agent - } - if accept_content_type: - headers['Accept'] = accept_content_type - if content_type: - headers['Content-Type'] = content_type - kwargs = dict( - headers=HTTPHeaderDict(headers), - fields=fields, - stream=stream, - timeout=None, - ) - if method != 'GET': - kwargs['body'] = body - mock_request.assert_called_with( - method, - url, - **kwargs - ) - @classmethod def assert_pool_manager_request_called_with( cls, @@ -52,8 +16,8 @@ def assert_pool_manager_request_called_with( url: str, method: str = 'POST', body: typing.Optional[bytes] = None, - content_type: typing.Optional[str] = 'application/json', - accept_content_type: typing.Optional[str] = 'application/json', + content_type: typing.Optional[str] = None, + accept_content_type: typing.Optional[str] = None, stream: bool = False, ): headers = { diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_body_with_query_params/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_another_fake_dummy/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_body_with_query_params/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_another_fake_dummy/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_another_fake_dummy/test_patch.py b/samples/openapi3/client/petstore/python/test/test_paths/test_another_fake_dummy/test_patch.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_another_fake_dummy/test_patch.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_another_fake_dummy/test_patch.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_case_sensitive_params/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_case_sensitive_params/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake/test_delete.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_delete.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake/test_delete.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_delete.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake/test_get.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_get.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake/test_patch.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_patch.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake/test_patch.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_patch.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_classname_test/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_additional_properties_with_array_of_enums/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_classname_test/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_additional_properties_with_array_of_enums/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_additional_properties_with_array_of_enums/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_additional_properties_with_array_of_enums/test_get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_additional_properties_with_array_of_enums/test_get.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_additional_properties_with_array_of_enums/test_get.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_delete_coffee_id/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_file_schema/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_delete_coffee_id/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_file_schema/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_body_with_file_schema/test_put.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_file_schema/test_put.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_body_with_file_schema/test_put.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_file_schema/test_put.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_health/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_query_params/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_health/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_query_params/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_body_with_query_params/test_put.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_query_params/test_put.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_body_with_query_params/test_put.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_body_with_query_params/test_put.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_inline_additional_properties/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_case_sensitive_params/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_inline_additional_properties/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_case_sensitive_params/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_case_sensitive_params/test_put.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_case_sensitive_params/test_put.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_case_sensitive_params/test_put.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_case_sensitive_params/test_put.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_inline_composition_/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_classname_test/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_inline_composition_/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_classname_test/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_classname_test/test_patch.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_classname_test/test_patch.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_classname_test/test_patch.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_classname_test/test_patch.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_json_form_data/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_delete_coffee_id/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_json_form_data/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_delete_coffee_id/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_delete_coffee_id/test_delete.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_delete_coffee_id/test_delete.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_delete_coffee_id/test_delete.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_delete_coffee_id/test_delete.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_json_patch/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_health/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_json_patch/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_health/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_health/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_health/test_get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_health/test_get.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_health/test_get.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_json_with_charset/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_additional_properties/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_json_with_charset/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_additional_properties/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_inline_additional_properties/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_additional_properties/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_inline_additional_properties/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_additional_properties/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_obj_in_query/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_composition_/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_obj_in_query/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_composition_/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_inline_composition_/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_composition_/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_inline_composition_/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_inline_composition_/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_parameter_collisions_1_a_b_ab_self_a_b_/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_form_data/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_parameter_collisions_1_a_b_ab_self_a_b_/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_form_data/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_json_form_data/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_form_data/test_get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_json_form_data/test_get.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_form_data/test_get.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_pet_id_upload_image_with_required_file/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_patch/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_pet_id_upload_image_with_required_file/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_patch/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_json_patch/test_patch.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_patch/test_patch.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_json_patch/test_patch.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_patch/test_patch.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_ref_obj_in_query/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_with_charset/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_ref_obj_in_query/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_with_charset/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_json_with_charset/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_with_charset/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_json_with_charset/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_json_with_charset/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_array_of_enums/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_obj_in_query/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_array_of_enums/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_obj_in_query/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_obj_in_query/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_obj_in_query/test_get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_obj_in_query/test_get.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_obj_in_query/test_get.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_arraymodel/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_parameter_collisions_1_a_b_ab_self_a_b_/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_arraymodel/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_parameter_collisions_1_a_b_ab_self_a_b_/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_parameter_collisions_1_a_b_ab_self_a_b_/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_parameter_collisions_1_a_b_ab_self_a_b_/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_parameter_collisions_1_a_b_ab_self_a_b_/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_parameter_collisions_1_a_b_ab_self_a_b_/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_boolean/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_pet_id_upload_image_with_required_file/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_boolean/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_pet_id_upload_image_with_required_file/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_pet_id_upload_image_with_required_file/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_pet_id_upload_image_with_required_file/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_pet_id_upload_image_with_required_file/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_pet_id_upload_image_with_required_file/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_composed_one_of_number_with_validations/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_ref_obj_in_query/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_composed_one_of_number_with_validations/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_ref_obj_in_query/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_ref_obj_in_query/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_ref_obj_in_query/test_get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_ref_obj_in_query/test_get.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_ref_obj_in_query/test_get.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_enum/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_array_of_enums/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_enum/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_array_of_enums/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_array_of_enums/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_array_of_enums/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_array_of_enums/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_array_of_enums/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_mammal/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_arraymodel/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_mammal/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_arraymodel/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_arraymodel/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_arraymodel/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_arraymodel/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_arraymodel/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_number/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_boolean/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_number/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_boolean/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_boolean/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_boolean/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_boolean/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_boolean/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_object_model_with_ref_props/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_composed_one_of_number_with_validations/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_object_model_with_ref_props/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_composed_one_of_number_with_validations/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_composed_one_of_number_with_validations/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_composed_one_of_number_with_validations/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_composed_one_of_number_with_validations/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_composed_one_of_number_with_validations/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_string/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_enum/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_string/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_enum/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_enum/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_enum/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_enum/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_enum/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_response_without_schema/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_mammal/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_response_without_schema/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_mammal/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_mammal/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_mammal/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_mammal/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_mammal/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_test_query_paramters/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_number/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_test_query_paramters/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_number/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_number/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_number/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_number/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_number/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_upload_download_file/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_object_model_with_ref_props/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_upload_download_file/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_object_model_with_ref_props/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_object_model_with_ref_props/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_object_model_with_ref_props/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_object_model_with_ref_props/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_object_model_with_ref_props/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_upload_file/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_string/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_upload_file/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_string/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_string/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_string/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_refs_string/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_refs_string/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_upload_files/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_response_without_schema/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_upload_files/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_response_without_schema/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_response_without_schema/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_response_without_schema/test_get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_response_without_schema/test_get.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_response_without_schema/test_get.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_foo/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_test_query_paramters/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_foo/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_test_query_paramters/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_test_query_paramters/test_put.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_test_query_paramters/test_put.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_test_query_paramters/test_put.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_test_query_paramters/test_put.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_download_file/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_download_file/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_upload_download_file/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_download_file/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_upload_download_file/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_download_file/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_find_by_status/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_file/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_find_by_status/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_file/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_upload_file/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_file/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_upload_file/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_file/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_find_by_tags/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_files/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_find_by_tags/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_files/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_upload_files/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_files/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_fake_upload_files/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_fake_upload_files/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_pet_id/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_foo/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_pet_id/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_foo/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_foo/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_foo/test_get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_foo/test_get.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_foo/test_get.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_pet_id_upload_image/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_pet_id_upload_image/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_pet/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_pet/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet/test_put.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet/test_put.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet/test_put.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_pet/test_put.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_store_inventory/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_status/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_store_inventory/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_status/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_find_by_status/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_status/test_get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_find_by_status/test_get.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_status/test_get.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_store_order/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_tags/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_store_order/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_tags/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_find_by_tags/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_tags/test_get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_find_by_tags/test_get.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_pet_find_by_tags/test_get.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_store_order_order_id/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_store_order_order_id/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_pet_id/test_delete.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/test_delete.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_pet_id/test_delete.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/test_delete.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_pet_id/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/test_get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_pet_id/test_get.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/test_get.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_pet_id/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_pet_id/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id_upload_image/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id_upload_image/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_pet_id_upload_image/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id_upload_image/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_pet_pet_id_upload_image/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_pet_pet_id_upload_image/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_create_with_array/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_store_inventory/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_create_with_array/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_store_inventory/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_store_inventory/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_store_inventory/test_get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_store_inventory/test_get.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_store_inventory/test_get.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_create_with_list/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_store_order/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_create_with_list/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_store_order/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_store_order/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_store_order/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_store_order/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_store_order/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_login/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_store_order_order_id/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_login/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_store_order_order_id/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_store_order_order_id/test_delete.py b/samples/openapi3/client/petstore/python/test/test_paths/test_store_order_order_id/test_delete.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_store_order_order_id/test_delete.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_store_order_order_id/test_delete.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_store_order_order_id/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_store_order_order_id/test_get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_store_order_order_id/test_get.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_store_order_order_id/test_get.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_logout/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_logout/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_user/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_user/test_post.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_username/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_array/__init__.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_username/__init__.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_array/__init__.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_create_with_array/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_array/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_create_with_array/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_array/test_post.py diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_list/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_list/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_create_with_list/test_post.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_list/test_post.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_create_with_list/test_post.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_user_create_with_list/test_post.py diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_login/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_login/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_login/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_login/test_get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_login/test_get.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_user_login/test_get.py diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_logout/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_logout/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_logout/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_logout/test_get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_logout/test_get.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_user_logout/test_get.py diff --git a/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/__init__.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_username/test_delete.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/test_delete.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_username/test_delete.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_user_username/test_delete.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_username/test_get.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/test_get.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_username/test_get.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_user_username/test_get.py diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_username/test_put.py b/samples/openapi3/client/petstore/python/test/test_paths/test_user_username/test_put.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test/test_paths/test_user_username/test_put.py rename to samples/openapi3/client/petstore/python/test/test_paths/test_user_username/test_put.py diff --git a/samples/openapi3/client/petstore/python/test_python.sh b/samples/openapi3/client/petstore/python/test_python.sh index f617f3adfa64..9728a9b53163 100755 --- a/samples/openapi3/client/petstore/python/test_python.sh +++ b/samples/openapi3/client/petstore/python/test_python.sh @@ -10,14 +10,16 @@ export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 ### set virtualenv -if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --always-copy +if [ -z "$VENVV" ]; then + python3 -m venv $VENV source $VENV/bin/activate DEACTIVE=true fi ### install dependencies pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT +### locally install the package, needed for pycharm problem checking +pip install -e . ### run tests tox || exit 1 diff --git a/samples/openapi3/client/petstore/python/tests_manual/__init__.py b/samples/openapi3/client/petstore/python/tests_manual/__init__.py index e69de29bb2d1..30c8b05d3f63 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/__init__.py +++ b/samples/openapi3/client/petstore/python/tests_manual/__init__.py @@ -0,0 +1,104 @@ +import json +import typing +import unittest + +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client + + +class ApiTestMixin(unittest.TestCase): + json_content_type = 'application/json' + user_agent = 'OpenAPI-Generator/1.0.0/python' + + @classmethod + def assert_request_called_with( + cls, + mock_request, + url: str, + method: str = 'POST', + body: typing.Optional[bytes] = None, + content_type: typing.Optional[str] = 'application/json', + fields: typing.Optional[typing.Tuple[api_client.RequestField, ...]] = None, + accept_content_type: typing.Optional[str] = 'application/json', + stream: bool = False, + ): + headers = { + 'User-Agent': cls.user_agent + } + if accept_content_type: + headers['Accept'] = accept_content_type + if content_type: + headers['Content-Type'] = content_type + kwargs = dict( + headers=HTTPHeaderDict(headers), + fields=fields, + stream=stream, + timeout=None, + ) + if method != 'GET': + kwargs['body'] = body + mock_request.assert_called_with( + method, + url, + **kwargs + ) + + @classmethod + def assert_pool_manager_request_called_with( + cls, + mock_request, + url: str, + method: str = 'POST', + body: typing.Optional[bytes] = None, + content_type: typing.Optional[str] = 'application/json', + accept_content_type: typing.Optional[str] = 'application/json', + stream: bool = False, + ): + headers = { + 'User-Agent': cls.user_agent + } + if accept_content_type: + headers['Accept'] = accept_content_type + if content_type: + headers['Content-Type'] = content_type + kwargs = dict( + headers=HTTPHeaderDict(headers), + preload_content=not stream, + timeout=None, + ) + if content_type and method != 'GET': + kwargs['body'] = body + mock_request.assert_called_with( + method, + url, + **kwargs + ) + + @staticmethod + def headers_for_content_type(content_type: str) -> typing.Dict[str, str]: + return {'content-type': content_type} + + @classmethod + def response( + cls, + body: typing.Union[str, bytes], + status: int = 200, + content_type: str = json_content_type, + headers: typing.Optional[typing.Dict[str, str]] = None, + preload_content: bool = True + ) -> urllib3.HTTPResponse: + if headers is None: + headers = {} + headers.update(cls.headers_for_content_type(content_type)) + return urllib3.HTTPResponse( + body, + headers=headers, + status=status, + preload_content=preload_content + ) + + @staticmethod + def json_bytes(in_data: typing.Any) -> bytes: + return json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode('utf-8') diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_additional_properties_class.py b/samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_class.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_additional_properties_class.py rename to samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_class.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_additional_properties_validator.py b/samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_validator.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_additional_properties_validator.py rename to samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_validator.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_animal.py b/samples/openapi3/client/petstore/python/tests_manual/test_animal.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_animal.py rename to samples/openapi3/client/petstore/python/tests_manual/test_animal.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_any_type_and_format.py b/samples/openapi3/client/petstore/python/tests_manual/test_any_type_and_format.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_any_type_and_format.py rename to samples/openapi3/client/petstore/python/tests_manual/test_any_type_and_format.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_any_type_not_string.py b/samples/openapi3/client/petstore/python/tests_manual/test_any_type_not_string.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_any_type_not_string.py rename to samples/openapi3/client/petstore/python/tests_manual/test_any_type_not_string.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_any_type_schema.py b/samples/openapi3/client/petstore/python/tests_manual/test_any_type_schema.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_any_type_schema.py rename to samples/openapi3/client/petstore/python/tests_manual/test_any_type_schema.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_array_holding_any_type.py b/samples/openapi3/client/petstore/python/tests_manual/test_array_holding_any_type.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_array_holding_any_type.py rename to samples/openapi3/client/petstore/python/tests_manual/test_array_holding_any_type.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_array_with_validations_in_items.py b/samples/openapi3/client/petstore/python/tests_manual/test_array_with_validations_in_items.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_array_with_validations_in_items.py rename to samples/openapi3/client/petstore/python/tests_manual/test_array_with_validations_in_items.py diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_boolean_enum.py b/samples/openapi3/client/petstore/python/tests_manual/test_boolean_enum.py index 09f386f23aa1..530755c0681b 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_boolean_enum.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_boolean_enum.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ OpenAPI Petstore @@ -8,7 +10,6 @@ """ -import sys import unittest import petstore_api @@ -24,13 +25,13 @@ def setUp(self): def tearDown(self): pass - def testBooleanEnum(self): + def test_BooleanEnum(self): """Test BooleanEnum""" model = BooleanEnum(True) - assert model.value is True - - assert BooleanEnum.allowed_values[('value',)]['TRUE'] is True - + assert model is BooleanEnum.TRUE + assert model.is_true_oapg() + assert model.is_false_oapg() is False + assert repr(model) == '' with self.assertRaises(petstore_api.ApiValueError): BooleanEnum(False) diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_combine_object_schemas.py b/samples/openapi3/client/petstore/python/tests_manual/test_combine_object_schemas.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_combine_object_schemas.py rename to samples/openapi3/client/petstore/python/tests_manual/test_combine_object_schemas.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_combine_schemas.py b/samples/openapi3/client/petstore/python/tests_manual/test_combine_schemas.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_combine_schemas.py rename to samples/openapi3/client/petstore/python/tests_manual/test_combine_schemas.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_bool.py b/samples/openapi3/client/petstore/python/tests_manual/test_composed_bool.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_bool.py rename to samples/openapi3/client/petstore/python/tests_manual/test_composed_bool.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_none.py b/samples/openapi3/client/petstore/python/tests_manual/test_composed_none.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_none.py rename to samples/openapi3/client/petstore/python/tests_manual/test_composed_none.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_number.py b/samples/openapi3/client/petstore/python/tests_manual/test_composed_number.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_number.py rename to samples/openapi3/client/petstore/python/tests_manual/test_composed_number.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_object.py b/samples/openapi3/client/petstore/python/tests_manual/test_composed_object.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_object.py rename to samples/openapi3/client/petstore/python/tests_manual/test_composed_object.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_one_of_different_types.py b/samples/openapi3/client/petstore/python/tests_manual/test_composed_one_of_different_types.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_one_of_different_types.py rename to samples/openapi3/client/petstore/python/tests_manual/test_composed_one_of_different_types.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_string.py b/samples/openapi3/client/petstore/python/tests_manual/test_composed_string.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_string.py rename to samples/openapi3/client/petstore/python/tests_manual/test_composed_string.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_configuration.py b/samples/openapi3/client/petstore/python/tests_manual/test_configuration.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_configuration.py rename to samples/openapi3/client/petstore/python/tests_manual/test_configuration.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_date_time_with_validations.py b/samples/openapi3/client/petstore/python/tests_manual/test_date_time_with_validations.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_date_time_with_validations.py rename to samples/openapi3/client/petstore/python/tests_manual/test_date_time_with_validations.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_date_with_validations.py b/samples/openapi3/client/petstore/python/tests_manual/test_date_with_validations.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_date_with_validations.py rename to samples/openapi3/client/petstore/python/tests_manual/test_date_with_validations.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_decimal_payload.py b/samples/openapi3/client/petstore/python/tests_manual/test_decimal_payload.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_decimal_payload.py rename to samples/openapi3/client/petstore/python/tests_manual/test_decimal_payload.py diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py b/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py index 93538160f9a8..7c0300fbcd1d 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py @@ -9,38 +9,32 @@ $ nosetests -v """ from collections import namedtuple +from decimal import Decimal import json -import os -import time +import typing import unittest -import datetime + +import urllib3 import petstore_api -from petstore_api.model import ( - shape, - equilateral_triangle, - animal, - dog, - apple, - mammal, - whale, - zebra, - banana, - fruit_req, - drawing, - banana_req, - number_with_validations, -) +from petstore_api import api_client +from petstore_api.schemas import NoneClass MockResponse = namedtuple('MockResponse', 'data') class DeserializationTests(unittest.TestCase): - - def setUp(self): - self.api_client = petstore_api.ApiClient() - self.deserialize = self.api_client.deserialize + json_content_type = 'application/json' + json_content_type_headers = {'content-type': json_content_type} + configuration = petstore_api.Configuration() + + @classmethod + def __response(cls, data: typing.Any) -> urllib3.HTTPResponse: + return urllib3.HTTPResponse( + json.dumps(data).encode('utf-8'), + headers=cls.json_content_type_headers + ) def test_deserialize_shape(self): """ @@ -54,35 +48,36 @@ def test_deserialize_shape(self): - SimpleQuadrilateral by traveling through 2 discriminators """ - shape_type, triangle_type = ['Triangle', 'EquilateralTriangle'] + from petstore_api.model import shape, equilateral_triangle + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=shape.Shape), + }, + ) data = { - 'shapeType': shape_type, - 'triangleType': triangle_type, + 'shapeType': 'Triangle', + 'triangleType': 'EquilateralTriangle', } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, (shape.Shape,), True) - self.assertTrue(isinstance(deserialized, equilateral_triangle.EquilateralTriangle)) - self.assertEqual(deserialized.shape_type, shape_type) - self.assertEqual(deserialized.triangle_type, triangle_type) - - # invalid second discriminator value - shape_type, quadrilateral_type = ['Quadrilateral', 'Triangle'] + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, self.configuration) + body = deserialized.body + self.assertTrue(isinstance(body, equilateral_triangle.EquilateralTriangle)) + self.assertEqual(body['shapeType'], 'Triangle') + self.assertEqual(body['triangleType'], 'EquilateralTriangle') + + # invalid quadrilateralType, second discriminator value data = { - 'shapeType': shape_type, - 'quadrilateralType': quadrilateral_type, + 'shapeType': 'Quadrilateral', + 'quadrilateralType': 'Triangle', } - response = MockResponse(data=json.dumps(data)) + response = self.__response(data) - err_msg = ("Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '{}'='{}' at path: ()" + err_msg = ( + r"Invalid discriminator value was passed in to Quadrilateral.quadrilateralType Only the values " + r"\['ComplexQuadrilateral', 'SimpleQuadrilateral'\] are allowed at \('args\[0\]', 'quadrilateralType'\)" ) - with self.assertRaisesRegex( - petstore_api.ApiValueError, - err_msg.format("quadrilateralType", "Triangle") - ): - self.deserialize(response, (shape.Shape,), True) + with self.assertRaisesRegex(petstore_api.ApiValueError, err_msg): + _response_for_200.deserialize(response, self.configuration) def test_deserialize_animal(self): """ @@ -91,26 +86,30 @@ def test_deserialize_animal(self): that inherrit from Animal This is the swagger (v2) way of doing something like oneOf composition """ - class_name = 'Dog' - color = 'white' - breed = 'Jack Russel Terrier' + from petstore_api.model import animal, dog + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=animal.Animal), + }, + ) data = { - 'className': class_name, - 'color': color, - 'breed': breed + 'className': 'Dog', + 'color': 'white', + 'breed': 'Jack Russel Terrier' } - response = MockResponse(data=json.dumps(data)) - - deserialized = self.deserialize(response, (animal.Animal,), True) - self.assertTrue(isinstance(deserialized, dog.Dog)) - self.assertEqual(deserialized.class_name, class_name) - self.assertEqual(deserialized.color, color) - self.assertEqual(deserialized.breed, breed) + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, self.configuration) + body = deserialized.body + self.assertTrue(isinstance(body, dog.Dog)) + self.assertEqual(body['className'], 'Dog') + self.assertEqual(body['color'], 'white') + self.assertEqual(body['breed'], 'Jack Russel Terrier') def test_regex_constraint(self): """ Test regex pattern validation. """ + from petstore_api.model import apple # Test with valid regex pattern. inst = apple.Apple( @@ -118,24 +117,29 @@ def test_regex_constraint(self): ) assert isinstance(inst, apple.Apple) - # Test with invalid regex pattern in cultivar - err_msg = ("Invalid value for `{}`, must match regular expression `{}`$") + inst = apple.Apple( + cultivar="Golden Delicious", + origin="cHiLe" + ) + assert isinstance(inst, apple.Apple) + + # Test with invalid regex pattern. + err_regex = r"Invalid value `.+?`, must match regular expression `.+?` at \('args\[0\]', 'cultivar'\)" with self.assertRaisesRegex( petstore_api.ApiValueError, - err_msg.format("cultivar", "[^`]*") + err_regex ): inst = apple.Apple( cultivar="!@#%@$#Akane" ) - # Test with invalid regex pattern in origin - err_msg = ("Invalid value for `{}`, must match regular expression `{}` with flags") + err_regex = r"Invalid value `.+?`, must match regular expression `.+?` at \('args\[0\]', 'origin'\)" with self.assertRaisesRegex( petstore_api.ApiValueError, - err_msg.format("origin", "[^`]*") + err_regex ): inst = apple.Apple( - cultivar="Akane", + cultivar="Golden Delicious", origin="!@#%@$#Chile" ) @@ -146,6 +150,12 @@ def test_deserialize_mammal(self): """ # whale test + from petstore_api.model import mammal, zebra, whale + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=mammal.Mammal), + }, + ) has_baleen = True has_teeth = False class_name = 'whale' @@ -154,12 +164,13 @@ def test_deserialize_mammal(self): 'hasTeeth': has_teeth, 'className': class_name } - response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (mammal.Mammal,), True) - self.assertTrue(isinstance(deserialized, whale.Whale)) - self.assertEqual(deserialized.has_baleen, has_baleen) - self.assertEqual(deserialized.has_teeth, has_teeth) - self.assertEqual(deserialized.class_name, class_name) + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, self.configuration) + body = deserialized.body + self.assertTrue(isinstance(body, whale.Whale)) + self.assertEqual(bool(body['hasBaleen']), has_baleen) + self.assertEqual(bool(body['hasTeeth']), has_teeth) + self.assertEqual(body.className, class_name) # zebra test zebra_type = 'plains' @@ -168,47 +179,64 @@ def test_deserialize_mammal(self): 'type': zebra_type, 'className': class_name } - response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (mammal.Mammal,), True) - self.assertTrue(isinstance(deserialized, zebra.Zebra)) - self.assertEqual(deserialized.type, zebra_type) - self.assertEqual(deserialized.class_name, class_name) + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, self.configuration) + body = deserialized.body + self.assertTrue(isinstance(body, zebra.Zebra)) + self.assertEqual(body['type'], zebra_type) + self.assertEqual(body.className, class_name) def test_deserialize_float_value(self): """ Deserialize floating point values. """ + from petstore_api.model import banana + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=banana.Banana), + }, + ) data = { 'lengthCm': 3.1415 } - response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (banana.Banana,), True) - self.assertTrue(isinstance(deserialized, banana.Banana)) - self.assertEqual(deserialized.length_cm, 3.1415) + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, self.configuration) + body = deserialized.body + self.assertTrue(isinstance(body, banana.Banana)) + self.assertTrue(isinstance(body.lengthCm, Decimal)) + self.assertEqual(body.lengthCm, 3.1415) - # Float value is serialized without decimal point + """ + Float value is serialized without decimal point + The client receive it as an integer, which work because Banana.lengthCm is type number without format + Which accepts int AND float + """ data = { 'lengthCm': 3 } - response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (banana.Banana,), True) - self.assertTrue(isinstance(deserialized, banana.Banana)) - self.assertEqual(deserialized.length_cm, 3.0) + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, self.configuration) + body = deserialized.body + self.assertTrue(isinstance(body, banana.Banana)) + self.assertTrue(isinstance(body.lengthCm, Decimal)) + self.assertEqual(body.lengthCm, 3) def test_deserialize_fruit_null_value(self): """ deserialize fruit with null value. fruitReq is a oneOf composed schema model with discriminator, including 'null' type. """ - - # Unmarshal 'null' value + from petstore_api.model import fruit_req + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=fruit_req.FruitReq), + }, + ) data = None - response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (fruit_req.FruitReq, type(None)), True) - self.assertEqual(type(deserialized), type(None)) - - inst = fruit_req.FruitReq(None) - self.assertIsNone(inst) + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, self.configuration) + self.assertTrue(isinstance(deserialized.body, fruit_req.FruitReq)) + self.assertTrue(isinstance(deserialized.body, NoneClass)) def test_deserialize_with_additional_properties(self): """ @@ -223,6 +251,7 @@ def test_deserialize_with_additional_properties(self): # The additionalProperties keyword is used to control the handling of extra stuff, # that is, properties whose names are not listed in the properties keyword. # By default any additional properties are allowed. + from petstore_api.model import dog, mammal, zebra, banana_req data = { 'className': 'Dog', 'color': 'brown', @@ -231,37 +260,56 @@ def test_deserialize_with_additional_properties(self): 'group': 'Terrier Group', 'size': 'medium', } - response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (dog.Dog,), True) - self.assertEqual(type(deserialized), dog.Dog) - self.assertEqual(deserialized.class_name, 'Dog') - self.assertEqual(deserialized.breed, 'golden retriever') + response = self.__response(data) + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=dog.Dog), + }, + ) + deserialized = _response_for_200.deserialize(response, self.configuration) + body = deserialized.body + self.assertTrue(isinstance(body, dog.Dog)) + self.assertEqual(body['className'], 'Dog') + self.assertEqual(body['color'], 'brown') + self.assertEqual(body['breed'], 'golden retriever') + self.assertEqual(body['group'], 'Terrier Group') + self.assertEqual(body['size'], 'medium') # The 'zebra' schema allows additional properties by explicitly setting # additionalProperties: true. # This is equivalent to 'additionalProperties' not being present. data = { - 'class_name': 'zebra', + 'className': 'zebra', 'type': 'plains', # Below are additional, undeclared properties 'group': 'abc', 'size': 3, 'p1': True, - 'p2': [ 'a', 'b', 123], + 'p2': ['a', 'b', 123], } - response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (mammal.Mammal,), True) - self.assertEqual(type(deserialized), zebra.Zebra) - self.assertEqual(deserialized.class_name, 'zebra') - self.assertEqual(deserialized.type, 'plains') - self.assertEqual(deserialized.p1, True) + response = self.__response(data) + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=mammal.Mammal), + }, + ) + deserialized = _response_for_200.deserialize(response, self.configuration) + body = deserialized.body + self.assertTrue(isinstance(body, zebra.Zebra)) + self.assertEqual(body['className'], 'zebra') + self.assertEqual(body['type'], 'plains') + self.assertEqual(bool(body['p1']), True) # The 'bananaReq' schema disallows additional properties by explicitly setting # additionalProperties: false - err_msg = ("{} has no attribute '{}' at ") + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=banana_req.BananaReq), + }, + ) with self.assertRaisesRegex( - petstore_api.exceptions.ApiAttributeError, - err_msg.format("BananaReq", "unknown-group") + petstore_api.exceptions.ApiTypeError, + r"BananaReq was passed 1 invalid argument: \['unknown-group'\]" ): data = { 'lengthCm': 21.2, @@ -270,58 +318,141 @@ def test_deserialize_with_additional_properties(self): # an exception must be raised. 'unknown-group': 'abc', } - response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (banana_req.BananaReq,), True) - self.assertEqual(type(deserialized), banana_req.BananaReq) - self.assertEqual(deserialized.lengthCm, 21) - self.assertEqual(deserialized.p1, True) + response = self.__response(data) + _response_for_200.deserialize(response, self.configuration) def test_deserialize_with_additional_properties_and_reference(self): """ Deserialize data with schemas that has the additionalProperties keyword and the schema is specified as a reference ($ref). """ + from petstore_api.model import drawing + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=drawing.Drawing), + }, + ) data = { - 'main_shape': { - 'shape_type': 'Triangle', - 'triangle_type': 'EquilateralTriangle', + 'mainShape': { + 'shapeType': 'Triangle', + 'triangleType': 'EquilateralTriangle', }, 'shapes': [ { - 'shape_type': 'Triangle', - 'triangle_type': 'IsoscelesTriangle', + 'shapeType': 'Triangle', + 'triangleType': 'IsoscelesTriangle', }, { - 'shape_type': 'Quadrilateral', - 'quadrilateral_type': 'ComplexQuadrilateral', + 'shapeType': 'Quadrilateral', + 'quadrilateralType': 'ComplexQuadrilateral', }, ], + 'an_additional_prop': { + 'lengthCm': 4, + 'color': 'yellow' + } } - response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (drawing.Drawing,), True) + response = self.__response(data) + _response_for_200.deserialize(response, self.configuration) def test_deserialize_NumberWithValidations(self): - """ deserialize NumberWithValidations """ + from petstore_api.model.number_with_validations import NumberWithValidations + from petstore_api.paths.fake_refs_number.post import _response_for_200 + # make sure that an exception is thrown on an invalid type value with self.assertRaises(petstore_api.ApiTypeError): - self.deserialize( - MockResponse(data=json.dumps("test str")), - (number_with_validations.NumberWithValidations,), - True - ) + response = self.__response('test str') + _response_for_200.deserialize(response, self.configuration) # make sure that an exception is thrown on an invalid value with self.assertRaises(petstore_api.ApiValueError): - self.deserialize( - MockResponse(data=json.dumps(21.0)), - (number_with_validations.NumberWithValidations,), - True - ) + response = self.__response(21.0) + _response_for_200.deserialize(response, self.configuration) # valid value works number_val = 11.0 - response = MockResponse(data=json.dumps(number_val)) - number = self.deserialize(response, - (number_with_validations.NumberWithValidations,), True) - self.assertTrue(isinstance(number, number_with_validations.NumberWithValidations)) - self.assertTrue(number.value == number_val) \ No newline at end of file + response = self.__response(number_val) + response = _response_for_200.deserialize(response, self.configuration) + self.assertTrue(isinstance(response.body, NumberWithValidations)) + self.assertEqual(response.body, number_val) + + def test_array_of_enums(self): + from petstore_api.model.array_of_enums import ArrayOfEnums + from petstore_api.paths.fake_refs_array_of_enums.post import _response_for_200 + from petstore_api.model import string_enum + data = ["placed", None] + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, self.configuration) + assert isinstance(deserialized.body, ArrayOfEnums) + expected_results = ArrayOfEnums([string_enum.StringEnum(v) for v in data]) + assert expected_results == deserialized.body + + def test_multiple_of_deserialization(self): + data = { + 'byte': '3', + 'date': '1970-01-01', + 'password': "abcdefghijkl", + 'integer': 30, + 'number': 65.0, + 'float': 62.4, + } + from petstore_api.model import format_test + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=format_test.FormatTest), + }, + ) + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, self.configuration) + self.assertTrue(isinstance(deserialized.body, format_test.FormatTest)) + + with self.assertRaisesRegex( + petstore_api.exceptions.ApiValueError, + r"Invalid value `31`, value must be a multiple of `2` at \('args\[0\]', 'integer'\)" + ): + data = { + 'byte': '3', + 'date': '1970-01-01', + 'password': "abcdefghijkl", + 'integer': 31, # Value is supposed to be multiple of '2'. An error must be raised + 'number': 65.0, + 'float': 62.4, + } + response = self.__response(data) + _response_for_200.deserialize(response, self.configuration) + + # Disable JSON schema validation. No error should be raised during deserialization. + configuration = petstore_api.Configuration() + configuration.disabled_client_side_validations = "multipleOf" + + data = { + 'byte': '3', + 'date': '1970-01-01', + 'password': "abcdefghijkl", + 'integer': 31, # Value is supposed to be multiple of '2' + 'number': 65.0, + 'float': 62.4, + } + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, configuration) + self.assertTrue(isinstance(deserialized.body, format_test.FormatTest)) + + # Disable JSON schema validation but for a different keyword. + # An error should be raised during deserialization. + configuration = petstore_api.Configuration() + configuration.disabled_client_side_validations = "maxItems" + + with self.assertRaisesRegex( + petstore_api.exceptions.ApiValueError, + r"Invalid value `31`, value must be a multiple of `2` at \('args\[0\]', 'integer'\)" + ): + data = { + 'byte': '3', + 'date': '1970-01-01', + 'password': "abcdefghijkl", + 'integer': 31, # Value is supposed to be multiple of '2' + 'number': 65.0, + 'float': 62.4, + } + response = self.__response(data) + _response_for_200.deserialize(response, configuration) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_discard_unknown_properties.py b/samples/openapi3/client/petstore/python/tests_manual/test_discard_unknown_properties.py index ed1ca736d4ba..97d850d56b68 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_discard_unknown_properties.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_discard_unknown_properties.py @@ -1,173 +1,157 @@ -# 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 -""" -from collections import namedtuple -import json -import re -import unittest - -import petstore_api -from petstore_api.model import cat, dog, isosceles_triangle, banana_req, fruit_req -from petstore_api import Configuration, signing - -from petstore_api.model_utils import ( - file_type, - model_to_dict, -) - -MockResponse = namedtuple('MockResponse', 'data') - -class DiscardUnknownPropertiesTests(unittest.TestCase): - - def test_deserialize_banana_req_do_not_discard_unknown_properties(self): - """ - deserialize bananaReq with unknown properties. - Strict validation is enabled. - Simple (non-composed) schema scenario. - """ - config = Configuration(discard_unknown_keys=False) - api_client = petstore_api.ApiClient(config) - data = { - 'lengthCm': 21.3, - 'sweet': False, - # Below is an unknown property not explicitly declared in the OpenAPI document. - # It should not be in the payload because additional properties (undeclared) are - # not allowed in the bananaReq schema (additionalProperties: false). - 'unknown_property': 'a-value' - } - response = MockResponse(data=json.dumps(data)) - - # Deserializing with strict validation raises an exception because the 'unknown_property' - # is undeclared. - with self.assertRaises(petstore_api.exceptions.ApiAttributeError) as cm: - deserialized = api_client.deserialize(response, ((banana_req.BananaReq),), True) - self.assertTrue(re.match("BananaReq has no attribute 'unknown_property' at.*", str(cm.exception)), - 'Exception message: {0}'.format(str(cm.exception))) - - - def test_deserialize_fruit_req_do_not_discard_unknown_properties(self): - """ - deserialize FruitReq with unknown properties. - Strict validation is enabled. - Composed schema scenario. - """ - config = Configuration(discard_unknown_keys=False) - api_client = petstore_api.ApiClient(config) - data = { - 'lengthCm': 21.3, - 'sweet': False, - # Below is an unknown property not explicitly declared in the OpenAPI document. - # It should not be in the payload because additional properties (undeclared) are - # not allowed in the schema (additionalProperties: false). - 'unknown_property': 'a-value' - } - response = MockResponse(data=json.dumps(data)) - - # Deserializing with strict validation raises an exception because the 'unknown_property' - # is undeclared. - with self.assertRaisesRegex(petstore_api.ApiValueError, "Invalid inputs given to generate an instance of FruitReq. None of the oneOf schemas matched the input data."): - deserialized = api_client.deserialize(response, ((fruit_req.FruitReq),), True) - - - def test_deserialize_fruit_req_discard_unknown_properties(self): - """ - deserialize FruitReq with unknown properties. - Strict validation is enabled. - Composed schema scenario. - """ - config = Configuration(discard_unknown_keys=True) - api_client = petstore_api.ApiClient(config) - data = { - 'lengthCm': 21.3, - 'sweet': False, - # Below is an unknown property not explicitly declared in the OpenAPI document. - # It should not be in the payload because additional properties (undeclared) are - # not allowed in BananaReq - 'unknown_property': 'a-value' - } - response = MockResponse(data=json.dumps(data)) - deserialized = api_client.deserialize(response, ((fruit_req.FruitReq),), True) - self.assertNotIn("unknown_property", deserialized.to_dict().keys()) - - - def test_deserialize_banana_req_discard_unknown_properties(self): - """ - Deserialize bananaReq with unknown properties. - Discard unknown properties. - """ - config = Configuration(discard_unknown_keys=True) - api_client = petstore_api.ApiClient(config) - data = { - 'lengthCm': 21.3, - 'sweet': False, - # Below are additional (undeclared) properties not specified in the bananaReq schema. - 'unknown_property': 'a-value', - 'more-unknown': [ - 'a' - ] - } - # The 'unknown_property' is undeclared, which would normally raise an exception, but - # when discard_unknown_keys is set to True, the unknown properties are discarded. - response = MockResponse(data=json.dumps(data)) - deserialized = api_client.deserialize(response, ((banana_req.BananaReq),), True) - self.assertTrue(isinstance(deserialized, banana_req.BananaReq)) - # Check the 'unknown_property' and 'more-unknown' properties are not present in the - # output. - self.assertIn("length_cm", deserialized.to_dict().keys()) - self.assertNotIn("unknown_property", deserialized.to_dict().keys()) - self.assertNotIn("more-unknown", deserialized.to_dict().keys()) - - def test_deserialize_cat_do_not_discard_unknown_properties(self): - """ - Deserialize Cat with unknown properties. - Strict validation is enabled. - """ - config = Configuration(discard_unknown_keys=False) - api_client = petstore_api.ApiClient(config) - data = { - "class_name": "Cat", - "color": "black", - "declawed": True, - "dynamic-property": 12345, - } - response = MockResponse(data=json.dumps(data)) - - # Deserializing with strict validation does not raise an exception because the even though - # the 'dynamic-property' is undeclared, the 'Cat' schema defines the additionalProperties - # attribute. - deserialized = api_client.deserialize(response, ((cat.Cat),), True) - self.assertTrue(isinstance(deserialized, cat.Cat)) - self.assertIn('color', deserialized.to_dict()) - self.assertEqual(deserialized['color'], 'black') - - def test_deserialize_cat_discard_unknown_properties(self): - """ - Deserialize Cat with unknown properties. - Request to discard unknown properties, but Cat is composed schema - with one inner schema that has 'additionalProperties' set to true. - """ - config = Configuration(discard_unknown_keys=True) - api_client = petstore_api.ApiClient(config) - data = { - "class_name": "Cat", - "color": "black", - "declawed": True, - # Below are additional (undeclared) properties. - "my_additional_property": 123, - } - # The 'my_additional_property' is undeclared - response = MockResponse(data=json.dumps(data)) - deserialized = api_client.deserialize(response, ((cat.Cat),), True) - self.assertTrue(isinstance(deserialized, cat.Cat)) - # Check the 'my_additional_property' is present - self.assertIn("my_additional_property", deserialized.to_dict().keys()) - +# # 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 +# """ +# from collections import namedtuple +# import json +# import re +# import unittest +# +# import petstore_api +# from petstore_api.model import cat, dog, isosceles_triangle, banana_req +# from petstore_api import Configuration, signing +# +# from petstore_api.schemas import ( +# file_type, +# model_to_dict, +# ) +# +# MockResponse = namedtuple('MockResponse', 'data') +# +# class DiscardUnknownPropertiesTests(unittest.TestCase): +# +# def test_deserialize_banana_req_do_not_discard_unknown_properties(self): +# """ +# deserialize bananaReq with unknown properties. +# Strict validation is enabled. +# Simple (non-composed) schema scenario. +# """ +# config = Configuration(discard_unknown_keys=False) +# api_client = petstore_api.ApiClient(config) +# data = { +# 'lengthCm': 21.3, +# 'sweet': False, +# # Below is an unknown property not explicitly declared in the OpenAPI document. +# # It should not be in the payload because additional properties (undeclared) are +# # not allowed in the bananaReq schema (additionalProperties: false). +# 'unknown_property': 'a-value' +# } +# response = MockResponse(data=json.dumps(data)) +# +# # Deserializing with strict validation raises an exception because the 'unknown_property' +# # is undeclared. +# with self.assertRaises(petstore_api.exceptions.ApiAttributeError) as cm: +# deserialized = api_client.deserialize(response, ((banana_req.BananaReq),), True) +# self.assertTrue(re.match("BananaReq has no attribute 'unknown_property' at.*", str(cm.exception)), +# 'Exception message: {0}'.format(str(cm.exception))) +# +# +# def test_deserialize_isosceles_triangle_do_not_discard_unknown_properties(self): +# """ +# deserialize IsoscelesTriangle with unknown properties. +# Strict validation is enabled. +# Composed schema scenario. +# """ +# config = Configuration(discard_unknown_keys=False) +# api_client = petstore_api.ApiClient(config) +# data = { +# 'shape_type': 'Triangle', +# 'triangle_type': 'EquilateralTriangle', +# # Below is an unknown property not explicitly declared in the OpenAPI document. +# # It should not be in the payload because additional properties (undeclared) are +# # not allowed in the schema (additionalProperties: false). +# 'unknown_property': 'a-value' +# } +# response = MockResponse(data=json.dumps(data)) +# +# # Deserializing with strict validation raises an exception because the 'unknown_property' +# # is undeclared. +# with self.assertRaises(petstore_api.ApiValueError) as cm: +# deserialized = api_client.deserialize(response, ((isosceles_triangle.IsoscelesTriangle),), True) +# self.assertTrue(re.match('.*Not all inputs were used.*unknown_property.*', str(cm.exception)), +# 'Exception message: {0}'.format(str(cm.exception))) +# +# +# def test_deserialize_banana_req_discard_unknown_properties(self): +# """ +# Deserialize bananaReq with unknown properties. +# Discard unknown properties. +# """ +# config = Configuration(discard_unknown_keys=True) +# api_client = petstore_api.ApiClient(config) +# data = { +# 'lengthCm': 21.3, +# 'sweet': False, +# # Below are additional (undeclared) properties not specified in the bananaReq schema. +# 'unknown_property': 'a-value', +# 'more-unknown': [ +# 'a' +# ] +# } +# # The 'unknown_property' is undeclared, which would normally raise an exception, but +# # when discard_unknown_keys is set to True, the unknown properties are discarded. +# response = MockResponse(data=json.dumps(data)) +# deserialized = api_client.deserialize(response, ((banana_req.BananaReq),), True) +# self.assertTrue(isinstance(deserialized, banana_req.BananaReq)) +# # Check the 'unknown_property' and 'more-unknown' properties are not present in the +# # output. +# self.assertIn("length_cm", deserialized.to_dict().keys()) +# self.assertNotIn("unknown_property", deserialized.to_dict().keys()) +# self.assertNotIn("more-unknown", deserialized.to_dict().keys()) +# +# def test_deserialize_cat_do_not_discard_unknown_properties(self): +# """ +# Deserialize Cat with unknown properties. +# Strict validation is enabled. +# """ +# config = Configuration(discard_unknown_keys=False) +# api_client = petstore_api.ApiClient(config) +# data = { +# "class_name": "Cat", +# "color": "black", +# "declawed": True, +# "dynamic-property": 12345, +# } +# response = MockResponse(data=json.dumps(data)) +# +# # Deserializing with strict validation does not raise an exception because the even though +# # the 'dynamic-property' is undeclared, the 'Cat' schema defines the additionalProperties +# # attribute. +# deserialized = api_client.deserialize(response, ((cat.Cat),), True) +# self.assertTrue(isinstance(deserialized, cat.Cat)) +# self.assertIn('color', deserialized.to_dict()) +# self.assertEqual(deserialized['color'], 'black') +# +# def test_deserialize_cat_discard_unknown_properties(self): +# """ +# Deserialize Cat with unknown properties. +# Request to discard unknown properties, but Cat is composed schema +# with one inner schema that has 'additionalProperties' set to true. +# """ +# config = Configuration(discard_unknown_keys=True) +# api_client = petstore_api.ApiClient(config) +# data = { +# "class_name": "Cat", +# "color": "black", +# "declawed": True, +# # Below are additional (undeclared) properties. +# "my_additional_property": 123, +# } +# # The 'my_additional_property' is undeclared, but 'Cat' has a 'Address' type through +# # the allOf: [ $ref: '#/components/schemas/Address' ]. +# response = MockResponse(data=json.dumps(data)) +# deserialized = api_client.deserialize(response, ((cat.Cat),), True) +# self.assertTrue(isinstance(deserialized, cat.Cat)) +# # Check the 'unknown_property' and 'more-unknown' properties are not present in the +# # output. +# self.assertIn("declawed", deserialized.to_dict().keys()) +# self.assertIn("my_additional_property", deserialized.to_dict().keys()) +# diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_drawing.py b/samples/openapi3/client/petstore/python/tests_manual/test_drawing.py index 327e01fb849f..2febc75e3625 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_drawing.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_drawing.py @@ -14,21 +14,9 @@ import unittest import petstore_api -try: - from petstore_api.model import nullable_shape -except ImportError: - nullable_shape = sys.modules[ - 'petstore_api.model.nullable_shape'] -try: - from petstore_api.model import shape -except ImportError: - shape = sys.modules[ - 'petstore_api.model.shape'] -try: - from petstore_api.model import shape_or_null -except ImportError: - shape_or_null = sys.modules[ - 'petstore_api.model.shape_or_null'] +from petstore_api.schemas import NoneClass +from petstore_api.model import shape +from petstore_api.model import shape_or_null from petstore_api.model.drawing import Drawing @@ -43,88 +31,95 @@ def tearDown(self): def test_create_instances(self): """ - Validate instance can be created using pythonic name or OAS names. + Validate instance can be created """ - # Validate object can be created using pythonic names. inst = shape.Shape( - shape_type="Triangle", - triangle_type="IsoscelesTriangle" + shapeType="Triangle", + triangleType="IsoscelesTriangle" ) from petstore_api.model.isosceles_triangle import IsoscelesTriangle assert isinstance(inst, IsoscelesTriangle) - # Validate object can be created using OAS names. - # For example, this can be used to construct objects on the client - # when the input data is available as JSON documents. - data = { - 'shapeType': "Triangle", - 'triangleType': "IsoscelesTriangle" - } - inst = shape.Shape(_spec_property_naming=True, **data) - assert isinstance(inst, IsoscelesTriangle) - def test_deserialize_oneof_reference(self): """ Validate the scenario when the type of a OAS property is 'oneOf', and the 'oneOf' schema is specified as a reference ($ref), not an inline 'oneOf' schema. """ isosceles_triangle = shape.Shape( - shape_type="Triangle", - triangle_type="IsoscelesTriangle" + shapeType="Triangle", + triangleType="IsoscelesTriangle" ) from petstore_api.model.isosceles_triangle import IsoscelesTriangle - from petstore_api.model.triangle import Triangle + assert isinstance(isosceles_triangle, IsoscelesTriangle) from petstore_api.model.equilateral_triangle import EquilateralTriangle - assert isinstance(isosceles_triangle, IsoscelesTriangle) inst = Drawing( - # 'main_shape' has type 'Shape', which is a oneOf [triangle, quadrilateral] - # composed schema. So we should be able to assign a petstore_api.Triangle - # to a 'main_shape'. - main_shape=isosceles_triangle, + mainShape=isosceles_triangle, shapes=[ shape.Shape( - shape_type="Triangle", - triangle_type="EquilateralTriangle" + shapeType="Triangle", + triangleType="EquilateralTriangle" ), - Triangle( - shape_type="Triangle", - triangle_type="IsoscelesTriangle" - ), - EquilateralTriangle( - shape_type="Triangle", - triangle_type="EquilateralTriangle" + shape.Shape( + shapeType="Triangle", + triangleType="IsoscelesTriangle" ), shape.Shape( - shape_type="Quadrilateral", - quadrilateral_type="ComplexQuadrilateral" + shapeType="Triangle", + triangleType="EquilateralTriangle" ), + shape.Shape( + shapeType="Quadrilateral", + quadrilateralType="ComplexQuadrilateral" + ) ], ) - from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral assert isinstance(inst, Drawing) - assert isinstance(inst.main_shape, IsoscelesTriangle) - self.assertEqual(len(inst.shapes), 4) - assert isinstance(inst.shapes[0], EquilateralTriangle) - assert isinstance(inst.shapes[1], IsoscelesTriangle) - assert isinstance(inst.shapes[2], EquilateralTriangle) - assert isinstance(inst.shapes[3], ComplexQuadrilateral) - - # Validate we cannot assign the None value to main_shape because the 'null' type + assert isinstance(inst["mainShape"], IsoscelesTriangle) + self.assertEqual(len(inst["shapes"]), 4) + from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral + assert isinstance(inst["shapes"][0], EquilateralTriangle) + assert isinstance(inst["shapes"][1], IsoscelesTriangle) + assert isinstance(inst["shapes"][2], EquilateralTriangle) + assert isinstance(inst["shapes"][3], ComplexQuadrilateral) + + # Validate we cannot assign the None value to mainShape because the 'null' type # is not one of the allowed types in the 'Shape' schema. - err_msg = (r"Invalid type for variable '{}'. " - r"Required value type is {} and passed type was {} at {}") + err_msg = (r"Invalid inputs given to generate an instance of .+?Shape.+? " + r"None of the oneOf schemas matched the input data.") with self.assertRaisesRegex( - petstore_api.ApiTypeError, - err_msg.format(r"main_shape", r"one of \[ComplexQuadrilateral, EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle, SimpleQuadrilateral\]", r"NoneType", r"\['main_shape'\]") + petstore_api.ApiValueError, + err_msg ): - inst = Drawing( - # 'main_shape' has type 'Shape', which is a oneOf [triangle, quadrilateral] + Drawing( + # 'mainShape' has type 'Shape', which is a oneOf [triangle, quadrilateral] # So the None value should not be allowed and an exception should be raised. - main_shape=None, + mainShape=None, ) + """ + We can pass in a Triangle instance in shapes + Under the hood it is converted into a dict, and that dict payload + does validate as a Shape, so this works + """ + from petstore_api.model.triangle import Triangle + inst = Drawing( + mainShape=isosceles_triangle, + shapes=[ + Triangle( + shapeType="Triangle", + triangleType="EquilateralTriangle" + ) + ] + ) + self.assertEqual(len(inst["shapes"]), 1) + from petstore_api.model.triangle_interface import TriangleInterface + shapes = inst["shapes"] + assert isinstance(shapes[0], shape.Shape) + assert isinstance(shapes[0], Triangle) + assert isinstance(shapes[0], EquilateralTriangle) + assert isinstance(shapes[0], TriangleInterface) def test_deserialize_oneof_reference_with_null_type(self): """ @@ -137,14 +132,13 @@ def test_deserialize_oneof_reference_with_null_type(self): # Validate we can assign the None value to shape_or_null, because the 'null' type # is one of the allowed types in the 'ShapeOrNull' schema. inst = Drawing( - # 'shape_or_null' has type 'ShapeOrNull', which is a oneOf [null, triangle, quadrilateral] - shape_or_null=None, + # 'shapeOrNull' has type 'ShapeOrNull', which is a oneOf [null, triangle, quadrilateral] + shapeOrNull=None, ) assert isinstance(inst, Drawing) - self.assertFalse(hasattr(inst, 'main_shape')) - self.assertTrue(hasattr(inst, 'shape_or_null')) - self.assertIsNone(inst.shape_or_null) - + self.assertFalse('mainShape' in inst) + self.assertTrue('shapeOrNull' in inst) + self.assertTrue(isinstance(inst["shapeOrNull"], NoneClass)) def test_deserialize_oneof_reference_with_nullable_type(self): """ @@ -154,17 +148,18 @@ def test_deserialize_oneof_reference_with_nullable_type(self): OpenAPI 3.0 and deprecated in 3.1). """ - # Validate we can assign the None value to nullable_shape, because the NullableShape + # Validate we can assign the None value to nullableShape, because the NullableShape # has the 'nullable: true' attribute. inst = Drawing( - # 'nullable_shape' has type 'NullableShape', which is a oneOf [triangle, quadrilateral] + # 'nullableShape' has type 'NullableShape', which is a oneOf [triangle, quadrilateral] # and the 'nullable: true' attribute. - nullable_shape=None, + nullableShape=None, ) assert isinstance(inst, Drawing) - self.assertFalse(hasattr(inst, 'main_shape')) - self.assertTrue(hasattr(inst, 'nullable_shape')) - self.assertIsNone(inst.nullable_shape) + self.assertFalse('mainShape' in inst) + self.assertTrue('nullableShape' in inst) + self.assertTrue(isinstance(inst["nullableShape"], NoneClass)) + if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_extra_pool_config_options.py b/samples/openapi3/client/petstore/python/tests_manual/test_extra_pool_config_options.py index 9e49b9e71ba1..5bf6b989ebe2 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_extra_pool_config_options.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_extra_pool_config_options.py @@ -48,9 +48,9 @@ def test_socket_options_get_passed_to_proxy_manager(self): socket_options = ["extra", "socket", "options"] - config = petstore_api.Configuration(host="http://somehost.local:8080") + config = petstore_api.Configuration(host="HOST") config.socket_options = socket_options - config.proxy = "http://proxy.local:8080/" + config.proxy = True with patch("petstore_api.rest.urllib3.ProxyManager", StubProxyManager): api_client = petstore_api.ApiClient(config) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py b/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py index 12e391238e6e..4c2132ae3d85 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py @@ -8,117 +8,56 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ - +from email.mime import multipart +from email.mime import nonmultipart +import io import sys -from collections import namedtuple -import os -import json import unittest +import typing from unittest.mock import patch +import urllib3 import petstore_api -from petstore_api.api.fake_api import FakeApi # noqa: E501 -from petstore_api.rest import RESTClientObject, RESTResponse -from petstore_api.model_utils import file_type, model_to_dict - -HTTPResponse = namedtuple( - 'urllib3_response_HTTPResponse', - ['status', 'reason', 'data', 'getheaders', 'getheader'] -) - -headers = {'Content-Type': 'application/json'} -def get_headers(): - return {} -def get_header(name, default=None): - return {}.get(name, default) - +from petstore_api import api_client, schemas, exceptions +from petstore_api.apis.tags.fake_api import FakeApi # noqa: E501 +from petstore_api.rest import RESTClientObject -class TestFakeApi(unittest.TestCase): - """FakeApi unit test stubs""" +from . import ApiTestMixin - def setUp(self): - self.api = FakeApi() # noqa: E501 - def tearDown(self): - pass +class MIMEFormdata(nonmultipart.MIMENonMultipart): + def __init__(self, keyname, *args, **kwargs): + super(MIMEFormdata, self).__init__(*args, **kwargs) + self.add_header( + "Content-Disposition", "form-data; name=\"%s\"" % keyname) - @staticmethod - def mock_response(body_value): - http_response = HTTPResponse( - status=200, - reason='OK', - data=json.dumps(body_value).encode('utf-8'), - getheaders=get_headers, - getheader=get_header - ) - return RESTResponse(http_response) - @staticmethod - def assert_request_called_with( - mock_method, - url, - accept='application/json', - http_method='POST', - content_type='application/json', - **kwargs - ): - headers = { - 'Accept': accept, - 'User-Agent': 'OpenAPI-Generator/1.0.0/python', - } - if content_type: - headers['Content-Type'] = content_type - used_kwargs = dict( - _preload_content=True, - _request_timeout=None, - headers=headers, - query_params=[] - ) - if 'post_params' in kwargs: - used_kwargs['post_params'] = kwargs['post_params'] - if 'body' in kwargs: - used_kwargs['body'] = kwargs['body'] - if 'post_params' not in used_kwargs: - used_kwargs['post_params'] = [] - mock_method.assert_called_with( - http_method, - url, - **used_kwargs - ) +class TestFakeApi(ApiTestMixin): + """FakeApi unit test stubs""" + configuration = petstore_api.Configuration() + api = FakeApi(api_client=api_client.ApiClient(configuration=configuration)) def test_array_model(self): - """Test case for array_model - - """ from petstore_api.model import animal_farm, animal - endpoint = self.api.array_model_endpoint - assert endpoint.openapi_types['body'] == (animal_farm.AnimalFarm,) - assert endpoint.settings['response_type'] == (animal_farm.AnimalFarm,) # serialization + deserialization works - with patch.object(RESTClientObject, 'request') as mock_method: - cat = animal.Animal(class_name="Cat", color="black") - body = animal_farm.AnimalFarm([cat]) + with patch.object(RESTClientObject, 'request') as mock_request: json_data = [{"className": "Cat", "color": "black"}] - mock_method.return_value = self.mock_response(json_data) + mock_request.return_value = self.response( + self.json_bytes(json_data) + ) - response = self.api.array_model(body=body) + cat = animal.Animal(className="Cat", color="black") + body = animal_farm.AnimalFarm([cat]) + api_response = self.api.array_model(body=body) self.assert_request_called_with( - mock_method, + mock_request, 'http://petstore.swagger.io:80/v2/fake/refs/arraymodel', - body=json_data, + body=self.json_bytes(json_data) ) - assert isinstance(response, animal_farm.AnimalFarm) - assert response == body - - def test_boolean(self): - """Test case for boolean - - """ - endpoint = self.api.boolean_endpoint - assert endpoint.openapi_types['body'] == (bool,) - assert endpoint.settings['response_type'] == (bool,) + assert isinstance(api_response.body, animal_farm.AnimalFarm) + assert api_response.body == body def test_recursionlimit(self): """Test case for recursionlimit @@ -126,660 +65,741 @@ def test_recursionlimit(self): """ assert sys.getrecursionlimit() == 1234 - def test_fake_health_get(self): - """Test case for fake_health_get - - Health check endpoint # noqa: E501 - """ - pass - - def test_additional_properties_with_array_of_enums(self): - """Test case for additional_properties_with_array_of_enums - - Additional Properties with Array of Enums # noqa: E501 - """ - pass - - def test_enum_test(self): - """Test case for enum_test - - Object contains enum properties and array properties containing enums - """ - from petstore_api.model.enum_test import EnumTest - from petstore_api.model.string_enum import StringEnum - from petstore_api.model.array_of_enums import ArrayOfEnums - - endpoint = self.api.enum_test_endpoint - assert endpoint.openapi_types['enum_test'] == (EnumTest,) - assert endpoint.settings['response_type'] == (EnumTest,) - - # serialization + deserialization works w/ inline array - with patch.object(RESTClientObject, 'request') as mock_method: - body = EnumTest( - enum_string_required='lower', - inline_array_of_str_enum=[StringEnum('approved')] - ) - json_value = {'enum_string_required': 'lower', 'InlineArrayOfStrEnum': ['approved']} - mock_method.return_value = self.mock_response(json_value) - - response = self.api.enum_test(enum_test=body) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/refs/enum-test', - body=json_value, - ) - - assert isinstance(response, EnumTest) - assert response == body - - # serialization + deserialization works w/ refed array - with patch.object(RESTClientObject, 'request') as mock_method: - body = EnumTest( - enum_string_required='lower', - array_of_str_enum=ArrayOfEnums([StringEnum('approved')]) - ) - json_value = {'enum_string_required': 'lower', 'ArrayOfStrEnum': ['approved']} - mock_method.return_value = self.mock_response(json_value) - - response = self.api.enum_test(enum_test=body) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/refs/enum-test', - body=json_value, - ) - - assert isinstance(response, EnumTest) - assert response == body - - def test_array_of_enums(self): - """Test case for array_of_enums - - Array of Enums # noqa: E501 - """ from petstore_api.model import array_of_enums, string_enum - endpoint = self.api.array_of_enums_endpoint - assert endpoint.openapi_types['array_of_enums'] == (array_of_enums.ArrayOfEnums,) - assert endpoint.settings['response_type'] == (array_of_enums.ArrayOfEnums,) # serialization + deserialization works - with patch.object(RESTClientObject, 'request') as mock_method: + with patch.object(RESTClientObject, 'request') as mock_request: value = [string_enum.StringEnum("placed")] body = array_of_enums.ArrayOfEnums(value) value_simple = ["placed"] - mock_method.return_value = self.mock_response(value_simple) + mock_request.return_value = self.response( + self.json_bytes(value_simple) + ) - response = self.api.array_of_enums(array_of_enums=body) + api_response = self.api.array_of_enums(body=body) self.assert_request_called_with( - mock_method, + mock_request, 'http://petstore.swagger.io:80/v2/fake/refs/array-of-enums', - body=value_simple, + body=self.json_bytes(value_simple) ) - assert isinstance(response, array_of_enums.ArrayOfEnums) - assert response.value == value + assert isinstance(api_response.body, array_of_enums.ArrayOfEnums) + assert api_response.body == body def test_number_with_validations(self): - """Test case for number_with_validations - - """ from petstore_api.model import number_with_validations - endpoint = self.api.number_with_validations_endpoint - assert endpoint.openapi_types['body'] == (number_with_validations.NumberWithValidations,) - assert endpoint.settings['response_type'] == (number_with_validations.NumberWithValidations,) # serialization + deserialization works - with patch.object(RESTClientObject, 'request') as mock_method: + with patch.object(RESTClientObject, 'request') as mock_request: value = 10.0 body = number_with_validations.NumberWithValidations(value) - mock_method.return_value = self.mock_response(value) + mock_request.return_value = self.response( + self.json_bytes(value) + ) - response = self.api.number_with_validations(body=body) + api_response = self.api.number_with_validations(body=body) self.assert_request_called_with( - mock_method, + mock_request, 'http://petstore.swagger.io:80/v2/fake/refs/number', - body=value, + body=self.json_bytes(value) ) - assert isinstance(response, number_with_validations.NumberWithValidations) - assert response.value == value - - def test_object_model_with_ref_props(self): - """Test case for object_model_with_ref_props + assert isinstance(api_response.body, number_with_validations.NumberWithValidations) + assert api_response.body == value - """ - from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps - from petstore_api.model.number_with_validations import NumberWithValidations - endpoint = self.api.object_model_with_ref_props_endpoint - assert endpoint.openapi_types['body'] == (ObjectModelWithRefProps,) - assert endpoint.settings['response_type'] == (ObjectModelWithRefProps,) - - json_payloads = [ - {}, # only required + no optional properties works - { # optional properties works - "my_number": 11.0, - "my_string": 'a', - "my_boolean": True, - } - ] - # instantiation works - expected_models = [ - ObjectModelWithRefProps(), - ObjectModelWithRefProps( - my_number=NumberWithValidations(11.0), - my_string='a', - my_boolean=True - ) - ] + def test_composed_one_of_different_types(self): + from petstore_api.model import composed_one_of_different_types - pairs = zip(json_payloads, expected_models) # serialization + deserialization works - for (json_payload, expected_model) in pairs: - with patch.object(RESTClientObject, 'request') as mock_method: - mock_method.return_value = self.mock_response(json_payload) + number = composed_one_of_different_types.ComposedOneOfDifferentTypes(10.0) + cat = composed_one_of_different_types.ComposedOneOfDifferentTypes( + className="Cat", color="black" + ) + none_instance = composed_one_of_different_types.ComposedOneOfDifferentTypes(None) + date_instance = composed_one_of_different_types.ComposedOneOfDifferentTypes('1970-01-01') + cast_to_simple_value = [ + (number, 10.0), + (cat, {"className": "Cat", "color": "black"}), + (none_instance, None), + (date_instance, '1970-01-01'), + ] + for (body, value_simple) in cast_to_simple_value: + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = self.response( + self.json_bytes(value_simple) + ) - response = self.api.object_model_with_ref_props(body=expected_model) + api_response = self.api.composed_one_of_different_types(body=body) self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/refs/object_model_with_ref_props', - body=json_payload, + mock_request, + 'http://petstore.swagger.io:80/v2/fake/refs/composed_one_of_number_with_validations', + body=self.json_bytes(value_simple) ) - assert isinstance(response, expected_model.__class__) - assert response == expected_model + assert isinstance(api_response.body, composed_one_of_different_types.ComposedOneOfDifferentTypes) + assert api_response.body == body - def test_composed_one_of_number_with_validations(self): - """Test case for composed_one_of_number_with_validations - - """ - from petstore_api.model import animal, composed_one_of_number_with_validations, number_with_validations - endpoint = self.api.composed_one_of_number_with_validations_endpoint - assert endpoint.openapi_types['composed_one_of_number_with_validations'] == ( - composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,) - assert endpoint.settings['response_type'] == ( - composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,) - - # serialization + deserialization works - num_with_validations = number_with_validations.NumberWithValidations(10.0) - cat_in_composed = composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations( - class_name="Cat", color="black" - ) - import datetime - date = datetime.date(1970, 1, 1) - body_value_simple = [ - (num_with_validations, 10.0), - (cat_in_composed, {"className": "Cat", "color": "black"}), - (None, None), - (date, '1970-01-01'), - ] - for (body, value_simple) in body_value_simple: - with patch.object(RESTClientObject, 'request') as mock_method: - mock_method.return_value = self.mock_response(value_simple) + # inputting the uncast values into the endpoint also works + for (body, value_simple) in cast_to_simple_value: + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = self.response( + self.json_bytes(value_simple) + ) - response = self.api.composed_one_of_number_with_validations(composed_one_of_number_with_validations=body) + api_response = self.api.composed_one_of_different_types(body=value_simple) self.assert_request_called_with( - mock_method, + mock_request, 'http://petstore.swagger.io:80/v2/fake/refs/composed_one_of_number_with_validations', - body=value_simple, + body=self.json_bytes(value_simple) ) - assert isinstance(response, body.__class__) - assert response == body + assert isinstance(api_response.body, composed_one_of_different_types.ComposedOneOfDifferentTypes) + assert api_response.body == body def test_string(self): - """Test case for string - - """ - endpoint = self.api.string_endpoint - assert endpoint.openapi_types['body'] == (str,) - assert endpoint.settings['response_type'] == (str,) - # serialization + deserialization works - with patch.object(RESTClientObject, 'request') as mock_method: + with patch.object(RESTClientObject, 'request') as mock_request: body = "blah" value_simple = body - mock_method.return_value = self.mock_response(value_simple) + mock_request.return_value = self.response( + self.json_bytes(value_simple) + ) - response = self.api.string(body=body) + api_response = self.api.string(body=body) self.assert_request_called_with( - mock_method, + mock_request, 'http://petstore.swagger.io:80/v2/fake/refs/string', - body=value_simple, + body=self.json_bytes(value_simple) ) - assert isinstance(response, str) - assert response == value_simple + assert isinstance(api_response.body, str) + assert api_response.body == value_simple def test_string_enum(self): - """Test case for string_enum - - """ from petstore_api.model import string_enum - endpoint = self.api.string_enum_endpoint - assert endpoint.openapi_types['body'] == (string_enum.StringEnum,) - assert endpoint.settings['response_type'] == (string_enum.StringEnum,) - # serialization + deserialization works - from petstore_api.rest import RESTClientObject, RESTResponse - with patch.object(RESTClientObject, 'request') as mock_method: + with patch.object(RESTClientObject, 'request') as mock_request: value = "placed" body = string_enum.StringEnum(value) - mock_method.return_value = self.mock_response(value) + mock_request.return_value = self.response( + self.json_bytes(value) + ) - response = self.api.string_enum(body=body) + api_response = self.api.string_enum(body=body) self.assert_request_called_with( - mock_method, + mock_request, 'http://petstore.swagger.io:80/v2/fake/refs/enum', - body=value, + body=self.json_bytes(value) + ) + + assert isinstance(api_response.body, string_enum.StringEnum) + assert api_response.body == value + + def test_mammal(self): + # serialization + deserialization works + from petstore_api.model.mammal import Mammal + with patch.object(RESTClientObject, 'request') as mock_request: + body = Mammal(className="BasquePig") + value_simple = dict(className='BasquePig') + mock_request.return_value = self.response( + self.json_bytes(value_simple) + ) + + api_response = self.api.mammal(body=body) + self.assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/refs/mammal', + body=self.json_bytes(value_simple) + ) + + assert isinstance(api_response.body, Mammal) + assert api_response.body == value_simple + + def test_missing_or_unset_required_body(self): + # missing required body + with self.assertRaises(TypeError): + self.api.mammal() + # required body may not be unset + with self.assertRaises(petstore_api.ApiValueError): + self.api.mammal(body=schemas.unset) + + def test_missing_or_unset_required_query_parameter(self): + from petstore_api.model.user import User + user = User({}) + # missing required query param + with self.assertRaises(petstore_api.ApiTypeError): + self.api.body_with_query_params(body=user) + # required query param may not be unset + with self.assertRaises(petstore_api.ApiValueError): + self.api.body_with_query_params(body=schemas.unset, query_params=dict(query=schemas.unset)) + + def test_body_with_query_params(self): + from petstore_api.model import user + with patch.object(RESTClientObject, 'request') as mock_request: + + value_simple = dict( + id=1, + username='first last', + firstName='first', + lastName='last' + ) + body = user.User(**value_simple) + mock_request.return_value = self.response( + b'' + ) + + api_response = self.api.body_with_query_params( + body=body, + query_params=dict(query='hi there') + ) + self.assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/body-with-query-params?query=hi%20there', + method='PUT', + body=self.json_bytes(value_simple), + accept_content_type=None + ) + + assert isinstance(api_response.body, api_client.Unset) + assert api_response.response.status == 200 + + def test_upload_download_file_tx_bytes_and_file(self): + """Test case for upload_download_file + uploads a file and downloads a file using application/octet-stream # noqa: E501 + """ + import os + test_file_dir = os.path.realpath( + os.path.join(os.path.dirname(__file__), "..", "testfiles")) + file_name = '1px_pic1.png' + file_path1 = os.path.join(test_file_dir, file_name) + + with open(file_path1, "rb") as some_file: + file_bytes = some_file.read() + file1 = open(file_path1, "rb") + mock_response = self.response( + file_bytes, + content_type='application/octet-stream' + ) + try: + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = mock_response + api_response = self.api.upload_download_file(body=file1) + self.assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/uploadDownloadFile', + body=file_bytes, + content_type='application/octet-stream', + accept_content_type='application/octet-stream' + ) + self.assertTrue(isinstance(api_response.body, schemas.BinarySchema)) + self.assertTrue(isinstance(api_response.body, schemas.BytesSchema)) + self.assertTrue(isinstance(api_response.body, bytes)) + self.assertEqual(api_response.body, file_bytes) + except petstore_api.ApiException as e: + self.fail("upload_file() raised {0} unexpectedly".format(type(e))) + finally: + file1.close() + + # sending just bytes works also + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = mock_response + api_response = self.api.upload_download_file(body=file_bytes) + self.assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/uploadDownloadFile', + body=file_bytes, + content_type='application/octet-stream', + accept_content_type='application/octet-stream' + ) + self.assertEqual(api_response.body, file_bytes) + + def test_upload_download_file_rx_file(self): + import os + test_file_dir = os.path.realpath( + os.path.join(os.path.dirname(__file__), "..", "testfiles")) + file_name = '1px_pic1.png' + file_path1 = os.path.join(test_file_dir, file_name) + + with open(file_path1, "rb") as some_file: + file_bytes = some_file.read() + + # passing in file1 as the response body simulates a streamed response + file1 = open(file_path1, "rb") + + class StreamableBody: + """ + This class simulates http.client.HTTPResponse for a streamable response + """ + def __init__(self, file: io.BufferedReader): + self.fp = file + + def read(self, *args, **kwargs): + return self.fp.read(*args, **kwargs) + + def close(self): + self.fp.close() + + streamable_body = StreamableBody(file1) + + mock_response = self.response( + streamable_body, + content_type='application/octet-stream', + preload_content=False + ) + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = mock_response + api_response = self.api.upload_download_file(body=file_bytes, stream=True) + self.assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/uploadDownloadFile', + body=file_bytes, + content_type='application/octet-stream', + accept_content_type='application/octet-stream', + stream=True ) + self.assertTrue(file1.closed) + self.assertTrue(isinstance(api_response.body, schemas.BinarySchema)) + self.assertTrue(isinstance(api_response.body, schemas.FileSchema)) + self.assertTrue(isinstance(api_response.body, schemas.FileIO)) + self.assertEqual(api_response.body.read(), file_bytes) + api_response.body.close() + os.unlink(api_response.body.name) - assert isinstance(response, string_enum.StringEnum) - assert response.value == value + file1 = open(file_path1, "rb") + streamable_body = StreamableBody(file1) + saved_file_name = "fileName.abc" + + """ + when streaming is used and the response contains the content disposition header with a filename + that filename is used when saving the file locally + """ + mock_response = self.response( + streamable_body, + content_type='application/octet-stream', + headers={'content-disposition': f'attachment; filename="{saved_file_name}"'}, + preload_content=False + ) + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = mock_response + api_response = self.api.upload_download_file(body=file_bytes, stream=True) + self.assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/uploadDownloadFile', + body=file_bytes, + content_type='application/octet-stream', + accept_content_type='application/octet-stream', + stream=True + ) + self.assertTrue(file1.closed) + self.assertTrue(isinstance(api_response.body, schemas.BinarySchema)) + self.assertTrue(isinstance(api_response.body, schemas.FileSchema)) + self.assertTrue(isinstance(api_response.body, schemas.FileIO)) + self.assertTrue(api_response.body.name.endswith(saved_file_name)) + self.assertEqual(api_response.body.read(), file_bytes) + api_response.body.close() + os.unlink(api_response.body.name) + + """ + when streaming is used and the response contains the content disposition header without a filename + the url of response is used to extract the filename. + """ + file1 = open(file_path1, "rb") + streamable_body = StreamableBody(file1) + expected_filename = "the_file.ext" + + no_filename_mock_response = self.response( + streamable_body, + content_type='application/octet-stream', + headers={'content-disposition': 'attachment'}, + preload_content=False + ) + + with patch.object(RESTClientObject, 'request') as mock_request: + no_filename_mock_response.geturl = lambda: f'http://foo.bar/{expected_filename}' + mock_request.return_value = no_filename_mock_response + api_response = self.api.upload_download_file(body=file_bytes, stream=True) + self.assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/uploadDownloadFile', + body=file_bytes, + content_type='application/octet-stream', + accept_content_type='application/octet-stream', + stream=True + ) + self.assertTrue(file1.closed) + self.assertTrue(isinstance(api_response.body, schemas.BinarySchema)) + self.assertTrue(isinstance(api_response.body, schemas.FileSchema)) + self.assertTrue(isinstance(api_response.body, schemas.FileIO)) + self.assertTrue(api_response.body.name.endswith(expected_filename)) + self.assertEqual(api_response.body.read(), file_bytes) + api_response.body.close() + os.unlink(api_response.body.name) def test_upload_file(self): - # uploads a file + """Test case for upload_file + uploads a file using multipart/form-data # noqa: E501 + """ + import os test_file_dir = os.path.realpath( os.path.join(os.path.dirname(__file__), "..", "testfiles")) - file_path1 = os.path.join(test_file_dir, "1px_pic1.png") - - headers = {} - def get_headers(): - return headers - def get_header(name, default=None): - return headers.get(name, default) - api_respponse = { + file_name = '1px_pic1.png' + file_path1 = os.path.join(test_file_dir, file_name) + + with open(file_path1, "rb") as some_file: + file_bytes = some_file.read() + file1 = open(file_path1, "rb") + response_json = { 'code': 200, 'type': 'blah', 'message': 'file upload succeeded' } - http_response = HTTPResponse( - status=200, - reason='OK', - data=json.dumps(api_respponse).encode('utf-8'), - getheaders=get_headers, - getheader=get_header - ) - mock_response = RESTResponse(http_response) - file1 = open(file_path1, "rb") try: - with patch.object(RESTClientObject, 'request') as mock_method: - mock_method.return_value = mock_response - res = self.api.upload_file( - file=file1) - body = None - post_params=[ - ('file', ('1px_pic1.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png')), - ] + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = self.response( + self.json_bytes(response_json) + ) + api_response = self.api.upload_file(body={'file': file1}) self.assert_request_called_with( - mock_method, + mock_request, 'http://petstore.swagger.io:80/v2/fake/uploadFile', - body=body, post_params=post_params, content_type='multipart/form-data' + fields=( + api_client.RequestField( + name='file', + data=file_bytes, + filename=file_name, + headers={'Content-Type': 'application/octet-stream'} + ), + ), + content_type='multipart/form-data' ) + self.assertEqual(api_response.body, response_json) except petstore_api.ApiException as e: self.fail("upload_file() raised {0} unexpectedly".format(type(e))) finally: file1.close() + # sending just bytes works also + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = self.response( + self.json_bytes(response_json) + ) + api_response = self.api.upload_file(body={'file': file_bytes}) + self.assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/uploadFile', + fields=( + api_client.RequestField( + name='file', + data=file_bytes, + headers={'Content-Type': 'application/octet-stream'} + ), + ), + content_type='multipart/form-data' + ) + self.assertEqual(api_response.body, response_json) + # passing in an array of files to when file only allows one # raises an exceptions try: file = open(file_path1, "rb") - with self.assertRaises(petstore_api.ApiTypeError) as exc: - self.api.upload_file(file=[file]) + with self.assertRaises(petstore_api.ApiTypeError): + self.api.upload_file(body={'file': [file]}) finally: file.close() # passing in a closed file raises an exception - with self.assertRaises(petstore_api.ApiValueError) as exc: + with self.assertRaises(ValueError): file = open(file_path1, "rb") file.close() - self.api.upload_file(file=file) + self.api.upload_file(body={'file': file}) def test_upload_files(self): + """Test case for upload_files + uploads files using multipart/form-data # noqa: E501 + """ + import os test_file_dir = os.path.realpath( os.path.join(os.path.dirname(__file__), "..", "testfiles")) - file_path1 = os.path.join(test_file_dir, "1px_pic1.png") - file_path2 = os.path.join(test_file_dir, "1px_pic2.png") - - headers = {} - def get_headers(): - return headers - def get_header(name, default=None): - return headers.get(name, default) - api_respponse = { + file_name = '1px_pic1.png' + file_path1 = os.path.join(test_file_dir, file_name) + + with open(file_path1, "rb") as some_file: + file_bytes = some_file.read() + file1 = open(file_path1, "rb") + file2 = open(file_path1, "rb") + response_json = { 'code': 200, 'type': 'blah', 'message': 'file upload succeeded' } - http_response = HTTPResponse( - status=200, - reason='OK', - data=json.dumps(api_respponse).encode('utf-8'), - getheaders=get_headers, - getheader=get_header - ) - mock_response = RESTResponse(http_response) - file1 = open(file_path1, "rb") - file2 = open(file_path2, "rb") try: - with patch.object(RESTClientObject, 'request') as mock_method: - mock_method.return_value = mock_response - res = self.api.upload_files( - files=[file1, file2]) - post_params=[ - ('files', ('1px_pic1.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png')), - ('files', ('1px_pic2.png', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x00\x00\x00\x00:~\x9bU\x00\x00\x00\nIDATx\x9cc\xfa\x0f\x00\x01\x05\x01\x02\xcf\xa0.\xcd\x00\x00\x00\x00IEND\xaeB`\x82', 'image/png')) - ] + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = self.response( + self.json_bytes(response_json) + ) + api_response = self.api.upload_files(body={'files': [file1, file2]}) self.assert_request_called_with( - mock_method, + mock_request, 'http://petstore.swagger.io:80/v2/fake/uploadFiles', - body=None, post_params=post_params, content_type='multipart/form-data' + fields=( + api_client.RequestField( + name='files', + data=file_bytes, + filename=file_name, + headers={'Content-Type': 'application/octet-stream'} + ), + api_client.RequestField( + name='files', + data=file_bytes, + filename=file_name, + headers={'Content-Type': 'application/octet-stream'} + ), + ), + content_type='multipart/form-data' ) + self.assertEqual(api_response.body, response_json) except petstore_api.ApiException as e: self.fail("upload_file() raised {0} unexpectedly".format(type(e))) finally: file1.close() file2.close() - # passing in a single file when an array of file is required - # raises an exception - try: - file = open(file_path1, "rb") - with self.assertRaises(petstore_api.ApiTypeError) as exc: - self.api.upload_files(files=file) - finally: - file.close() - - def test_download_attachment(self): - """Ensures that file deserialization works""" - - # sample from http://www.jtricks.com/download-text - file_name = 'content.txt' - headers_dict = { - 'with_filename': {'Content-Disposition': 'attachment; filename={}'.format(file_name), 'Content-Type': 'text/plain'}, - 'no_filename': {'Content-Disposition': 'attachment;', 'Content-Type': 'text/plain'} - } - def get_headers(*args): - return args - file_data = ( - "You are reading text file that was supposed to be downloaded\r\n" - "to your hard disk. If your browser offered to save you the file," - "\r\nthen it handled the Content-Disposition header correctly." - ) - for key, headers in headers_dict.items(): - def get_header(name, default=None): - return headers_dict[key].get(name, default) - http_response = HTTPResponse( - status=200, - reason='OK', - data=file_data, - getheaders=get_headers(headers), - getheader=get_header - ) - # deserialize response to a file - mock_response = RESTResponse(http_response) - with patch.object(RESTClientObject, 'request') as mock_method: - mock_method.return_value = mock_response - try: - file_object = self.api.download_attachment(file_name='download-text') - self.assert_request_called_with( - mock_method, - 'http://www.jtricks.com/download-text', - http_method='GET', - accept='text/plain', - content_type=None, - ) - self.assertTrue(isinstance(file_object, file_type)) - self.assertFalse(file_object.closed) - self.assertEqual(file_object.read(), file_data.encode('utf-8')) - finally: - file_object.close() - os.unlink(file_object.name) - - def test_upload_download_file(self): - test_file_dir = os.path.realpath( - os.path.join(os.path.dirname(__file__), "..", "testfiles")) - file_path1 = os.path.join(test_file_dir, "1px_pic1.png") - - with open(file_path1, "rb") as f: - expected_file_data = f.read() - - headers = {'Content-Type': 'application/octet-stream'} - def get_headers(): - return headers - def get_header(name, default=None): - return headers.get(name, default) - http_response = HTTPResponse( - status=200, - reason='OK', - data=expected_file_data, - getheaders=get_headers, - getheader=get_header - ) - mock_response = RESTResponse(http_response) - file1 = open(file_path1, "rb") - try: - with patch.object(RESTClientObject, 'request') as mock_method: - mock_method.return_value = mock_response - downloaded_file = self.api.upload_download_file(body=file1) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/uploadDownloadFile', - body=expected_file_data, - content_type='application/octet-stream', - accept='application/octet-stream' - ) - - self.assertTrue(isinstance(downloaded_file, file_type)) - self.assertFalse(downloaded_file.closed) - self.assertEqual(downloaded_file.read(), expected_file_data) - except petstore_api.ApiException as e: - self.fail("upload_download_file() raised {0} unexpectedly".format(type(e))) - finally: - file1.close() - downloaded_file.close() - os.unlink(downloaded_file.name) - - 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_post_inline_additional_properties_ref_payload(self): - """Test case for postInlineAdditionlPropertiesRefPayload - """ - from petstore_api.model.inline_additional_properties_ref_payload import InlineAdditionalPropertiesRefPayload - from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner - endpoint = self.api.post_inline_additional_properties_ref_payload_endpoint - assert endpoint.openapi_types['inline_additional_properties_ref_payload'] == (InlineAdditionalPropertiesRefPayload,) - assert endpoint.settings['response_type'] == (InlineAdditionalPropertiesRefPayload,) - - # serialization + deserialization works - from petstore_api.rest import RESTClientObject, RESTResponse - with patch.object(RESTClientObject, 'request') as mock_method: - expected_json_body = { - 'arrayData': [ - { - 'labels': [ - None, - 'foo' - ] - } - ] - } - inline_additional_properties_ref_payload = InlineAdditionalPropertiesRefPayload( - array_data=[ - PostInlineAdditionalPropertiesPayloadRequestArrayDataInner(labels=[None, 'foo']) - ] + # sending just bytes works also + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = self.response( + self.json_bytes(response_json) ) - mock_method.return_value = self.mock_response(expected_json_body) - - response = self.api.post_inline_additional_properties_ref_payload(inline_additional_properties_ref_payload=inline_additional_properties_ref_payload) + api_response = self.api.upload_files(body={'files': [file_bytes, file_bytes]}) self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/postInlineAdditionalPropertiesRefPayload', - body=expected_json_body + mock_request, + 'http://petstore.swagger.io:80/v2/fake/uploadFiles', + fields=( + api_client.RequestField( + name='files', + data=file_bytes, + headers={'Content-Type': 'application/octet-stream'} + ), + api_client.RequestField( + name='files', + data=file_bytes, + headers={'Content-Type': 'application/octet-stream'} + ), + ), + content_type='multipart/form-data' ) + self.assertEqual(api_response.body, response_json) - assert isinstance(response, InlineAdditionalPropertiesRefPayload) - assert model_to_dict(response) == expected_json_body + @staticmethod + def __encode_multipart_formdata(fields: typing.Dict[str, typing.Any]) -> multipart.MIMEMultipart: + m = multipart.MIMEMultipart("form-data") + + for field, value in fields.items(): + data = MIMEFormdata(field, "text", "plain") + # data.set_payload(value, charset='us-ascii') + data.set_payload(value) + m.attach(data) + + return m + + @patch.object(RESTClientObject, 'request') + def test_inline_composition(self, mock_request): + """Test case for inline_composition + + testing composed schemas at inline locations # noqa: E501 + """ + single_char_str = 'a' + json_bytes = self.json_bytes(single_char_str) + + # tx and rx json with composition at root level of schema for request + response body + content_type = 'application/json' + mock_request.return_value = self.response( + json_bytes + ) + api_response = self.api.inline_composition( + body=single_char_str, + query_params={ + 'compositionAtRoot': single_char_str, + 'compositionInProperty': {'someProp': single_char_str} + }, + accept_content_types=(content_type,) + ) + self.assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/inlineComposition/?compositionAtRoot=a&someProp=a', + accept_content_type=content_type, + content_type=content_type, + body=json_bytes + ) + self.assertEqual(api_response.body, single_char_str) + self.assertTrue(isinstance(api_response.body, schemas.StrSchema)) + + # tx and rx json with composition at property level of schema for request + response body + content_type = 'multipart/form-data' + multipart_response = self.__encode_multipart_formdata(fields={'someProp': single_char_str}) + mock_request.return_value = self.response( + bytes(multipart_response), + content_type=multipart_response.get_content_type() + ) + api_response = self.api.inline_composition( + body={'someProp': single_char_str}, + query_params={ + 'compositionAtRoot': single_char_str, + 'compositionInProperty': {'someProp': single_char_str} + }, + content_type=content_type, + accept_content_types=(content_type,) + ) + self.assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/inlineComposition/?compositionAtRoot=a&someProp=a', + accept_content_type=content_type, + content_type=content_type, + fields=( + api_client.RequestField( + name='someProp', + data=single_char_str, + headers={'Content-Type': 'text/plain'} + ), + ), + ) + self.assertEqual(api_response.body, {'someProp': single_char_str}) + self.assertTrue(isinstance(api_response.body["someProp"], schemas.StrSchema)) + + # error thrown when a str is input which doesn't meet the composed schema length constraint + invalid_value = '' + variable_locations = 4 + for invalid_index in range(variable_locations): + values = [single_char_str]*variable_locations + values[invalid_index] = invalid_value + with self.assertRaises(exceptions.ApiValueError): + multipart_response = self.__encode_multipart_formdata(fields={'someProp': values[0]}) + mock_request.return_value = self.response( + bytes(multipart_response), + content_type=multipart_response.get_content_type() + ) + self.api.inline_composition( + body={'someProp': values[1]}, + query_params={ + 'compositionAtRoot': values[2], + 'compositionInProperty': {'someProp': values[3]} + }, + content_type=content_type, + accept_content_types=(content_type,) + ) + + def test_json_with_charset(self): + # serialization + deserialization of json with charset works + with patch.object(RESTClientObject, 'request') as mock_request: + body = None + content_type_with_charset = 'application/json; charset=utf-8' + mock_request.return_value = self.response( + self.json_bytes(body), + content_type=content_type_with_charset + ) - def test_post_inline_additional_properties_payload(self): - """Test case for postInlineAdditionlPropertiesPayload - """ - from petstore_api.model.post_inline_additional_properties_payload_request import PostInlineAdditionalPropertiesPayloadRequest - from petstore_api.model.post_inline_additional_properties_payload_request_array_data_inner import PostInlineAdditionalPropertiesPayloadRequestArrayDataInner - endpoint = self.api.post_inline_additional_properties_payload_endpoint - assert endpoint.openapi_types['post_inline_additional_properties_payload_request'] == (PostInlineAdditionalPropertiesPayloadRequest,) - assert endpoint.settings['response_type'] == (PostInlineAdditionalPropertiesPayloadRequest,) + api_response = self.api.json_with_charset(body=body) + self.assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/jsonWithCharset', + body=self.json_bytes(body), + content_type=content_type_with_charset, + accept_content_type=content_type_with_charset + ) - # serialization + deserialization works - from petstore_api.rest import RESTClientObject, RESTResponse - with patch.object(RESTClientObject, 'request') as mock_method: - expected_json_body = { - 'arrayData': [ - { - 'labels': [ - None, - 'foo' - ] - } - ] - } - post_inline_additional_properties_payload_request = PostInlineAdditionalPropertiesPayloadRequest( - array_data=[ - PostInlineAdditionalPropertiesPayloadRequestArrayDataInner(labels=[None, 'foo']) - ] + assert isinstance(api_response.body, schemas.AnyTypeSchema) + assert isinstance(api_response.body, schemas.NoneClass) + assert api_response.body.is_none_oapg() + + def test_response_without_schema(self): + # received response is not loaded into body because there is no deserialization schema defined + with patch.object(RESTClientObject, 'request') as mock_request: + body = None + content_type = 'application/json' + mock_request.return_value = self.response( + self.json_bytes(body), ) - mock_method.return_value = self.mock_response(expected_json_body) - response = self.api.post_inline_additional_properties_payload(post_inline_additional_properties_payload_request=post_inline_additional_properties_payload_request) + api_response = self.api.response_without_schema() self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/postInlineAdditionalPropertiesPayload', - body=expected_json_body + mock_request, + 'http://petstore.swagger.io:80/v2/fake/responseWithoutSchema', + method='GET', + accept_content_type='application/json, application/xml', + content_type=None ) - assert isinstance(response, PostInlineAdditionalPropertiesPayloadRequest) - assert model_to_dict(response) == expected_json_body + assert isinstance(api_response.body, schemas.Unset) - def test_post_tx_rx_any_of_payload(self): - """Test case for postInlineAdditionlPropertiesPayload - """ - from petstore_api.model.gm_fruit_no_properties import GmFruitNoProperties - endpoint = self.api.tx_rx_any_of_model_endpoint - assert endpoint.openapi_types['gm_fruit_no_properties'] == (GmFruitNoProperties,) - assert endpoint.settings['response_type'] == (GmFruitNoProperties,) - # serialization + deserialization works - from petstore_api.rest import RESTClientObject, RESTResponse - with patch.object(RESTClientObject, 'request') as mock_method: - expected_json_body = { - 'cultivar': 'Alice', - 'origin': 'Kazakhstan', - 'lengthCm': 7, - } - fruit = GmFruitNoProperties(**expected_json_body) - mock_method.return_value = self.mock_response(expected_json_body) - - response = self.api.tx_rx_any_of_model(gm_fruit_no_properties=fruit) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/TxRxAnyOfModel', - body=expected_json_body + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = self.response( + 'blah', + content_type='text/plain' ) - assert isinstance(response, GmFruitNoProperties) - assert model_to_dict(response) == expected_json_body + # when an incorrect content-type is sent back, and exception is raised + with self.assertRaises(exceptions.ApiValueError): + self.api.response_without_schema() - def test_post_tx_rx_all_of_payload(self): - """Test case for postInlineAdditionlPropertiesPayload - """ - from petstore_api.model.stream_options import StreamOptions - from petstore_api.model.publish_options_publish import PublishOptionsPublish - endpoint = self.api.tx_rx_all_of_model_endpoint - assert endpoint.openapi_types['stream_options'] == (StreamOptions,) - assert endpoint.settings['response_type'] == (StreamOptions,) + def test_delete_endpoint_without_request_body(self): + with patch.object(urllib3.PoolManager, 'request') as mock_request: - # serialization + deserialization works - from petstore_api.rest import RESTClientObject, RESTResponse - with patch.object(RESTClientObject, 'request') as mock_method: - expected_json_body = { - "egressThresholds": { - "person":0.8 - }, - "publish": { - "egressUnknownDetections": False - } - } - stream_option_instance = StreamOptions(**expected_json_body) - mock_method.return_value = self.mock_response(expected_json_body) - - response = self.api.tx_rx_all_of_model(stream_options=stream_option_instance) - self.assert_request_called_with( - mock_method, - 'http://petstore.swagger.io:80/v2/fake/TxRxAllOfModel', - body=expected_json_body + body = None + mock_request.return_value = self.response( + self.json_bytes(body), + ) + + api_response = self.api.delete_coffee(path_params=dict(id='1')) + self.assert_pool_manager_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/deleteCoffee/1', + method='DELETE', + content_type=None, + accept_content_type=None, ) - assert isinstance(response, StreamOptions) - assert model_to_dict(response) == expected_json_body - assert response.publish == PublishOptionsPublish(**{"egress_unknown_detections": False}) + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, schemas.Unset) + assert isinstance(api_response.headers, schemas.Unset) + + def test_json_patch(self): + with patch.object(urllib3.PoolManager, 'request') as mock_request: + from petstore_api.model import json_patch_request + from petstore_api.model import json_patch_request_add_replace_test + + mock_request.return_value = self.response("") + body = json_patch_request.JSONPatchRequest( + [ + json_patch_request_add_replace_test.JSONPatchRequestAddReplaceTest( + op='add', + path='/a/b/c', + value='foo', + ) + ] + ) + api_response = self.api.json_patch(body) + json_body = [ + { + 'op': 'add', + 'path': '/a/b/c', + 'value': 'foo' + } + ] + self.assert_pool_manager_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/jsonPatch', + body=self.json_bytes(json_body), + method='PATCH', + content_type='application/json-patch+json', + accept_content_type=None, + ) + + assert isinstance(api_response.response, urllib3.HTTPResponse) + assert isinstance(api_response.body, schemas.Unset) + assert isinstance(api_response.headers, schemas.Unset) + assert api_response.response.status == 200 + if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_format_test.py b/samples/openapi3/client/petstore/python/tests_manual/test_format_test.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_format_test.py rename to samples/openapi3/client/petstore/python/tests_manual/test_format_test.py diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_fruit.py b/samples/openapi3/client/petstore/python/tests_manual/test_fruit.py index a0f97a4a97dc..6f1a22655534 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_fruit.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_fruit.py @@ -9,238 +9,125 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api from petstore_api.model import apple from petstore_api.model import banana from petstore_api.model.fruit import Fruit +from petstore_api import schemas class TestFruit(unittest.TestCase): """Fruit unit test stubs""" - length_cm = 20.3 - color = 'yellow' - - - def setUp(self): - pass - - def tearDown(self): - pass - - def test_fruit_with_additional_props(self): - # including extra parameters works because the oneOf models include additionalProperties - some_value = 'some_value' - some_fruit = Fruit( - color=self.color, - length_cm=self.length_cm, - unknown_property=some_value - ) - assert some_fruit['unknown_property'] == some_value - - def test_fruit_assigning_additional_props_in_client(self): - # setting a value that doesn't exist works because additional_properties_type allows any type - other_fruit = Fruit(length_cm=self.length_cm, color=self.color) - blah = 'blah' - other_fruit['a'] = blah - assert other_fruit.a == blah - - # with setattr - setattr(other_fruit, 'b', blah) - assert other_fruit.b == blah - - self.assertEqual( - other_fruit.to_dict(), - { - 'a': 'blah', - 'b': 'blah', - 'length_cm': self.length_cm, - 'color': self.color - } - ) - - def test_fruit_access_errors(self): - fruit = Fruit(length_cm=self.length_cm, color=self.color) - - # getting a value that doesn't exist raises an exception - # with a key - with self.assertRaises(AttributeError): - invalid_variable = fruit['cultivar'] - - # Per Python doc, if the named attribute does not exist, - # default is returned if provided, otherwise AttributeError is raised. - with self.assertRaises(AttributeError): - getattr(fruit, 'cultivar') - - def test_fruit_attribute_access(self): - fruit = Fruit(length_cm=self.length_cm, color=self.color) - - # Assert that we can call the builtin hasattr() function. - # hasattr should return False for non-existent attribute. - # Internally hasattr catches the AttributeError exception. - self.assertFalse(hasattr(fruit, 'invalid_variable')) - - # Assert that we can call the builtin hasattr() function. - # hasattr should return True for existent attribute. - self.assertTrue(hasattr(fruit, 'color')) - - # with getattr - # Per Python doc, if the named attribute does not exist, - # default is returned if provided. - self.assertEqual(getattr(fruit, 'cultivar', 'some value'), 'some value') - self.assertEqual(fruit.get('cultivar'), None) - self.assertEqual(fruit.get('cultivar', 'some value'), 'some value') - - def test_banana_fruit(self): + def testFruit(self): """Test Fruit""" # make an instance of Fruit, a composed schema oneOf model # banana test - fruit = Fruit(length_cm=self.length_cm, color=self.color) + length_cm = 20.3 + color = 'yellow' + fruit = Fruit(lengthCm=length_cm, color=color) # check its properties - self.assertEqual(fruit.length_cm, self.length_cm) - self.assertEqual(fruit['length_cm'], self.length_cm) - self.assertEqual(fruit.get('length_cm'), self.length_cm) - self.assertEqual(getattr(fruit, 'length_cm'), self.length_cm) - self.assertEqual(fruit.color, self.color) - self.assertEqual(fruit['color'], self.color) - self.assertEqual(getattr(fruit, 'color'), self.color) + self.assertEqual(fruit['lengthCm'], length_cm) + self.assertEqual(fruit.get('lengthCm'), length_cm) + self.assertEqual(fruit['color'], color) + self.assertEqual(fruit.get('color'), color) + # check the dict representation self.assertEqual( - fruit.to_dict(), + fruit, { - 'length_cm': self.length_cm, - 'color': self.color + 'lengthCm': length_cm, + 'color': color } ) + # setting values after instance creation is not allowed + with self.assertRaises(TypeError): + fruit['color'] = 'some value' + + # getting a value that doesn't exist raises an exception + # with a key + with self.assertRaises(KeyError): + assert fruit['cultivar'] + assert fruit.get_item_oapg('cultivar') is schemas.unset # make sure that the ModelComposed class properties are correct - # model._composed_schemas stores the anyOf/allOf/oneOf info self.assertEqual( - fruit._composed_schemas, - { - 'anyOf': [], - 'allOf': [], - 'oneOf': [ - apple.Apple, - banana.Banana, - ], - } + Fruit.MetaOapg.one_of(), + [ + apple.Apple, + banana.Banana, + ], ) - # model._composed_instances is a list of the instances that were - # made from the anyOf/allOf/OneOf classes in model._composed_schemas - self.assertEqual(len(fruit._composed_instances), 1) - for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == banana.Banana: - banana_instance = composed_instance - self.assertEqual( - fruit._composed_instances, - [banana_instance] + + """ + including extra parameters does not raise an exception + because objects support additional properties by default + """ + kwargs = dict( + color=color, + lengthCm=length_cm, + additional_string='some value', + additional_date='2021-01-02', ) - # model._var_name_to_model_instances maps the variable name to the - # model instances which store that variable - print(fruit._var_name_to_model_instances) + + fruit = Fruit.from_openapi_data_oapg(**kwargs) self.assertEqual( - fruit._var_name_to_model_instances, - { - 'color': [fruit], - 'length_cm': [fruit, banana_instance], - } + fruit, + kwargs ) + + fruit = Fruit(**kwargs) self.assertEqual( - fruit._additional_properties_model_instances, [fruit] + fruit, + kwargs ) - # if we modify one of the properties owned by multiple - # model_instances we get an exception when we try to access that - # property because the retrieved values are not all the same - banana_instance.length_cm = 4.56 - with self.assertRaises(petstore_api.ApiValueError): - some_length_cm = fruit.length_cm - # including input parameters for two oneOf instances raise an exception with self.assertRaises(petstore_api.ApiValueError): - fruit = Fruit( - length_cm=self.length_cm, + Fruit( + lengthCm=length_cm, cultivar='granny smith' ) - def test_apple_fruit(self): - # make an instance of Fruit, a composed schema oneOf model # apple test color = 'red' cultivar = 'golden delicious' fruit = Fruit(color=color, cultivar=cultivar) # check its properties - self.assertEqual(fruit.color, color) self.assertEqual(fruit['color'], color) - self.assertEqual(getattr(fruit, 'color'), color) - self.assertEqual(fruit.cultivar, cultivar) self.assertEqual(fruit['cultivar'], cultivar) - self.assertEqual(getattr(fruit, 'cultivar'), cultivar) # check the dict representation self.assertEqual( - fruit.to_dict(), + fruit, { 'color': color, 'cultivar': cultivar } ) - # model._composed_instances is a list of the instances that were - # made from the anyOf/allOf/OneOf classes in model._composed_schemas - for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == apple.Apple: - apple_instance = composed_instance - self.assertEqual( - fruit._composed_instances, - [apple_instance] - ) - # model._var_name_to_model_instances maps the variable name to the - # model instances which store that variable - self.assertEqual( - fruit._var_name_to_model_instances, - { - 'color': [fruit], - 'cultivar': [fruit, apple_instance], - } - ) - self.assertEqual( - fruit._additional_properties_model_instances, [fruit] - ) - - def test_null_fruit(self): + def testFruitNullValue(self): # Since 'apple' is nullable, validate we can create an apple with the 'null' value. fruit = apple.Apple(None) - self.assertIsNone(fruit) + assert isinstance(fruit, schemas.Singleton) + assert isinstance(fruit, apple.Apple) + assert fruit.is_none_oapg() is True # 'banana' is not nullable. - with self.assertRaises(petstore_api.ApiTypeError): + # TODO cast this into ApiTypeError? + with self.assertRaises(TypeError): banana.Banana(None) # Since 'fruit' has oneOf 'apple', 'banana' and 'apple' is nullable, # validate we can create a fruit with the 'null' value. fruit = Fruit(None) - self.assertIsNone(fruit) - - # Redo the same thing, this time passing a null Apple to the Fruit constructor. - fruit = Fruit(apple.Apple(None)) - self.assertIsNone(fruit) - - def test_fruit_with_invalid_input_type(self): - - """ - color must be a str, color's str type is only defined at the Fruit level - Banana + Apple would allow color to be assigned with any type of value - """ - invalid_value = 1 - with self.assertRaises(petstore_api.ApiTypeError): - fruit = Fruit(color=invalid_value, length_cm=self.length_cm) + assert isinstance(fruit, schemas.Singleton) + assert isinstance(fruit, apple.Apple) + assert isinstance(fruit, Fruit) + assert fruit.is_none_oapg() is True if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_fruit_req.py b/samples/openapi3/client/petstore/python/tests_manual/test_fruit_req.py index 64b710fdd583..bdabb193648a 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_fruit_req.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_fruit_req.py @@ -10,18 +10,17 @@ """ -import sys import unittest import petstore_api from petstore_api.model import apple_req from petstore_api.model import banana_req from petstore_api.model.fruit_req import FruitReq +from petstore_api import schemas class TestFruitReq(unittest.TestCase): """FruitReq unit test stubs""" - length_cm = 20.3 def setUp(self): pass @@ -29,106 +28,71 @@ def setUp(self): def tearDown(self): pass - def test_fruit_access_errors(self): - fruit = FruitReq(length_cm=self.length_cm) - - # setting a value that doesn't exist raises an exception - # with a key - with self.assertRaises(AttributeError): - fruit['invalid_variable'] = 'some value' - # with setattr - with self.assertRaises(AttributeError): - setattr(fruit, 'invalid_variable', 'some value') - - # getting a value that doesn't exist raises an exception - # with a key - with self.assertRaises(AttributeError): - invalid_variable = fruit['cultivar'] - - with self.assertRaises(AttributeError): - getattr(fruit, 'cultivar') - - def test_FruitReq_banana(self): + def testFruitReq(self): """Test FruitReq""" # make an instance of Fruit, a composed schema oneOf model # banana test - fruit = FruitReq(length_cm=self.length_cm) + length_cm = 20.3 + fruit = FruitReq(lengthCm=length_cm) # check its properties - self.assertEqual(fruit.length_cm, self.length_cm) - self.assertEqual(fruit['length_cm'], self.length_cm) - self.assertEqual(getattr(fruit, 'length_cm'), self.length_cm) + self.assertEqual(fruit.lengthCm, length_cm) + self.assertEqual(fruit['lengthCm'], length_cm) + self.assertEqual(getattr(fruit, 'lengthCm'), length_cm) # check the dict representation self.assertEqual( - fruit.to_dict(), + fruit, { - 'length_cm': self.length_cm, + 'lengthCm': length_cm, } ) + # setting values after instance creation is not allowed + with self.assertRaises(TypeError): + fruit['lengthCm'] = 'some value' + + # setting values after instance creation is not allowed + with self.assertRaises(AttributeError): + setattr(fruit, 'lengthCm', 'some value') + + # getting a value that doesn't exist raises an exception + # with a key + with self.assertRaises(KeyError): + fruit['cultivar'] + with self.assertRaises(AttributeError): + fruit.cultivar + assert fruit.get_item_oapg('cultivar') is schemas.unset # with getattr self.assertEqual(getattr(fruit, 'cultivar', 'some value'), 'some value') + with self.assertRaises(AttributeError): + getattr(fruit, 'cultivar') + # make sure that the ModelComposed class properties are correct - # model._composed_schemas stores the anyOf/allOf/oneOf info self.assertEqual( - fruit._composed_schemas, - { - 'anyOf': [], - 'allOf': [], - 'oneOf': [ - apple_req.AppleReq, - banana_req.BananaReq, - type(None), - ], - } - ) - # model._composed_instances is a list of the instances that were - # made from the anyOf/allOf/OneOf classes in model._composed_schemas - for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == banana_req.BananaReq: - banana_instance = composed_instance - self.assertEqual( - fruit._composed_instances, - [banana_instance] - ) - # model._var_name_to_model_instances maps the variable name to the - # model instances which store that variable - self.assertEqual( - fruit._var_name_to_model_instances, - { - 'length_cm': [fruit, banana_instance], - } - ) - self.assertEqual( - fruit._additional_properties_model_instances, [fruit] + FruitReq.MetaOapg.one_of(), + [ + schemas.NoneSchema, + apple_req.AppleReq, + banana_req.BananaReq, + ], ) - # if we modify one of the properties owned by multiple - # model_instances we get an exception when we try to access that - # property because the retrieved values are not all the same - banana_instance.length_cm = 4.56 - with self.assertRaises(petstore_api.ApiValueError): - some_length_cm = fruit.length_cm - - def test_invalid_inputs(self): # including extra parameters raises an exception with self.assertRaises(petstore_api.ApiValueError): - fruit = FruitReq( - length_cm=self.length_cm, + FruitReq( + length_cm=length_cm, unknown_property='some value' ) # including input parameters for two oneOf instances raise an exception with self.assertRaises(petstore_api.ApiValueError): - fruit = FruitReq( - length_cm=self.length_cm, + FruitReq( + length_cm=length_cm, cultivar='granny smith' ) - def test_FruitReq_apple(self): - """Test FruitReq""" - + # make an instance of Fruit, a composed schema oneOf model # apple test cultivar = 'golden delicious' fruit = FruitReq(cultivar=cultivar) @@ -138,37 +102,18 @@ def test_FruitReq_apple(self): self.assertEqual(getattr(fruit, 'cultivar'), cultivar) # check the dict representation self.assertEqual( - fruit.to_dict(), + fruit, { 'cultivar': cultivar } ) - # model._composed_instances is a list of the instances that were - # made from the anyOf/allOf/OneOf classes in model._composed_schemas - for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == apple_req.AppleReq: - apple_instance = composed_instance - self.assertEqual( - fruit._composed_instances, - [apple_instance] - ) - # model._var_name_to_model_instances maps the variable name to the - # model instances which store that variable - self.assertEqual( - fruit._var_name_to_model_instances, - { - 'cultivar': [fruit, apple_instance], - } - ) - self.assertEqual( - fruit._additional_properties_model_instances, [fruit] - ) - - def test_null_fruit(self): # we can pass in None fruit = FruitReq(None) - assert fruit is None + assert isinstance(fruit, schemas.Singleton) + assert isinstance(fruit, FruitReq) + assert isinstance(fruit, schemas.NoneSchema) + assert fruit.is_none_oapg() is True if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_gm_fruit.py b/samples/openapi3/client/petstore/python/tests_manual/test_gm_fruit.py index bbe105c59bc9..ad650460a4cf 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_gm_fruit.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_gm_fruit.py @@ -10,19 +10,17 @@ """ -import sys import unittest -import petstore_api +import frozendict + from petstore_api.model import apple from petstore_api.model import banana from petstore_api.model.gm_fruit import GmFruit - +from petstore_api import schemas class TestGmFruit(unittest.TestCase): """GmFruit unit test stubs""" - length_cm = 20.3 - color = 'yellow' def setUp(self): pass @@ -30,159 +28,88 @@ def setUp(self): def tearDown(self): pass - def test_set_addprop_attributes(self): - # setting a value that doesn't exist works because additional_properties_type allows any type - other_fruit = GmFruit(length_cm=self.length_cm, color=self.color) - blah = 'blah' - other_fruit['a'] = blah - assert other_fruit.a == blah - - # with setattr - setattr(other_fruit, 'b', blah) - assert other_fruit.b == blah - - self.assertEqual( - other_fruit.to_dict(), - { - 'a': 'blah', - 'b': 'blah', - 'length_cm': self.length_cm, - 'color': self.color - } - ) - - def test_banana_fruit(self): + def testGmFruit(self): """Test GmFruit""" # make an instance of GmFruit, a composed schema anyOf model # banana test - fruit = GmFruit(length_cm=self.length_cm, color=self.color) + length_cm = 20.3 + color = 'yellow' + cultivar = 'banaple' + fruit = GmFruit(lengthCm=length_cm, color=color, cultivar=cultivar) + assert isinstance(fruit, banana.Banana) + assert isinstance(fruit, apple.Apple) + assert isinstance(fruit, frozendict.frozendict) + assert isinstance(fruit, GmFruit) # check its properties - self.assertEqual(fruit.length_cm, self.length_cm) - self.assertEqual(fruit['length_cm'], self.length_cm) - self.assertEqual(getattr(fruit, 'length_cm'), self.length_cm) - self.assertEqual(fruit.color, self.color) - self.assertEqual(fruit['color'], self.color) - self.assertEqual(getattr(fruit, 'color'), self.color) + self.assertEqual(fruit['lengthCm'], length_cm) + self.assertEqual(fruit['color'], color) + # check the dict representation self.assertEqual( - fruit.to_dict(), + fruit, { - 'length_cm': self.length_cm, - 'color': self.color + 'lengthCm': length_cm, + 'color': color, + 'cultivar': cultivar } ) - # getting a value that doesn't exist raises an exception - # with a key + # unset key access raises KeyError + with self.assertRaises(KeyError): + fruit["origin"] with self.assertRaises(AttributeError): - invalid_variable = fruit['cultivar'] - # with getattr - self.assertTrue(getattr(fruit, 'cultivar', 'some value'), 'some value') + fruit.origin + assert fruit.get_item_oapg("origin") is schemas.unset - with self.assertRaises(AttributeError): - invalid_variable = getattr(fruit, 'cultivar') + with self.assertRaises(KeyError): + fruit['unknown_variable'] + assert fruit.get_item_oapg("unknown_variable") is schemas.unset + # with getattr + self.assertTrue(getattr(fruit, 'origin', 'some value'), 'some value') # make sure that the ModelComposed class properties are correct - # model._composed_schemas stores the anyOf/allOf/oneOf info - self.assertEqual( - fruit._composed_schemas, - { - 'anyOf': [ - apple.Apple, - banana.Banana, - ], - 'allOf': [], - 'oneOf': [], - } - ) - # model._composed_instances is a list of the instances that were - # made from the anyOf/allOf/OneOf classes in model._composed_schemas - for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == banana.Banana: - banana_instance = composed_instance - self.assertEqual( - fruit._composed_instances, - [banana_instance] - ) - # model._var_name_to_model_instances maps the variable name to the - # model instances which store that variable self.assertEqual( - fruit._var_name_to_model_instances, - { - 'color': [fruit], - 'length_cm': [fruit, banana_instance], - } + GmFruit.MetaOapg.any_of(), + [ + apple.Apple, + banana.Banana, + ], ) - self.assertEqual( - fruit._additional_properties_model_instances, [fruit] + + # including extra parameters works + GmFruit( + color=color, + length_cm=length_cm, + cultivar=cultivar, + unknown_property='some value' ) - def test_combo_fruit(self): # including input parameters for both anyOf instances works - cultivar = 'banaple' color = 'orange' fruit = GmFruit( color=color, cultivar=cultivar, - length_cm=self.length_cm + length_cm=length_cm ) - self.assertEqual(fruit.color, color) self.assertEqual(fruit['color'], color) - self.assertEqual(getattr(fruit, 'color'), color) - self.assertEqual(fruit.cultivar, cultivar) self.assertEqual(fruit['cultivar'], cultivar) - self.assertEqual(getattr(fruit, 'cultivar'), cultivar) - self.assertEqual(fruit.length_cm, self.length_cm) - self.assertEqual(fruit['length_cm'], self.length_cm) - self.assertEqual(getattr(fruit, 'length_cm'), self.length_cm) - - # model._composed_instances is a list of the instances that were - # made from the anyOf/allOf/OneOf classes in model._composed_schemas - for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == apple.Apple: - apple_instance = composed_instance - elif composed_instance.__class__ == banana.Banana: - banana_instance = composed_instance - self.assertEqual( - fruit._composed_instances, - [apple_instance, banana_instance] - ) - # model._var_name_to_model_instances maps the variable name to the - # model instances which store that variable - self.assertEqual( - fruit._var_name_to_model_instances, - { - 'color': [fruit], - 'length_cm': [fruit, banana_instance], - 'cultivar': [fruit, apple_instance], - } - ) - self.assertEqual( - fruit._additional_properties_model_instances, [fruit] - ) + self.assertEqual(fruit['length_cm'], length_cm) - def test_apple_fruit(self): + # make an instance of GmFruit, a composed schema anyOf model # apple test color = 'red' cultivar = 'golden delicious' origin = 'California' fruit = GmFruit(color=color, cultivar=cultivar, origin=origin) # check its properties - self.assertEqual(fruit.color, color) self.assertEqual(fruit['color'], color) - self.assertEqual(getattr(fruit, 'color'), color) - self.assertEqual(fruit.cultivar, cultivar) self.assertEqual(fruit['cultivar'], cultivar) - self.assertEqual(getattr(fruit, 'cultivar'), cultivar) - - self.assertEqual(fruit.origin, origin) self.assertEqual(fruit['origin'], origin) - self.assertEqual(getattr(fruit, 'origin'), origin) # check the dict representation self.assertEqual( - fruit.to_dict(), + fruit, { 'color': color, 'cultivar': cultivar, @@ -190,28 +117,6 @@ def test_apple_fruit(self): } ) - # model._composed_instances is a list of the instances that were - # made from the anyOf/allOf/OneOf classes in model._composed_schemas - for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == apple.Apple: - apple_instance = composed_instance - self.assertEqual( - fruit._composed_instances, - [apple_instance] - ) - # model._var_name_to_model_instances maps the variable name to the - # model instances which store that variable - self.assertEqual( - fruit._var_name_to_model_instances, - { - 'color': [fruit], - 'cultivar': [fruit, apple_instance], - 'origin': [fruit, apple_instance], - } - ) - self.assertEqual( - fruit._additional_properties_model_instances, [fruit] - ) if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_http_signature.py b/samples/openapi3/client/petstore/python/tests_manual/test_http_signature.py index c6854d666c74..1db56c65dd2d 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_http_signature.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_http_signature.py @@ -1,518 +1,518 @@ -# 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 -""" - -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.model 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 = category.Category() - cls.category.id = id_gen() - cls.category.name = "dog" - cls.tag = tag.Tag() - cls.tag.id = id_gen() - cls.tag.name = "python-pet-tag" - cls.pet = pet.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 acces_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)), - 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 acces_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)), - 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 acces_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)), - 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 acces_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)), - 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 acces_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)), - 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))) - +# # 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 +# """ +# +# 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.model import category, tag, pet +# from petstore_api.apis.tags.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 = category.Category() +# cls.category.id = id_gen() +# cls.category.name = "dog" +# cls.tag = tag.Tag() +# cls.tag.id = id_gen() +# cls.tag.name = "python-pet-tag" +# cls.pet = pet.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 acces_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)), +# 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 acces_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)), +# 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 acces_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)), +# 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 acces_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)), +# 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 acces_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)), +# 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/tests_manual/test_integer_enum_one_value.py b/samples/openapi3/client/petstore/python/tests_manual/test_integer_enum_one_value.py index eff7298d9f3d..a5d92cd0833e 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_integer_enum_one_value.py @@ -28,15 +28,28 @@ def tearDown(self): def testIntegerEnumOneValue(self): """Test IntegerEnumOneValue""" - model = IntegerEnumOneValue() - assert model.value == 0, "With only one option, the value is assigned automatically" + + with self.assertRaises(TypeError): + """ + a value must be passed in + We cannot auto assign values because that would break composition if + received payloads included this with no inputs and we the 0 value to the data to the incoming payload + One is not allowed to mutate incoming payloads because then: + - order of composed schema ingestion matters + - one can have default value collisions + - the added data will make expected schemas not match payloads + """ + model = IntegerEnumOneValue() model = IntegerEnumOneValue(0) - assert model.value == 0, "We can also pass in the value as a positional arg" + assert model == 0, "We can also pass in the value as a positional arg" - model = IntegerEnumOneValue(value=0) - assert model.value == 0, "We can also pass in the value as a named argument" + # one cannot pass the value with the value keyword + with self.assertRaises(TypeError): + model = IntegerEnumOneValue(value=0) + # one can pass in the enum value + model = IntegerEnumOneValue(IntegerEnumOneValue.POSITIVE_0) if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_json_encoder.py b/samples/openapi3/client/petstore/python/tests_manual/test_json_encoder.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_json_encoder.py rename to samples/openapi3/client/petstore/python/tests_manual/test_json_encoder.py diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_mammal.py b/samples/openapi3/client/petstore/python/tests_manual/test_mammal.py index 3ed00dd79817..975b02e01547 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_mammal.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_mammal.py @@ -14,16 +14,6 @@ import unittest import petstore_api -try: - from petstore_api.model import whale -except ImportError: - whale = sys.modules[ - 'petstore_api.model.whale'] -try: - from petstore_api.model import zebra -except ImportError: - zebra = sys.modules[ - 'petstore_api.model.zebra'] from petstore_api.model.mammal import Mammal @@ -39,10 +29,26 @@ def tearDown(self): def testMammal(self): """Test Mammal""" - # tests that we can make a BasquePig by traveling through descendant discriminator in Pig - model = Mammal(class_name="BasquePig") + # tests that we can make a BasquePig by traveling through discriminator in Pig + m = Mammal(className="BasquePig") + from petstore_api.model import pig from petstore_api.model import basque_pig - assert isinstance(model, basque_pig.BasquePig) + assert isinstance(m, Mammal) + assert isinstance(m, basque_pig.BasquePig) + assert isinstance(m, pig.Pig) + + # can make a Whale + m = Mammal(className="whale") + from petstore_api.model import whale + assert isinstance(m, whale.Whale) + + # can use the enum value + m = Mammal(className=whale.Whale.MetaOapg.properties.className.WHALE) + assert isinstance(m, whale.Whale) + + from petstore_api.model import zebra + m = Mammal(className='zebra') + assert isinstance(m, zebra.Zebra) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_money.py b/samples/openapi3/client/petstore/python/tests_manual/test_money.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_money.py rename to samples/openapi3/client/petstore/python/tests_manual/test_money.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_no_additional_properties.py b/samples/openapi3/client/petstore/python/tests_manual/test_no_additional_properties.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_no_additional_properties.py rename to samples/openapi3/client/petstore/python/tests_manual/test_no_additional_properties.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_nullable_string.py b/samples/openapi3/client/petstore/python/tests_manual/test_nullable_string.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_nullable_string.py rename to samples/openapi3/client/petstore/python/tests_manual/test_nullable_string.py diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_number_with_validations.py b/samples/openapi3/client/petstore/python/tests_manual/test_number_with_validations.py index f4264ca82ea3..5cf1dfaa9c53 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_number_with_validations.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_number_with_validations.py @@ -31,11 +31,14 @@ def testNumberWithValidations(self): valid_values = [10.0, 15.0, 20.0] for valid_value in valid_values: model = NumberWithValidations(valid_value) - assert model.value == valid_value - - invalid_values = [9.0, 21.0] - for invalid_value in invalid_values: - with self.assertRaises(petstore_api.ApiValueError): + assert model == valid_value + + value_error_msg_pairs = ( + (9.0, r"Invalid value `9.0`, must be a value greater than or equal to `10` at \('args\[0\]',\)"), + (21.0, r"Invalid value `21.0`, must be a value less than or equal to `20` at \('args\[0\]',\)"), + ) + for invalid_value, error_msg in value_error_msg_pairs: + with self.assertRaisesRegex(petstore_api.ApiValueError, error_msg): NumberWithValidations(invalid_value) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_ref_props.py index c708237acb42..42fc674cd2dd 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_ref_props.py @@ -9,18 +9,13 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest -import petstore_api -try: - from petstore_api.model import number_with_validations -except ImportError: - number_with_validations = sys.modules[ - 'petstore_api.model.number_with_validations'] +import frozendict + +from petstore_api.schemas import BoolClass from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps -from petstore_api.model.readonly import Readonly +from petstore_api.model.number_with_validations import NumberWithValidations class TestObjectModelWithRefProps(unittest.TestCase): @@ -34,16 +29,17 @@ def tearDown(self): def testObjectModelWithRefProps(self): """Test ObjectModelWithRefProps""" - from petstore_api.model.number_with_validations import NumberWithValidations - self.assertEqual( - ObjectModelWithRefProps.openapi_types, - { - 'my_number': (NumberWithValidations,), - 'my_readonly': (Readonly,), - 'my_string': (str,), - 'my_boolean': (bool,), - } - ) + inst = ObjectModelWithRefProps(myNumber=15.0, myString="a", myBoolean=True) + assert isinstance(inst, ObjectModelWithRefProps) + assert isinstance(inst, frozendict.frozendict) + assert set(inst.keys()) == {"myNumber", "myString", "myBoolean"} + assert inst["myNumber"] == 15.0 + assert isinstance(inst["myNumber"], NumberWithValidations) + assert inst["myString"] == 'a' + assert isinstance(inst["myString"], ObjectModelWithRefProps.MetaOapg.properties.myString) + assert bool(inst["myBoolean"]) is True + assert isinstance(inst["myBoolean"], ObjectModelWithRefProps.MetaOapg.properties.myBoolean) + assert isinstance(inst["myBoolean"], BoolClass) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_difficultly_named_props.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_with_difficultly_named_props.py rename to samples/openapi3/client/petstore/python/tests_manual/test_object_with_difficultly_named_props.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_with_inline_composition_property.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_inline_composition_property.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_with_inline_composition_property.py rename to samples/openapi3/client/petstore/python/tests_manual/test_object_with_inline_composition_property.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_with_validations.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_validations.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_with_validations.py rename to samples/openapi3/client/petstore/python/tests_manual/test_object_with_validations.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_parameters.py b/samples/openapi3/client/petstore/python/tests_manual/test_parameters.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_parameters.py rename to samples/openapi3/client/petstore/python/tests_manual/test_parameters.py diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_parent_pet.py b/samples/openapi3/client/petstore/python/tests_manual/test_parent_pet.py index a57f9b8527ae..171310075abf 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_parent_pet.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_parent_pet.py @@ -14,16 +14,7 @@ import unittest import petstore_api -try: - from petstore_api.model import child_cat -except ImportError: - child_cat = sys.modules[ - 'petstore_api.model.child_cat'] -try: - from petstore_api.model import grandparent_animal -except ImportError: - grandparent_animal = sys.modules[ - 'petstore_api.model.grandparent_animal'] +from petstore_api.model.grandparent_animal import GrandparentAnimal from petstore_api.model.parent_pet import ParentPet @@ -44,6 +35,7 @@ def testParentPet(self): # GrandparentAnimal, and we use the descendant's discriminator to make ParentPet model = ParentPet(pet_type="ParentPet") assert isinstance(model, ParentPet) + assert isinstance(model, GrandparentAnimal) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_quadrilateral.py b/samples/openapi3/client/petstore/python/tests_manual/test_quadrilateral.py index 63f74ae541fb..dff97bc716ad 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_quadrilateral.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_quadrilateral.py @@ -14,16 +14,8 @@ import unittest import petstore_api -try: - from petstore_api.model import complex_quadrilateral -except ImportError: - complex_quadrilateral = sys.modules[ - 'petstore_api.model.complex_quadrilateral'] -try: - from petstore_api.model import simple_quadrilateral -except ImportError: - simple_quadrilateral = sys.modules[ - 'petstore_api.model.simple_quadrilateral'] +from petstore_api.model import complex_quadrilateral +from petstore_api.model import simple_quadrilateral from petstore_api.model.quadrilateral import Quadrilateral @@ -38,9 +30,9 @@ def tearDown(self): def testQuadrilateral(self): """Test Quadrilateral""" - instance = Quadrilateral(shape_type="Quadrilateral", quadrilateral_type="ComplexQuadrilateral") + instance = Quadrilateral(shapeType="Quadrilateral", quadrilateralType="ComplexQuadrilateral") assert isinstance(instance, complex_quadrilateral.ComplexQuadrilateral) - instance = Quadrilateral(shape_type="Quadrilateral", quadrilateral_type="SimpleQuadrilateral") + instance = Quadrilateral(shapeType="Quadrilateral", quadrilateralType="SimpleQuadrilateral") assert isinstance(instance, simple_quadrilateral.SimpleQuadrilateral) diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_request_body.py b/samples/openapi3/client/petstore/python/tests_manual/test_request_body.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_request_body.py rename to samples/openapi3/client/petstore/python/tests_manual/test_request_body.py diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_shape.py b/samples/openapi3/client/petstore/python/tests_manual/test_shape.py index a2b59fc6f31c..80bab5b805b1 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_shape.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_shape.py @@ -13,18 +13,18 @@ import sys import unittest +import frozendict + import petstore_api -try: - from petstore_api.model import quadrilateral -except ImportError: - quadrilateral = sys.modules[ - 'petstore_api.model.quadrilateral'] -try: - from petstore_api.model import triangle -except ImportError: - triangle = sys.modules[ - 'petstore_api.model.triangle'] +from petstore_api.schemas import Singleton from petstore_api.model.shape import Shape +from petstore_api.model import complex_quadrilateral +from petstore_api.model import simple_quadrilateral +from petstore_api.model import triangle +from petstore_api.model import triangle_interface +from petstore_api.model import equilateral_triangle +from petstore_api.model import isosceles_triangle +from petstore_api.model import scalene_triangle class TestShape(unittest.TestCase): @@ -44,71 +44,74 @@ def test_recursionlimit(self): def testShape(self): """Test Shape""" - from petstore_api.model import complex_quadrilateral - from petstore_api.model import simple_quadrilateral - from petstore_api.model import equilateral_triangle - from petstore_api.model import isosceles_triangle - from petstore_api.model import scalene_triangle - - tri = triangle.Triangle( - shape_type="Triangle", - triangle_type="EquilateralTriangle" + + tri = Shape( + shapeType="Triangle", + triangleType="EquilateralTriangle" ) assert isinstance(tri, equilateral_triangle.EquilateralTriangle) - - tri = triangle.Triangle( - shape_type="Triangle", - triangle_type="IsoscelesTriangle" + assert isinstance(tri, triangle.Triangle) + assert isinstance(tri, triangle_interface.TriangleInterface) + assert isinstance(tri, Shape) + assert isinstance(tri, frozendict.frozendict) + assert isinstance(tri.shapeType, str) + assert isinstance(tri.shapeType, Singleton) + + tri = Shape( + shapeType="Triangle", + triangleType="IsoscelesTriangle" ) assert isinstance(tri, isosceles_triangle.IsoscelesTriangle) - tri = triangle.Triangle( - shape_type="Triangle", - triangle_type="ScaleneTriangle" + tri = Shape( + shapeType="Triangle", + triangleType="ScaleneTriangle" ) assert isinstance(tri, scalene_triangle.ScaleneTriangle) quad = Shape( - shape_type="Quadrilateral", - quadrilateral_type="ComplexQuadrilateral" + shapeType="Quadrilateral", + quadrilateralType="ComplexQuadrilateral" ) assert isinstance(quad, complex_quadrilateral.ComplexQuadrilateral) quad = Shape( - shape_type="Quadrilateral", - quadrilateral_type="SimpleQuadrilateral" + shapeType="Quadrilateral", + quadrilateralType="SimpleQuadrilateral" ) assert isinstance(quad, simple_quadrilateral.SimpleQuadrilateral) - # No discriminator provided. - err_msg = ("Cannot deserialize input data due to missing discriminator. " - "The discriminator property '{}' is missing at path: ()" - ) + # data missing with self.assertRaisesRegex( - petstore_api.ApiValueError, - err_msg.format("shapeType") + petstore_api.exceptions.ApiValueError, + r"Cannot deserialize input data due to missing discriminator. The discriminator " + r"property 'shapeType' is missing at path: \('args\[0\]',\)" ): - Shape() + Shape({}) # invalid shape_type (first discriminator). 'Circle' does not exist in the model. - err_msg = ("Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '{}'='{}' at path: ()" - ) + err_msg = ( + r"Invalid discriminator value was passed in to Shape.shapeType Only the values " + r"\['Quadrilateral', 'Triangle'\] are allowed at \('args\[0\]', 'shapeType'\)" + ) with self.assertRaisesRegex( petstore_api.ApiValueError, - err_msg.format("shapeType", "Circle") + err_msg ): - Shape(shape_type="Circle") + Shape(shapeType="Circle") # invalid quadrilateral_type (second discriminator) + err_msg = ( + r"Invalid discriminator value was passed in to Quadrilateral.quadrilateralType Only the values " + r"\['ComplexQuadrilateral', 'SimpleQuadrilateral'\] are allowed at \('args\[0\]', 'quadrilateralType'\)" + ) with self.assertRaisesRegex( petstore_api.ApiValueError, - err_msg.format("quadrilateralType", "Triangle") + err_msg ): Shape( - shape_type="Quadrilateral", - quadrilateral_type="Triangle" + shapeType="Quadrilateral", + quadrilateralType="Triangle" ) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_string_enum.py b/samples/openapi3/client/petstore/python/tests_manual/test_string_enum.py index 87092d66d388..0485242b37e2 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_string_enum.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_string_enum.py @@ -10,11 +10,11 @@ """ -import sys import unittest import petstore_api from petstore_api.model.string_enum import StringEnum +from petstore_api.schemas import Singleton, NoneClass class TestStringEnum(unittest.TestCase): @@ -29,24 +29,28 @@ def tearDown(self): def testStringEnum(self): """Test StringEnum""" inst = StringEnum(None) - self.assertIsNone(inst) + assert isinstance(inst, StringEnum) + assert isinstance(inst, NoneClass) + assert repr(inst) == '' inst = StringEnum('approved') assert isinstance(inst, StringEnum) + assert isinstance(inst, Singleton) + assert isinstance(inst, str) + assert inst == 'approved' + assert repr(inst) == "" with self.assertRaises(petstore_api.ApiValueError): StringEnum('garbage') # make sure that we can access its allowed_values - assert StringEnum.allowed_values[('value',)] == { - 'None': None, - 'PLACED': "placed", - 'APPROVED': "approved", - 'DELIVERED': "delivered", - 'DOUBLE_QUOTE_WITH_NEWLINE': "double quote \n with newline", - 'MULTIPLE_LINES': "multiple\nlines", - 'SINGLE_QUOTED': "single quoted" - } + assert isinstance(StringEnum.NONE, NoneClass) + assert StringEnum.PLACED == 'placed' + assert StringEnum.APPROVED == 'approved' + assert StringEnum.DELIVERED == 'delivered' + assert StringEnum.DOUBLE_QUOTE_WITH_NEWLINE == "double quote \n with newline" + assert StringEnum.MULTIPLE_LINES == "multiple\nlines" + assert StringEnum.SINGLE_QUOTED == "single quoted" if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_triangle.py b/samples/openapi3/client/petstore/python/tests_manual/test_triangle.py index 7268022cad52..3d19a8d65fa7 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_triangle.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_triangle.py @@ -10,45 +10,29 @@ """ -import sys import unittest -import petstore_api -try: - from petstore_api.model import equilateral_triangle -except ImportError: - equilateral_triangle = sys.modules[ - 'petstore_api.model.equilateral_triangle'] -try: - from petstore_api.model import isosceles_triangle -except ImportError: - isosceles_triangle = sys.modules[ - 'petstore_api.model.isosceles_triangle'] -try: - from petstore_api.model import scalene_triangle -except ImportError: - scalene_triangle = sys.modules[ - 'petstore_api.model.scalene_triangle'] +import frozendict + +from petstore_api.model.equilateral_triangle import EquilateralTriangle +from petstore_api.model.isosceles_triangle import IsoscelesTriangle +from petstore_api.model.scalene_triangle import ScaleneTriangle from petstore_api.model.triangle import Triangle +from petstore_api.model.triangle_interface import TriangleInterface class TestTriangle(unittest.TestCase): """Triangle unit test stubs""" - def setUp(self): - pass - - def tearDown(self): - pass - def testTriangle(self): """Test Triangle""" - tri = Triangle(shape_type="Triangle", triangle_type="EquilateralTriangle") - assert isinstance(tri, equilateral_triangle.EquilateralTriangle) - tri = Triangle(shape_type="Triangle", triangle_type="IsoscelesTriangle") - assert isinstance(tri, isosceles_triangle.IsoscelesTriangle) - tri = Triangle(shape_type="Triangle", triangle_type="ScaleneTriangle") - assert isinstance(tri, scalene_triangle.ScaleneTriangle) + tri_classes = [EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle] + for tri_class in tri_classes: + tri = Triangle(shapeType="Triangle", triangleType=tri_class.__name__) + assert isinstance(tri, tri_class) + assert isinstance(tri, Triangle) + assert isinstance(tri, TriangleInterface) + assert isinstance(tri, frozendict.frozendict) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_user_api.py b/samples/openapi3/client/petstore/python/tests_manual/test_user_api.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_user_api.py rename to samples/openapi3/client/petstore/python/tests_manual/test_user_api.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_uuid_string.py b/samples/openapi3/client/petstore/python/tests_manual/test_uuid_string.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_uuid_string.py rename to samples/openapi3/client/petstore/python/tests_manual/test_uuid_string.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_validate.py b/samples/openapi3/client/petstore/python/tests_manual/test_validate.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_validate.py rename to samples/openapi3/client/petstore/python/tests_manual/test_validate.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_whale.py b/samples/openapi3/client/petstore/python/tests_manual/test_whale.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/tests_manual/test_whale.py rename to samples/openapi3/client/petstore/python/tests_manual/test_whale.py diff --git a/samples/openapi3/client/petstore/python/tox.ini b/samples/openapi3/client/petstore/python/tox.ini index 8989fc3c4d96..e57c17e10c10 100644 --- a/samples/openapi3/client/petstore/python/tox.ini +++ b/samples/openapi3/client/petstore/python/tox.ini @@ -1,7 +1,8 @@ [tox] -envlist = py3 +envlist = py37 [testenv] +passenv = PYTHON_VERSION deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt