From f701835afe36f9e923eedac0ca191d044c14390a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20H=C3=B6rberg?= Date: Thu, 12 Oct 2023 14:59:30 +0200 Subject: [PATCH 1/7] Prevent circular imports caused by mutually referencing classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tom Hörberg --- .../codegen/languages/AbstractPythonCodegen.java | 16 +++++++++++++++- .../main/resources/python/model_generic.mustache | 15 ++++++++++++--- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java index ec63f2846203..ccad1481ba9a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java @@ -867,6 +867,7 @@ private ModelsMap postProcessModelsMap(ModelsMap objs) { TreeSet datetimeImports = new TreeSet<>(); TreeSet modelImports = new TreeSet<>(); TreeSet postponedModelImports = new TreeSet<>(); + TreeSet discriminatorModelImports = new TreeSet<>(); for (ModelMap m : objs.getModels()) { TreeSet exampleImports = new TreeSet<>(); @@ -929,7 +930,7 @@ private ModelsMap postProcessModelsMap(ModelsMap objs) { typingImports.add("Union"); Set discriminator = model.getDiscriminator().getMappedModels(); for (CodegenDiscriminator.MappedModel mappedModel : discriminator) { - postponedModelImports.add(mappedModel.getMappingName()); + discriminatorModelImports.add(mappedModel.getMappingName()); } } } @@ -1035,6 +1036,19 @@ private ModelsMap postProcessModelsMap(ModelsMap objs) { model.getVendorExtensions().putIfAbsent("x-py-postponed-model-imports", modelsToImport); } + + if (!discriminatorModelImports.isEmpty()) { + Set modelsToImport = new TreeSet<>(); + for (String modelImport : discriminatorModelImports) { + if (modelImport.equals(model.classname)) { + // skip self import + continue; + } + modelsToImport.add("from " + packageName + ".models." + underscore(modelImport) + " import " + modelImport); + } + + model.discriminator.getVendorExtensions().putIfAbsent("x-py-discriminator-model-imports", modelsToImport); + } } return objs; diff --git a/modules/openapi-generator/src/main/resources/python/model_generic.mustache b/modules/openapi-generator/src/main/resources/python/model_generic.mustache index ca6372d2d90c..e6aaa1fa1a3e 100644 --- a/modules/openapi-generator/src/main/resources/python/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_generic.mustache @@ -93,13 +93,22 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} __discriminator_property_name: ClassVar[List[str]] = '{{discriminator.propertyBaseName}}' # discriminator mappings - __discriminator_value_class_map: ClassVar[Dict[str, str]] = { - {{#mappedModels}}'{{{mappingName}}}': '{{{modelName}}}'{{^-last}},{{/-last}}{{/mappedModels}} - } + __discriminator_value_class_map: Union[ClassVar[Dict[str, str]], None] = None @classmethod def get_discriminator_value(cls, obj: dict) -> str: """Returns the discriminator value (object type) of the data""" + + if cls.__discriminator_value_class_map == None: + # Prevent circular imports caused by mutually referencing classes + {{#vendorExtensions.x-py-discriminator-model-imports}} + {{{.}}} + {{/vendorExtensions.x-py-discriminator-model-imports}} + + cls.__discriminator_value_class_map = { + {{#mappedModels}}'{{{mappingName}}}': {{{modelName}}}{{^-last}},{{/-last}}{{/mappedModels}} + } + discriminator_value = obj[cls.__discriminator_property_name] if discriminator_value: return cls.__discriminator_value_class_map.get(discriminator_value) From 0a11b8a09583109699ff9f5106dd651d51da3a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20H=C3=B6rberg?= Date: Thu, 12 Oct 2023 16:05:22 +0200 Subject: [PATCH 2/7] Update samples. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tom Hörberg --- .../petstore_api/models/animal.py | 21 ++++++++++--------- .../python/petstore_api/models/animal.py | 21 ++++++++++--------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py index a1763f52a566..b19d339cb9f0 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py @@ -45,13 +45,21 @@ class Animal(BaseModel): __discriminator_property_name: ClassVar[List[str]] = 'className' # discriminator mappings - __discriminator_value_class_map: ClassVar[Dict[str, str]] = { - 'Cat': 'Cat','Dog': 'Dog' - } + __discriminator_value_class_map: Union[ClassVar[Dict[str, str]], None] = None @classmethod def get_discriminator_value(cls, obj: dict) -> str: """Returns the discriminator value (object type) of the data""" + + if cls.__discriminator_value_class_map == None: + # Prevent circular imports caused by mutually referencing classes + from petstore_api.models.cat import Cat + from petstore_api.models.dog import Dog + + cls.__discriminator_value_class_map = { + 'Cat': Cat,'Dog': Dog + } + discriminator_value = obj[cls.__discriminator_property_name] if discriminator_value: return cls.__discriminator_value_class_map.get(discriminator_value) @@ -103,11 +111,4 @@ def from_dict(cls, obj: dict) -> Union[Self, Self]: json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) -from petstore_api.models.cat import Cat -from petstore_api.models.dog import Dog -from typing import TYPE_CHECKING -if TYPE_CHECKING: - # TODO: pydantic v2 - # Animal.model_rebuild() - pass diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py index 138891981e1d..ffacf0fc7847 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py @@ -46,13 +46,21 @@ class Animal(BaseModel): __discriminator_property_name: ClassVar[List[str]] = 'className' # discriminator mappings - __discriminator_value_class_map: ClassVar[Dict[str, str]] = { - 'Cat': 'Cat','Dog': 'Dog' - } + __discriminator_value_class_map: Union[ClassVar[Dict[str, str]], None] = None @classmethod def get_discriminator_value(cls, obj: dict) -> str: """Returns the discriminator value (object type) of the data""" + + if cls.__discriminator_value_class_map == None: + # Prevent circular imports caused by mutually referencing classes + from petstore_api.models.cat import Cat + from petstore_api.models.dog import Dog + + cls.__discriminator_value_class_map = { + 'Cat': Cat,'Dog': Dog + } + discriminator_value = obj[cls.__discriminator_property_name] if discriminator_value: return cls.__discriminator_value_class_map.get(discriminator_value) @@ -111,11 +119,4 @@ def from_dict(cls, obj: dict) -> Union[Self, Self]: json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) -from petstore_api.models.cat import Cat -from petstore_api.models.dog import Dog -from typing import TYPE_CHECKING -if TYPE_CHECKING: - # TODO: pydantic v2 - # Animal.model_rebuild() - pass From e60f0c52af6412bb16cafe1279479e90dd3a9388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20H=C3=B6rberg?= Date: Thu, 12 Oct 2023 16:21:58 +0200 Subject: [PATCH 3/7] Fix type annotation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tom Hörberg --- .../src/main/resources/python/model_generic.mustache | 2 +- .../petstore/python-aiohttp/petstore_api/models/animal.py | 2 +- .../client/petstore/python/petstore_api/models/animal.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/model_generic.mustache b/modules/openapi-generator/src/main/resources/python/model_generic.mustache index e6aaa1fa1a3e..a0f00fff9665 100644 --- a/modules/openapi-generator/src/main/resources/python/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_generic.mustache @@ -93,7 +93,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} __discriminator_property_name: ClassVar[List[str]] = '{{discriminator.propertyBaseName}}' # discriminator mappings - __discriminator_value_class_map: Union[ClassVar[Dict[str, str]], None] = None + __discriminator_value_class_map: ClassVar[Union[Dict[str, str], None]] = None @classmethod def get_discriminator_value(cls, obj: dict) -> str: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py index b19d339cb9f0..8709fc92e556 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py @@ -45,7 +45,7 @@ class Animal(BaseModel): __discriminator_property_name: ClassVar[List[str]] = 'className' # discriminator mappings - __discriminator_value_class_map: Union[ClassVar[Dict[str, str]], None] = None + __discriminator_value_class_map: ClassVar[Union[Dict[str, str], None]] = None @classmethod def get_discriminator_value(cls, obj: dict) -> str: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py index ffacf0fc7847..d55675b1da62 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py @@ -46,7 +46,7 @@ class Animal(BaseModel): __discriminator_property_name: ClassVar[List[str]] = 'className' # discriminator mappings - __discriminator_value_class_map: Union[ClassVar[Dict[str, str]], None] = None + __discriminator_value_class_map: ClassVar[Union[Dict[str, str], None]] = None @classmethod def get_discriminator_value(cls, obj: dict) -> str: From 7a3b0164d6bf574d9bf2e6a7039e761d1c6a15a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20H=C3=B6rberg?= Date: Thu, 12 Oct 2023 16:55:44 +0200 Subject: [PATCH 4/7] Create a method to access the initialized __discriminator_value_class_map. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tom Hörberg --- .../main/resources/python/model_generic.mustache | 13 ++++++++----- .../python-aiohttp/petstore_api/models/animal.py | 13 ++++++++----- .../petstore/python/petstore_api/models/animal.py | 13 ++++++++----- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/model_generic.mustache b/modules/openapi-generator/src/main/resources/python/model_generic.mustache index a0f00fff9665..ddf49c942ff0 100644 --- a/modules/openapi-generator/src/main/resources/python/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_generic.mustache @@ -96,9 +96,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} __discriminator_value_class_map: ClassVar[Union[Dict[str, str], None]] = None @classmethod - def get_discriminator_value(cls, obj: dict) -> str: - """Returns the discriminator value (object type) of the data""" - + def _get_discriminator_value_class_map() -> ClassVar[Dict[str, str]]: if cls.__discriminator_value_class_map == None: # Prevent circular imports caused by mutually referencing classes {{#vendorExtensions.x-py-discriminator-model-imports}} @@ -108,10 +106,15 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} cls.__discriminator_value_class_map = { {{#mappedModels}}'{{{mappingName}}}': {{{modelName}}}{{^-last}},{{/-last}}{{/mappedModels}} } + return cls.__discriminator_value_class_map + + @classmethod + def get_discriminator_value(cls, obj: dict) -> str: + """Returns the discriminator value (object type) of the data""" discriminator_value = obj[cls.__discriminator_property_name] if discriminator_value: - return cls.__discriminator_value_class_map.get(discriminator_value) + return cls._get_discriminator_value_class_map().get(discriminator_value) else: return None @@ -259,7 +262,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} else: raise ValueError("{{{classname}}} failed to lookup discriminator value from " + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + - ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + ", mapping: " + json.dumps(cls._get_discriminator_value_class_map())) {{/discriminator}} {{/hasChildren}} {{^hasChildren}} diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py index 8709fc92e556..ddda1424b3be 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py @@ -48,9 +48,7 @@ class Animal(BaseModel): __discriminator_value_class_map: ClassVar[Union[Dict[str, str], None]] = None @classmethod - def get_discriminator_value(cls, obj: dict) -> str: - """Returns the discriminator value (object type) of the data""" - + def _get_discriminator_value_class_map() -> ClassVar[Dict[str, str]]: if cls.__discriminator_value_class_map == None: # Prevent circular imports caused by mutually referencing classes from petstore_api.models.cat import Cat @@ -59,10 +57,15 @@ def get_discriminator_value(cls, obj: dict) -> str: cls.__discriminator_value_class_map = { 'Cat': Cat,'Dog': Dog } + return cls.__discriminator_value_class_map + + @classmethod + def get_discriminator_value(cls, obj: dict) -> str: + """Returns the discriminator value (object type) of the data""" discriminator_value = obj[cls.__discriminator_property_name] if discriminator_value: - return cls.__discriminator_value_class_map.get(discriminator_value) + return cls._get_discriminator_value_class_map().get(discriminator_value) else: return None @@ -109,6 +112,6 @@ def from_dict(cls, obj: dict) -> Union[Self, Self]: else: raise ValueError("Animal failed to lookup discriminator value from " + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + - ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + ", mapping: " + json.dumps(cls._get_discriminator_value_class_map())) diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py index d55675b1da62..202f37a7c7d5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py @@ -49,9 +49,7 @@ class Animal(BaseModel): __discriminator_value_class_map: ClassVar[Union[Dict[str, str], None]] = None @classmethod - def get_discriminator_value(cls, obj: dict) -> str: - """Returns the discriminator value (object type) of the data""" - + def _get_discriminator_value_class_map() -> ClassVar[Dict[str, str]]: if cls.__discriminator_value_class_map == None: # Prevent circular imports caused by mutually referencing classes from petstore_api.models.cat import Cat @@ -60,10 +58,15 @@ def get_discriminator_value(cls, obj: dict) -> str: cls.__discriminator_value_class_map = { 'Cat': Cat,'Dog': Dog } + return cls.__discriminator_value_class_map + + @classmethod + def get_discriminator_value(cls, obj: dict) -> str: + """Returns the discriminator value (object type) of the data""" discriminator_value = obj[cls.__discriminator_property_name] if discriminator_value: - return cls.__discriminator_value_class_map.get(discriminator_value) + return cls._get_discriminator_value_class_map().get(discriminator_value) else: return None @@ -117,6 +120,6 @@ def from_dict(cls, obj: dict) -> Union[Self, Self]: else: raise ValueError("Animal failed to lookup discriminator value from " + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + - ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + ", mapping: " + json.dumps(cls._get_discriminator_value_class_map())) From 746b689e9ea6a37590a63697945d6a6b1b1a7225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20H=C3=B6rberg?= Date: Thu, 12 Oct 2023 16:58:45 +0200 Subject: [PATCH 5/7] Add missing method parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tom Hörberg --- .../src/main/resources/python/model_generic.mustache | 2 +- .../petstore/python-aiohttp/petstore_api/models/animal.py | 2 +- .../client/petstore/python/petstore_api/models/animal.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/model_generic.mustache b/modules/openapi-generator/src/main/resources/python/model_generic.mustache index ddf49c942ff0..1685eb72d558 100644 --- a/modules/openapi-generator/src/main/resources/python/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_generic.mustache @@ -96,7 +96,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} __discriminator_value_class_map: ClassVar[Union[Dict[str, str], None]] = None @classmethod - def _get_discriminator_value_class_map() -> ClassVar[Dict[str, str]]: + def _get_discriminator_value_class_map(cls) -> ClassVar[Dict[str, str]]: if cls.__discriminator_value_class_map == None: # Prevent circular imports caused by mutually referencing classes {{#vendorExtensions.x-py-discriminator-model-imports}} diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py index ddda1424b3be..465d9d23b6e4 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py @@ -48,7 +48,7 @@ class Animal(BaseModel): __discriminator_value_class_map: ClassVar[Union[Dict[str, str], None]] = None @classmethod - def _get_discriminator_value_class_map() -> ClassVar[Dict[str, str]]: + def _get_discriminator_value_class_map(cls) -> ClassVar[Dict[str, str]]: if cls.__discriminator_value_class_map == None: # Prevent circular imports caused by mutually referencing classes from petstore_api.models.cat import Cat diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py index 202f37a7c7d5..546bbe655998 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py @@ -49,7 +49,7 @@ class Animal(BaseModel): __discriminator_value_class_map: ClassVar[Union[Dict[str, str], None]] = None @classmethod - def _get_discriminator_value_class_map() -> ClassVar[Dict[str, str]]: + def _get_discriminator_value_class_map(cls) -> ClassVar[Dict[str, str]]: if cls.__discriminator_value_class_map == None: # Prevent circular imports caused by mutually referencing classes from petstore_api.models.cat import Cat From b666ee6577770940538a01124f8d3cb9ae55aa31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20H=C3=B6rberg?= Date: Thu, 12 Oct 2023 17:13:44 +0200 Subject: [PATCH 6/7] Use Class name in _discriminator_value_class_map MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tom Hörberg --- .../src/main/resources/python/model_generic.mustache | 2 +- .../petstore/python-aiohttp/petstore_api/models/animal.py | 2 +- .../client/petstore/python/petstore_api/models/animal.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/model_generic.mustache b/modules/openapi-generator/src/main/resources/python/model_generic.mustache index 1685eb72d558..e5a50e2c146a 100644 --- a/modules/openapi-generator/src/main/resources/python/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_generic.mustache @@ -104,7 +104,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} {{/vendorExtensions.x-py-discriminator-model-imports}} cls.__discriminator_value_class_map = { - {{#mappedModels}}'{{{mappingName}}}': {{{modelName}}}{{^-last}},{{/-last}}{{/mappedModels}} + {{#mappedModels}}'{{{mappingName}}}': '{{{modelName}}}'{{^-last}},{{/-last}}{{/mappedModels}} } return cls.__discriminator_value_class_map diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py index 465d9d23b6e4..1dd9e4719c2f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py @@ -55,7 +55,7 @@ def _get_discriminator_value_class_map(cls) -> ClassVar[Dict[str, str]]: from petstore_api.models.dog import Dog cls.__discriminator_value_class_map = { - 'Cat': Cat,'Dog': Dog + 'Cat': 'Cat','Dog': 'Dog' } return cls.__discriminator_value_class_map diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py index 546bbe655998..83279357d20b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py @@ -56,7 +56,7 @@ def _get_discriminator_value_class_map(cls) -> ClassVar[Dict[str, str]]: from petstore_api.models.dog import Dog cls.__discriminator_value_class_map = { - 'Cat': Cat,'Dog': Dog + 'Cat': 'Cat','Dog': 'Dog' } return cls.__discriminator_value_class_map From b232502158dd523c876e4505dbab6e2a6f0f5401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20H=C3=B6rberg?= Date: Thu, 12 Oct 2023 18:19:34 +0200 Subject: [PATCH 7/7] Import models into the global scope in _get_discriminator_value_class_map MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tom Hörberg --- .../codegen/languages/AbstractPythonCodegen.java | 2 +- .../src/main/resources/python/model_generic.mustache | 1 + .../openapi_client/models/bird.py | 1 + .../openapi_client/models/category.py | 1 + .../openapi_client/models/data_query.py | 1 + .../openapi_client/models/default_value.py | 1 + .../openapi_client/models/number_properties_only.py | 1 + .../openapi_client/models/pet.py | 1 + .../openapi_client/models/query.py | 1 + .../openapi_client/models/tag.py | 1 + ...ject_explode_true_object_all_of_query_object_parameter.py | 1 + ..._form_explode_true_array_string_query_object_parameter.py | 1 + samples/client/echo_api/python/openapi_client/models/bird.py | 1 + .../client/echo_api/python/openapi_client/models/category.py | 1 + .../echo_api/python/openapi_client/models/data_query.py | 1 + .../echo_api/python/openapi_client/models/default_value.py | 1 + .../python/openapi_client/models/number_properties_only.py | 1 + samples/client/echo_api/python/openapi_client/models/pet.py | 1 + .../client/echo_api/python/openapi_client/models/query.py | 1 + samples/client/echo_api/python/openapi_client/models/tag.py | 1 + ...ject_explode_true_object_all_of_query_object_parameter.py | 1 + ..._form_explode_true_array_string_query_object_parameter.py | 1 + .../petstore_api/models/additional_properties_any_type.py | 1 + .../petstore_api/models/additional_properties_class.py | 1 + .../petstore_api/models/additional_properties_object.py | 1 + .../models/additional_properties_with_description_only.py | 1 + .../petstore_api/models/all_of_with_single_ref.py | 1 + .../petstore/python-aiohttp/petstore_api/models/animal.py | 5 +++-- .../python-aiohttp/petstore_api/models/api_response.py | 1 + .../petstore_api/models/array_of_array_of_model.py | 1 + .../petstore_api/models/array_of_array_of_number_only.py | 1 + .../petstore_api/models/array_of_number_only.py | 1 + .../python-aiohttp/petstore_api/models/array_test.py | 1 + .../python-aiohttp/petstore_api/models/basque_pig.py | 1 + .../python-aiohttp/petstore_api/models/capitalization.py | 1 + .../petstore/python-aiohttp/petstore_api/models/cat.py | 1 + .../petstore/python-aiohttp/petstore_api/models/category.py | 1 + .../petstore_api/models/circular_reference_model.py | 1 + .../python-aiohttp/petstore_api/models/class_model.py | 1 + .../petstore/python-aiohttp/petstore_api/models/client.py | 1 + .../petstore/python-aiohttp/petstore_api/models/creature.py | 1 + .../python-aiohttp/petstore_api/models/creature_info.py | 1 + .../python-aiohttp/petstore_api/models/danish_pig.py | 1 + .../python-aiohttp/petstore_api/models/deprecated_object.py | 1 + .../petstore/python-aiohttp/petstore_api/models/dog.py | 1 + .../python-aiohttp/petstore_api/models/dummy_model.py | 1 + .../python-aiohttp/petstore_api/models/enum_arrays.py | 1 + .../petstore/python-aiohttp/petstore_api/models/enum_test.py | 1 + .../petstore/python-aiohttp/petstore_api/models/file.py | 1 + .../petstore_api/models/file_schema_test_class.py | 1 + .../petstore/python-aiohttp/petstore_api/models/first_ref.py | 1 + .../petstore/python-aiohttp/petstore_api/models/foo.py | 1 + .../petstore_api/models/foo_get_default_response.py | 1 + .../python-aiohttp/petstore_api/models/format_test.py | 1 + .../python-aiohttp/petstore_api/models/has_only_read_only.py | 1 + .../petstore_api/models/health_check_result.py | 1 + .../petstore_api/models/inner_dict_with_property.py | 1 + .../python-aiohttp/petstore_api/models/list_class.py | 1 + .../petstore_api/models/map_of_array_of_model.py | 1 + .../petstore/python-aiohttp/petstore_api/models/map_test.py | 1 + .../mixed_properties_and_additional_properties_class.py | 1 + .../python-aiohttp/petstore_api/models/model200_response.py | 1 + .../python-aiohttp/petstore_api/models/model_return.py | 1 + .../petstore/python-aiohttp/petstore_api/models/name.py | 1 + .../python-aiohttp/petstore_api/models/nullable_class.py | 1 + .../python-aiohttp/petstore_api/models/nullable_property.py | 1 + .../python-aiohttp/petstore_api/models/number_only.py | 1 + .../models/object_to_test_additional_properties.py | 1 + .../petstore_api/models/object_with_deprecated_fields.py | 1 + .../petstore/python-aiohttp/petstore_api/models/order.py | 1 + .../python-aiohttp/petstore_api/models/outer_composite.py | 1 + .../petstore_api/models/outer_object_with_enum_property.py | 1 + .../petstore/python-aiohttp/petstore_api/models/parent.py | 1 + .../petstore_api/models/parent_with_optional_dict.py | 1 + .../petstore/python-aiohttp/petstore_api/models/pet.py | 1 + .../petstore_api/models/property_name_collision.py | 1 + .../python-aiohttp/petstore_api/models/read_only_first.py | 1 + .../python-aiohttp/petstore_api/models/second_ref.py | 1 + .../petstore_api/models/self_reference_model.py | 1 + .../python-aiohttp/petstore_api/models/special_model_name.py | 1 + .../python-aiohttp/petstore_api/models/special_name.py | 1 + .../petstore/python-aiohttp/petstore_api/models/tag.py | 1 + .../test_inline_freeform_additional_properties_request.py | 1 + .../petstore/python-aiohttp/petstore_api/models/tiger.py | 1 + .../unnamed_dict_with_additional_model_list_properties.py | 1 + .../unnamed_dict_with_additional_string_list_properties.py | 1 + .../petstore/python-aiohttp/petstore_api/models/user.py | 1 + .../python-aiohttp/petstore_api/models/with_nested_one_of.py | 1 + .../petstore_api/models/additional_properties_any_type.py | 1 + .../petstore_api/models/additional_properties_class.py | 1 + .../petstore_api/models/additional_properties_object.py | 1 + .../models/additional_properties_with_description_only.py | 1 + .../python/petstore_api/models/all_of_with_single_ref.py | 1 + .../client/petstore/python/petstore_api/models/animal.py | 5 +++-- .../petstore/python/petstore_api/models/api_response.py | 1 + .../python/petstore_api/models/array_of_array_of_model.py | 1 + .../petstore_api/models/array_of_array_of_number_only.py | 1 + .../python/petstore_api/models/array_of_number_only.py | 1 + .../client/petstore/python/petstore_api/models/array_test.py | 1 + .../client/petstore/python/petstore_api/models/basque_pig.py | 1 + .../petstore/python/petstore_api/models/capitalization.py | 1 + .../client/petstore/python/petstore_api/models/cat.py | 1 + .../client/petstore/python/petstore_api/models/category.py | 1 + .../python/petstore_api/models/circular_reference_model.py | 1 + .../petstore/python/petstore_api/models/class_model.py | 1 + .../client/petstore/python/petstore_api/models/client.py | 1 + .../client/petstore/python/petstore_api/models/creature.py | 1 + .../petstore/python/petstore_api/models/creature_info.py | 1 + .../client/petstore/python/petstore_api/models/danish_pig.py | 1 + .../petstore/python/petstore_api/models/deprecated_object.py | 1 + .../client/petstore/python/petstore_api/models/dog.py | 1 + .../petstore/python/petstore_api/models/dummy_model.py | 1 + .../petstore/python/petstore_api/models/enum_arrays.py | 1 + .../client/petstore/python/petstore_api/models/enum_test.py | 1 + .../client/petstore/python/petstore_api/models/file.py | 1 + .../python/petstore_api/models/file_schema_test_class.py | 1 + .../client/petstore/python/petstore_api/models/first_ref.py | 1 + .../client/petstore/python/petstore_api/models/foo.py | 1 + .../python/petstore_api/models/foo_get_default_response.py | 1 + .../petstore/python/petstore_api/models/format_test.py | 1 + .../python/petstore_api/models/has_only_read_only.py | 1 + .../python/petstore_api/models/health_check_result.py | 1 + .../python/petstore_api/models/inner_dict_with_property.py | 1 + .../client/petstore/python/petstore_api/models/list_class.py | 1 + .../python/petstore_api/models/map_of_array_of_model.py | 1 + .../client/petstore/python/petstore_api/models/map_test.py | 1 + .../mixed_properties_and_additional_properties_class.py | 1 + .../petstore/python/petstore_api/models/model200_response.py | 1 + .../petstore/python/petstore_api/models/model_return.py | 1 + .../client/petstore/python/petstore_api/models/name.py | 1 + .../petstore/python/petstore_api/models/nullable_class.py | 1 + .../petstore/python/petstore_api/models/nullable_property.py | 1 + .../petstore/python/petstore_api/models/number_only.py | 1 + .../models/object_to_test_additional_properties.py | 1 + .../petstore_api/models/object_with_deprecated_fields.py | 1 + .../client/petstore/python/petstore_api/models/order.py | 1 + .../petstore/python/petstore_api/models/outer_composite.py | 1 + .../petstore_api/models/outer_object_with_enum_property.py | 1 + .../client/petstore/python/petstore_api/models/parent.py | 1 + .../python/petstore_api/models/parent_with_optional_dict.py | 1 + .../client/petstore/python/petstore_api/models/pet.py | 1 + .../python/petstore_api/models/property_name_collision.py | 1 + .../petstore/python/petstore_api/models/read_only_first.py | 1 + .../client/petstore/python/petstore_api/models/second_ref.py | 1 + .../python/petstore_api/models/self_reference_model.py | 1 + .../python/petstore_api/models/special_model_name.py | 1 + .../petstore/python/petstore_api/models/special_name.py | 1 + .../client/petstore/python/petstore_api/models/tag.py | 1 + .../test_inline_freeform_additional_properties_request.py | 1 + .../client/petstore/python/petstore_api/models/tiger.py | 1 + .../unnamed_dict_with_additional_model_list_properties.py | 1 + .../unnamed_dict_with_additional_string_list_properties.py | 1 + .../client/petstore/python/petstore_api/models/user.py | 1 + .../python/petstore_api/models/with_nested_one_of.py | 1 + 154 files changed, 158 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java index ccad1481ba9a..35ad3ad8fb2e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java @@ -1044,7 +1044,7 @@ private ModelsMap postProcessModelsMap(ModelsMap objs) { // skip self import continue; } - modelsToImport.add("from " + packageName + ".models." + underscore(modelImport) + " import " + modelImport); + modelsToImport.add("globals()[\"" + modelImport + "\"] = importlib.import_module(\"" + packageName + ".models." + underscore(modelImport) + "\")." + modelImport); } model.discriminator.getVendorExtensions().putIfAbsent("x-py-discriminator-model-imports", modelsToImport); diff --git a/modules/openapi-generator/src/main/resources/python/model_generic.mustache b/modules/openapi-generator/src/main/resources/python/model_generic.mustache index e5a50e2c146a..d7bcc657887d 100644 --- a/modules/openapi-generator/src/main/resources/python/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_generic.mustache @@ -2,6 +2,7 @@ from __future__ import annotations import pprint import re # noqa: F401 import json +import importlib {{#vendorExtensions.x-py-datetime-imports}}{{#-first}}from datetime import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-datetime-imports}} {{#vendorExtensions.x-py-typing-imports}}{{#-first}}from typing import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-typing-imports}} diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/bird.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/bird.py index 33c7b26e8484..b450c139c72f 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/bird.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/bird.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/category.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/category.py index 1bedf6f65d28..85ada8aee6d9 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/category.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/category.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/data_query.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/data_query.py index c91e48bd59fd..414de8682bdc 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/data_query.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/data_query.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from datetime import datetime from typing import Optional diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/default_value.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/default_value.py index 4de9557f2ef7..3f689b077d4a 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/default_value.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/default_value.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import List, Optional diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/number_properties_only.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/number_properties_only.py index 495bfaea144f..df1b9b31d2e4 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/number_properties_only.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/number_properties_only.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional, Union diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/pet.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/pet.py index 102f657a20b2..293abf905905 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/pet.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/pet.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import List, Optional diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/query.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/query.py index e6277c3fa3d1..17dc1c4084b7 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/query.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/query.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import List, Optional diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/tag.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/tag.py index d691e053b851..f186238b4dad 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/tag.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/tag.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py index 572f5c4862e7..9d4b8f791a67 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py index ccc499508dfb..dc7b2d76faad 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import List, Optional diff --git a/samples/client/echo_api/python/openapi_client/models/bird.py b/samples/client/echo_api/python/openapi_client/models/bird.py index 54c0ee31a70b..88ffa3e66263 100644 --- a/samples/client/echo_api/python/openapi_client/models/bird.py +++ b/samples/client/echo_api/python/openapi_client/models/bird.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/client/echo_api/python/openapi_client/models/category.py b/samples/client/echo_api/python/openapi_client/models/category.py index 9b17e13e9315..a50c64bccec3 100644 --- a/samples/client/echo_api/python/openapi_client/models/category.py +++ b/samples/client/echo_api/python/openapi_client/models/category.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/client/echo_api/python/openapi_client/models/data_query.py b/samples/client/echo_api/python/openapi_client/models/data_query.py index e13342733d34..38c79da4370b 100644 --- a/samples/client/echo_api/python/openapi_client/models/data_query.py +++ b/samples/client/echo_api/python/openapi_client/models/data_query.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from datetime import datetime from typing import Optional diff --git a/samples/client/echo_api/python/openapi_client/models/default_value.py b/samples/client/echo_api/python/openapi_client/models/default_value.py index 7c07bcfa89a2..2d24157078c8 100644 --- a/samples/client/echo_api/python/openapi_client/models/default_value.py +++ b/samples/client/echo_api/python/openapi_client/models/default_value.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import List, Optional diff --git a/samples/client/echo_api/python/openapi_client/models/number_properties_only.py b/samples/client/echo_api/python/openapi_client/models/number_properties_only.py index cd532e0609f2..dddf232c63a3 100644 --- a/samples/client/echo_api/python/openapi_client/models/number_properties_only.py +++ b/samples/client/echo_api/python/openapi_client/models/number_properties_only.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional, Union diff --git a/samples/client/echo_api/python/openapi_client/models/pet.py b/samples/client/echo_api/python/openapi_client/models/pet.py index 61b642b5ad46..a265755a80e4 100644 --- a/samples/client/echo_api/python/openapi_client/models/pet.py +++ b/samples/client/echo_api/python/openapi_client/models/pet.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import List, Optional diff --git a/samples/client/echo_api/python/openapi_client/models/query.py b/samples/client/echo_api/python/openapi_client/models/query.py index e6277c3fa3d1..17dc1c4084b7 100644 --- a/samples/client/echo_api/python/openapi_client/models/query.py +++ b/samples/client/echo_api/python/openapi_client/models/query.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import List, Optional diff --git a/samples/client/echo_api/python/openapi_client/models/tag.py b/samples/client/echo_api/python/openapi_client/models/tag.py index 9a0eda31e738..49eddcfeec48 100644 --- a/samples/client/echo_api/python/openapi_client/models/tag.py +++ b/samples/client/echo_api/python/openapi_client/models/tag.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/client/echo_api/python/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py b/samples/client/echo_api/python/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py index 24b4279ea4d4..8ba7d6376883 100644 --- a/samples/client/echo_api/python/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py +++ b/samples/client/echo_api/python/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/client/echo_api/python/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py b/samples/client/echo_api/python/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py index d53ca53f8c09..29d705fc8cdf 100644 --- a/samples/client/echo_api/python/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py +++ b/samples/client/echo_api/python/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py @@ -17,6 +17,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import List, Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_any_type.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_any_type.py index 3d6f78e1748c..cb38573db30c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_any_type.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_any_type.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_class.py index 14fbcc1e4425..d59f65b37adb 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_class.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Dict, Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_object.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_object.py index 9933c9ac2335..039078540466 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_object.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_object.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_with_description_only.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_with_description_only.py index 15d29a1d241e..db614ee3c108 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_with_description_only.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_with_description_only.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/all_of_with_single_ref.py index 09693f82e07c..b82a0b03b5d4 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/all_of_with_single_ref.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/all_of_with_single_ref.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py index 1dd9e4719c2f..6fe39623cabe 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional, Union @@ -51,8 +52,8 @@ class Animal(BaseModel): def _get_discriminator_value_class_map(cls) -> ClassVar[Dict[str, str]]: if cls.__discriminator_value_class_map == None: # Prevent circular imports caused by mutually referencing classes - from petstore_api.models.cat import Cat - from petstore_api.models.dog import Dog + globals()["Cat"] = importlib.import_module("petstore_api.models.cat").Cat + globals()["Dog"] = importlib.import_module("petstore_api.models.dog").Dog cls.__discriminator_value_class_map = { 'Cat': 'Cat','Dog': 'Dog' diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/api_response.py index c8a08ad07d62..4ff6d9d85a9d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/api_response.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/api_response.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_array_of_model.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_array_of_model.py index 9293e3d9ef85..381056c07b05 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_array_of_model.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import List, Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_array_of_number_only.py index 77bccbdcedbd..deb361c05750 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_array_of_number_only.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import List, Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_number_only.py index b9457cc86954..28462a77bf44 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_number_only.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import List, Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_test.py index ada718465ba7..2511d55077f1 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_test.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_test.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import List, Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/basque_pig.py index c0602950bbe0..49793a111dd6 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/basque_pig.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/basque_pig.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/capitalization.py index fbcb8b78eaf3..45d47eeef26d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/capitalization.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/cat.py index 0af38b8a65f7..c7e4f00fe9d9 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/cat.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/category.py index 78ee4fecb971..38606dc48ec8 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/category.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/circular_reference_model.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/circular_reference_model.py index 934c6ea455c4..2b71fef59e9f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/circular_reference_model.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/circular_reference_model.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/class_model.py index ae918ce100fc..2af941270198 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/class_model.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/class_model.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/client.py index 4033f37205ee..decc591efbf8 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/client.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/creature.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/creature.py index 1ed4c3360497..fc93404e5d7d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/creature.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/creature.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/creature_info.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/creature_info.py index 93ab7f145749..f9ef228bfb6d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/creature_info.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/creature_info.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/danish_pig.py index 95676eefdfca..9746df3e679f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/danish_pig.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/danish_pig.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/deprecated_object.py index 6a8ea126a3b2..70c4480c08ce 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/deprecated_object.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/deprecated_object.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/dog.py index f038da3dd481..36ae5c4cbcfd 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/dog.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/dummy_model.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/dummy_model.py index bb8682915ad6..ee08dcad7015 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/dummy_model.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/dummy_model.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_arrays.py index 333440a11658..833037936108 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_arrays.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import List, Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_test.py index 0aaab02139d2..61ad84795950 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_test.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/file.py index a4009a1ade9b..622e5dbab656 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/file.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/file_schema_test_class.py index 0a6d4ed4a806..74c95da1527f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/file_schema_test_class.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import List, Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/first_ref.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/first_ref.py index 568eca6f756b..35cddd50c03a 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/first_ref.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/first_ref.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/foo.py index cb55c8357340..dd77af10642b 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/foo.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/foo_get_default_response.py index c439ed8825e9..3c6027794a64 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/foo_get_default_response.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/foo_get_default_response.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/format_test.py index 41ea9b696cd8..f2f164ad7e8a 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/format_test.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/format_test.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from datetime import date, datetime from typing import Optional, Union diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/has_only_read_only.py index 9f85595a0449..9fe325bd7277 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/has_only_read_only.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/health_check_result.py index 851598bedcf0..a39200632c23 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/health_check_result.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/health_check_result.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/inner_dict_with_property.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/inner_dict_with_property.py index 5e40e20bc9a3..4bdf7ea8dfee 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/inner_dict_with_property.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/inner_dict_with_property.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, Dict, Optional, Union diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/list_class.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/list_class.py index a19ae927fc3b..4ad0fd1b9299 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/list_class.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/list_class.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/map_of_array_of_model.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/map_of_array_of_model.py index ed7287da6db1..7f10da621818 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/map_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/map_of_array_of_model.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/map_test.py index 60a0eacea0ad..7ba07db8e6c5 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/map_test.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/map_test.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Dict, Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py index 960da22186d4..303b0ee0996d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from datetime import datetime from typing import Dict, Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model200_response.py index cf37acaae518..2b728197bf18 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model200_response.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model200_response.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_return.py index 7bfc61b95a23..d8863ef38bdd 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_return.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_return.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/name.py index 3cf8fb2c48ec..deae19b9c55b 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/name.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/nullable_class.py index 97a741cec728..829d9f0222b2 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/nullable_class.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/nullable_class.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from datetime import date, datetime from typing import Any, Dict, List, Optional, Union diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/nullable_property.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/nullable_property.py index 440830fe53e9..b95d183d0cec 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/nullable_property.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/nullable_property.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/number_only.py index c4c5e83f8b3c..c824f3d06831 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/number_only.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/number_only.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/object_to_test_additional_properties.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/object_to_test_additional_properties.py index 0d9a69aeda11..ad86e62bf3f2 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/object_to_test_additional_properties.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/object_to_test_additional_properties.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/object_with_deprecated_fields.py index 37ea3c8b169c..6738a5c5b390 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/object_with_deprecated_fields.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/object_with_deprecated_fields.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import List, Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/order.py index 1481a686d1ac..797178049c19 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/order.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from datetime import datetime from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_composite.py index 7d76d2da971a..4a819ff96263 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_composite.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_composite.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_object_with_enum_property.py index 476ce266f6bf..7390186efb82 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_object_with_enum_property.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_object_with_enum_property.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/parent.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/parent.py index 6db76ae9dc1b..599123b18865 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/parent.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/parent.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Dict, Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/parent_with_optional_dict.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/parent_with_optional_dict.py index 1dc94bddede3..340a24b02f11 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/parent_with_optional_dict.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/parent_with_optional_dict.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Dict, Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pet.py index 863a4c1c2b06..f64e208cd44f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pet.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import List, Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/property_name_collision.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/property_name_collision.py index d72994935fc7..513b9f441c26 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/property_name_collision.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/property_name_collision.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/read_only_first.py index 0a50bf6362d9..e8572f2a946f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/read_only_first.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/read_only_first.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/second_ref.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/second_ref.py index 9140870ee899..b04fb2ebd8e3 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/second_ref.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/second_ref.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/self_reference_model.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/self_reference_model.py index 2eaf5838dbbf..adcb935405b0 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/self_reference_model.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/self_reference_model.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_model_name.py index dcc61fa6f4c8..dd832eec8d68 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_model_name.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_model_name.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_name.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_name.py index 5bff4d8a2c67..3f8087fde114 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_name.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_name.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/tag.py index be906a578ed2..30788a341725 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/tag.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py index 81ae90565082..63068557d33d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/tiger.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/tiger.py index c47e200a43d8..24a76af6aa1e 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/tiger.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/tiger.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py index abd2f06aa8ff..6c9b1c7e3dd7 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py index 5fad957d5bf8..be019d33f957 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/user.py index af930f09dd5d..f5593c9da88e 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/user.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/with_nested_one_of.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/with_nested_one_of.py index 72130e4dcf30..fbb4babc5087 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/with_nested_one_of.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/with_nested_one_of.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_any_type.py b/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_any_type.py index 0c7dbcc65571..3828e5124cd7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_any_type.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_any_type.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_class.py index 396e7d12bccd..74c40d98a6fa 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_class.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_object.py b/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_object.py index 3b562c4f8000..c4998c041d45 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_object.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_object.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_with_description_only.py b/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_with_description_only.py index a626cd66730f..ffb364a55854 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_with_description_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_with_description_only.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python/petstore_api/models/all_of_with_single_ref.py index c25ff6350690..081bb57f3c42 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/all_of_with_single_ref.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/all_of_with_single_ref.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py index 83279357d20b..445370660955 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional, Union @@ -52,8 +53,8 @@ class Animal(BaseModel): def _get_discriminator_value_class_map(cls) -> ClassVar[Dict[str, str]]: if cls.__discriminator_value_class_map == None: # Prevent circular imports caused by mutually referencing classes - from petstore_api.models.cat import Cat - from petstore_api.models.dog import Dog + globals()["Cat"] = importlib.import_module("petstore_api.models.cat").Cat + globals()["Dog"] = importlib.import_module("petstore_api.models.dog").Dog cls.__discriminator_value_class_map = { 'Cat': 'Cat','Dog': 'Dog' diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python/petstore_api/models/api_response.py index 91af78b6d654..ca5145c45379 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/api_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/api_response.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_model.py b/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_model.py index 1a1517f63713..2411c40cd4c8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_model.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py index 22b78207654e..29d3f1266d41 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python/petstore_api/models/array_of_number_only.py index af483a7d7c77..4ba4eb0aa6a9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/array_of_number_only.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python/petstore_api/models/array_test.py index 4a105ad03563..1faf5014b277 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/array_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/array_test.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python/petstore_api/models/basque_pig.py index 7bf0494f1718..8e4cecb826cf 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/basque_pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/basque_pig.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py index 6405f1383e72..ab591b1f7e68 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python/petstore_api/models/cat.py index 3801d7c5e73c..099ab3a216f2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/cat.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/category.py b/samples/openapi3/client/petstore/python/petstore_api/models/category.py index 655d732f2743..36aecb82c311 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/category.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/circular_reference_model.py b/samples/openapi3/client/petstore/python/petstore_api/models/circular_reference_model.py index 87c75c69894c..6b878133d4a3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/circular_reference_model.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/circular_reference_model.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python/petstore_api/models/class_model.py index 44c2a4c46d61..1f6de3120b58 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/class_model.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/class_model.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/client.py b/samples/openapi3/client/petstore/python/petstore_api/models/client.py index 6699b5e70d60..7b85fd3b21dd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/client.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/creature.py b/samples/openapi3/client/petstore/python/petstore_api/models/creature.py index eb6ef06e7dc5..b21b9cddca41 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/creature.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/creature.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/creature_info.py b/samples/openapi3/client/petstore/python/petstore_api/models/creature_info.py index 4a8fc9bbf112..4f26038189b7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/creature_info.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/creature_info.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python/petstore_api/models/danish_pig.py index 42858fbaca6a..4f1f57892679 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/danish_pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/danish_pig.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python/petstore_api/models/deprecated_object.py index a0eec30d42a7..687a6887aa4e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/deprecated_object.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/deprecated_object.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python/petstore_api/models/dog.py index ce75782ef430..871c89351eca 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/dog.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/dummy_model.py b/samples/openapi3/client/petstore/python/petstore_api/models/dummy_model.py index f36c7e906d7f..74456f3366c4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/dummy_model.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/dummy_model.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python/petstore_api/models/enum_arrays.py index f0a8bcd34e17..bbd3d8d2cd14 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/enum_arrays.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/enum_arrays.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py index 3072578a82c7..34f6b0b1ddbb 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/file.py b/samples/openapi3/client/petstore/python/petstore_api/models/file.py index e3fa35e73d41..1e08f7f4c782 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/file.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python/petstore_api/models/file_schema_test_class.py index a1dadbb4a2f1..0920ebf78fe6 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/file_schema_test_class.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/first_ref.py b/samples/openapi3/client/petstore/python/petstore_api/models/first_ref.py index c74cacde3be7..dc1cd1d9388d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/first_ref.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/first_ref.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python/petstore_api/models/foo.py index 263cd0026ecc..359a9cecd0ec 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/foo.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python/petstore_api/models/foo_get_default_response.py index 8fdaee41b988..c374c5233e56 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/foo_get_default_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/foo_get_default_response.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python/petstore_api/models/format_test.py index 685fb0250f66..c5504f7f7ce5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/format_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/format_test.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from datetime import date, datetime from typing import Any, ClassVar, Dict, List, Optional, Union diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python/petstore_api/models/has_only_read_only.py index 68f2b2da1f44..1b7e895769b4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/has_only_read_only.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python/petstore_api/models/health_check_result.py index 7665cc0df357..6d87efee92d5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/health_check_result.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/health_check_result.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/inner_dict_with_property.py b/samples/openapi3/client/petstore/python/petstore_api/models/inner_dict_with_property.py index 73aba7cd2b0a..2080d714d87b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/inner_dict_with_property.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/inner_dict_with_property.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional, Union diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/list_class.py b/samples/openapi3/client/petstore/python/petstore_api/models/list_class.py index f0951e6ca3d4..091ceb184c57 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/list_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/list_class.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/map_of_array_of_model.py b/samples/openapi3/client/petstore/python/petstore_api/models/map_of_array_of_model.py index cbc1f669c86d..96c34f388049 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/map_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/map_of_array_of_model.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python/petstore_api/models/map_test.py index 504c11a9aeda..8fe421699254 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/map_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/map_test.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py index a9dbe95b3dac..ebab9c61b624 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python/petstore_api/models/model200_response.py index 1f190eb4a08f..9294288a66e3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/model200_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/model200_response.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python/petstore_api/models/model_return.py index 38d635780f1c..c16148a2f796 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/model_return.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/model_return.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/name.py b/samples/openapi3/client/petstore/python/petstore_api/models/name.py index 00575c968913..2ef3a3850a08 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/name.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python/petstore_api/models/nullable_class.py index 4b76865b0d31..7805dc11fdc5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/nullable_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/nullable_class.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from datetime import date, datetime from typing import Any, ClassVar, Dict, List, Optional, Union diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/nullable_property.py b/samples/openapi3/client/petstore/python/petstore_api/models/nullable_property.py index da7b79fcb40b..37b6cfca11da 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/nullable_property.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/nullable_property.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python/petstore_api/models/number_only.py index 2b8d76dab0d9..2741cb198a57 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/number_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/number_only.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/object_to_test_additional_properties.py b/samples/openapi3/client/petstore/python/petstore_api/models/object_to_test_additional_properties.py index b09bcedac46d..9222bb41144b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/object_to_test_additional_properties.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/object_to_test_additional_properties.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python/petstore_api/models/object_with_deprecated_fields.py index b1113b9a817e..f96698c33249 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/object_with_deprecated_fields.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/object_with_deprecated_fields.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/order.py b/samples/openapi3/client/petstore/python/petstore_api/models/order.py index 5d58dc22d2eb..51e21a7c612d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/order.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python/petstore_api/models/outer_composite.py index ca58500b2350..8311cff8a3f5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/outer_composite.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/outer_composite.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python/petstore_api/models/outer_object_with_enum_property.py index 4ee7ca1a0918..ae12b02cbcb5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/outer_object_with_enum_property.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/outer_object_with_enum_property.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/parent.py b/samples/openapi3/client/petstore/python/petstore_api/models/parent.py index 727a54a2523c..72e851bd8189 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/parent.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/parent.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/parent_with_optional_dict.py b/samples/openapi3/client/petstore/python/petstore_api/models/parent_with_optional_dict.py index c0192fdcba47..cbe86a67004c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/parent_with_optional_dict.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/parent_with_optional_dict.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python/petstore_api/models/pet.py index 50ee73984a30..aae08d5a4f26 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/pet.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/property_name_collision.py b/samples/openapi3/client/petstore/python/petstore_api/models/property_name_collision.py index 40e492c3d8ce..9ebc90670750 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/property_name_collision.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/property_name_collision.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python/petstore_api/models/read_only_first.py index c513afd99eae..2b0b92dacd6e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/read_only_first.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/read_only_first.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/second_ref.py b/samples/openapi3/client/petstore/python/petstore_api/models/second_ref.py index 440a92d69ff8..4ac483227c32 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/second_ref.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/second_ref.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/self_reference_model.py b/samples/openapi3/client/petstore/python/petstore_api/models/self_reference_model.py index dea2c090fa28..24a3c7972f4e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/self_reference_model.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/self_reference_model.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python/petstore_api/models/special_model_name.py index 1ebdc712468a..93eadf87f6b9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/special_model_name.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/special_model_name.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/special_name.py b/samples/openapi3/client/petstore/python/petstore_api/models/special_name.py index cb6d63fbfa93..b6b8e1de13bd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/special_name.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/special_name.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python/petstore_api/models/tag.py index 64fbd720e3cb..4c07511aa21f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/tag.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/test_inline_freeform_additional_properties_request.py b/samples/openapi3/client/petstore/python/petstore_api/models/test_inline_freeform_additional_properties_request.py index ffd24d69c23c..3d2b9bccef80 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/test_inline_freeform_additional_properties_request.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/test_inline_freeform_additional_properties_request.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/tiger.py b/samples/openapi3/client/petstore/python/petstore_api/models/tiger.py index d2d1f61b440c..3a0b69eaf4c4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/tiger.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/tiger.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py b/samples/openapi3/client/petstore/python/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py index 4aa1fcbac582..1e25877e2b64 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py b/samples/openapi3/client/petstore/python/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py index bee320032a90..784a00f4dc1e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/user.py b/samples/openapi3/client/petstore/python/petstore_api/models/user.py index 250c3aac6397..7d2caf2e3440 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/user.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/with_nested_one_of.py b/samples/openapi3/client/petstore/python/petstore_api/models/with_nested_one_of.py index 75fc92ba2865..ffcaf0825cb7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/with_nested_one_of.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/with_nested_one_of.py @@ -16,6 +16,7 @@ import pprint import re # noqa: F401 import json +import importlib from typing import Any, ClassVar, Dict, List, Optional