From f525954a4f854a5b373ea60cc1e9db7e50fe3a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Sat, 17 Feb 2024 19:10:58 +0000 Subject: [PATCH 01/12] [python] add inheritance discriminators test #16808 --- ...ore-with-fake-endpoints-models-for-testing.yaml | 14 ++++++++++++++ .../client/petstore/python/tests/test_model.py | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml index b77ff51d4bae..e0f1475ea83d 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1640,6 +1640,20 @@ components: required: - id - activity + DiscriminatorAllOfSuper: + type: object + required: + - elementType + discriminator: + propertyName: elementType + properties: + elementType: + type: string + DiscriminatorAllOfSub: + allOf: + - $ref: '#/components/schemas/DiscriminatorAllOfSuper' + - type: object + properties: {} Pet: type: object required: diff --git a/samples/openapi3/client/petstore/python/tests/test_model.py b/samples/openapi3/client/petstore/python/tests/test_model.py index e67ae8fb6538..7e284d7b19b6 100644 --- a/samples/openapi3/client/petstore/python/tests/test_model.py +++ b/samples/openapi3/client/petstore/python/tests/test_model.py @@ -342,6 +342,11 @@ def test_inheritance(self): self.assertEqual(dog2.breed, 'bulldog') self.assertEqual(dog2.class_name, "dog") self.assertEqual(dog2.color, 'white') + + def test_inheritance_discriminators(self): + petstore_api.DiscriminatorAllOfSuper.from_dict({"className": "dog", "color": "white", "breed": "bulldog"}) + + def test_list(self): # should throw exception as var_123_list should be string From 44d1b04bb387a40b4d265b1e18d9b1c0e74fcd3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Sat, 17 Feb 2024 19:12:17 +0000 Subject: [PATCH 02/12] [python] update samples --- .../python-aiohttp/.openapi-generator/FILES | 6 + .../client/petstore/python-aiohttp/README.md | 2 + .../docs/DiscriminatorAllOfSub.md | 28 +++++ .../docs/DiscriminatorAllOfSuper.md | 29 +++++ .../python-aiohttp/petstore_api/__init__.py | 2 + .../petstore_api/models/__init__.py | 2 + .../models/discriminator_all_of_sub.py | 86 +++++++++++++ .../models/discriminator_all_of_super.py | 106 ++++++++++++++++ .../test/test_discriminator_all_of_sub.py | 50 ++++++++ .../test/test_discriminator_all_of_super.py | 52 ++++++++ .../.openapi-generator/FILES | 6 + .../python-pydantic-v1-aiohttp/README.md | 2 + .../docs/DiscriminatorAllOfSub.md | 27 +++++ .../docs/DiscriminatorAllOfSuper.md | 28 +++++ .../petstore_api/__init__.py | 2 + .../petstore_api/models/__init__.py | 2 + .../models/discriminator_all_of_sub.py | 71 +++++++++++ .../models/discriminator_all_of_super.py | 89 ++++++++++++++ .../test/test_discriminator_all_of_sub.py | 51 ++++++++ .../test/test_discriminator_all_of_super.py | 53 ++++++++ .../.openapi-generator/FILES | 6 + .../petstore/python-pydantic-v1/README.md | 2 + .../docs/DiscriminatorAllOfSub.md | 27 +++++ .../docs/DiscriminatorAllOfSuper.md | 28 +++++ .../petstore_api/__init__.py | 2 + .../petstore_api/models/__init__.py | 2 + .../models/discriminator_all_of_sub.py | 83 +++++++++++++ .../models/discriminator_all_of_super.py | 96 +++++++++++++++ .../test/test_discriminator_all_of_sub.py | 51 ++++++++ .../test/test_discriminator_all_of_super.py | 53 ++++++++ .../petstore/python/.openapi-generator/FILES | 6 + .../openapi3/client/petstore/python/README.md | 2 + .../python/docs/DiscriminatorAllOfSub.md | 28 +++++ .../python/docs/DiscriminatorAllOfSuper.md | 29 +++++ .../petstore/python/petstore_api/__init__.py | 2 + .../python/petstore_api/models/__init__.py | 2 + .../models/discriminator_all_of_sub.py | 99 +++++++++++++++ .../models/discriminator_all_of_super.py | 114 ++++++++++++++++++ .../test/test_discriminator_all_of_sub.py | 50 ++++++++ .../test/test_discriminator_all_of_super.py | 52 ++++++++ 40 files changed, 1428 insertions(+) create mode 100644 samples/openapi3/client/petstore/python-aiohttp/docs/DiscriminatorAllOfSub.md create mode 100644 samples/openapi3/client/petstore/python-aiohttp/docs/DiscriminatorAllOfSuper.md create mode 100644 samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_sub.py create mode 100644 samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_super.py create mode 100644 samples/openapi3/client/petstore/python-aiohttp/test/test_discriminator_all_of_sub.py create mode 100644 samples/openapi3/client/petstore/python-aiohttp/test/test_discriminator_all_of_super.py create mode 100644 samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DiscriminatorAllOfSub.md create mode 100644 samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DiscriminatorAllOfSuper.md create mode 100644 samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_sub.py create mode 100644 samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_super.py create mode 100644 samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_discriminator_all_of_sub.py create mode 100644 samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_discriminator_all_of_super.py create mode 100644 samples/openapi3/client/petstore/python-pydantic-v1/docs/DiscriminatorAllOfSub.md create mode 100644 samples/openapi3/client/petstore/python-pydantic-v1/docs/DiscriminatorAllOfSuper.md create mode 100644 samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_sub.py create mode 100644 samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_super.py create mode 100644 samples/openapi3/client/petstore/python-pydantic-v1/test/test_discriminator_all_of_sub.py create mode 100644 samples/openapi3/client/petstore/python-pydantic-v1/test/test_discriminator_all_of_super.py create mode 100644 samples/openapi3/client/petstore/python/docs/DiscriminatorAllOfSub.md create mode 100644 samples/openapi3/client/petstore/python/docs/DiscriminatorAllOfSuper.md create mode 100644 samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_sub.py create mode 100644 samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_super.py create mode 100644 samples/openapi3/client/petstore/python/test/test_discriminator_all_of_sub.py create mode 100644 samples/openapi3/client/petstore/python/test/test_discriminator_all_of_super.py diff --git a/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES index d56ebf6ba52a..bdec77f5320d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES @@ -30,6 +30,8 @@ docs/CreatureInfo.md docs/DanishPig.md docs/DefaultApi.md docs/DeprecatedObject.md +docs/DiscriminatorAllOfSub.md +docs/DiscriminatorAllOfSuper.md docs/Dog.md docs/DummyModel.md docs/EnumArrays.md @@ -140,6 +142,8 @@ petstore_api/models/creature.py petstore_api/models/creature_info.py petstore_api/models/danish_pig.py petstore_api/models/deprecated_object.py +petstore_api/models/discriminator_all_of_sub.py +petstore_api/models/discriminator_all_of_super.py petstore_api/models/dog.py petstore_api/models/dummy_model.py petstore_api/models/enum_arrays.py @@ -214,4 +218,6 @@ setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_discriminator_all_of_sub.py +test/test_discriminator_all_of_super.py tox.ini diff --git a/samples/openapi3/client/petstore/python-aiohttp/README.md b/samples/openapi3/client/petstore/python-aiohttp/README.md index 60205006ddfd..3e37a008f4ea 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/README.md +++ b/samples/openapi3/client/petstore/python-aiohttp/README.md @@ -164,6 +164,8 @@ Class | Method | HTTP request | Description - [CreatureInfo](docs/CreatureInfo.md) - [DanishPig](docs/DanishPig.md) - [DeprecatedObject](docs/DeprecatedObject.md) + - [DiscriminatorAllOfSub](docs/DiscriminatorAllOfSub.md) + - [DiscriminatorAllOfSuper](docs/DiscriminatorAllOfSuper.md) - [Dog](docs/Dog.md) - [DummyModel](docs/DummyModel.md) - [EnumArrays](docs/EnumArrays.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/DiscriminatorAllOfSub.md b/samples/openapi3/client/petstore/python-aiohttp/docs/DiscriminatorAllOfSub.md new file mode 100644 index 000000000000..445cde662829 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/DiscriminatorAllOfSub.md @@ -0,0 +1,28 @@ +# DiscriminatorAllOfSub + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscriminatorAllOfSub from a JSON string +discriminator_all_of_sub_instance = DiscriminatorAllOfSub.from_json(json) +# print the JSON string representation of the object +print DiscriminatorAllOfSub.to_json() + +# convert the object into a dict +discriminator_all_of_sub_dict = discriminator_all_of_sub_instance.to_dict() +# create an instance of DiscriminatorAllOfSub from a dict +discriminator_all_of_sub_form_dict = discriminator_all_of_sub.from_dict(discriminator_all_of_sub_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/DiscriminatorAllOfSuper.md b/samples/openapi3/client/petstore/python-aiohttp/docs/DiscriminatorAllOfSuper.md new file mode 100644 index 000000000000..4f4c88686082 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/DiscriminatorAllOfSuper.md @@ -0,0 +1,29 @@ +# DiscriminatorAllOfSuper + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**element_type** | **str** | | + +## Example + +```python +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscriminatorAllOfSuper from a JSON string +discriminator_all_of_super_instance = DiscriminatorAllOfSuper.from_json(json) +# print the JSON string representation of the object +print DiscriminatorAllOfSuper.to_json() + +# convert the object into a dict +discriminator_all_of_super_dict = discriminator_all_of_super_instance.to_dict() +# create an instance of DiscriminatorAllOfSuper from a dict +discriminator_all_of_super_form_dict = discriminator_all_of_super.from_dict(discriminator_all_of_super_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py index 8a19de3a94ca..b038a7fc2608 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py @@ -63,6 +63,8 @@ from petstore_api.models.creature_info import CreatureInfo from petstore_api.models.danish_pig import DanishPig from petstore_api.models.deprecated_object import DeprecatedObject +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper from petstore_api.models.dog import Dog from petstore_api.models.dummy_model import DummyModel from petstore_api.models.enum_arrays import EnumArrays diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/__init__.py index 07e92b10ce08..4724dd902c60 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/__init__.py @@ -39,6 +39,8 @@ from petstore_api.models.creature_info import CreatureInfo from petstore_api.models.danish_pig import DanishPig from petstore_api.models.deprecated_object import DeprecatedObject +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper from petstore_api.models.dog import Dog from petstore_api.models.dummy_model import DummyModel from petstore_api.models.enum_arrays import EnumArrays diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_sub.py new file mode 100644 index 000000000000..222e38686bb0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_sub.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from typing import Any, ClassVar, Dict, List +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper +from typing import Optional, Set +from typing_extensions import Self + +class DiscriminatorAllOfSub(DiscriminatorAllOfSuper): + """ + DiscriminatorAllOfSub + """ # noqa: E501 + __properties: ClassVar[List[str]] = ["elementType"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DiscriminatorAllOfSub from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DiscriminatorAllOfSub from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "elementType": obj.get("elementType") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_super.py new file mode 100644 index 000000000000..6f17b73a4ba4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_super.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self + +class DiscriminatorAllOfSuper(BaseModel): + """ + DiscriminatorAllOfSuper + """ # noqa: E501 + element_type: StrictStr = Field(alias="elementType") + __properties: ClassVar[List[str]] = ["elementType"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = 'elementType' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'DiscriminatorAllOfSub': 'DiscriminatorAllOfSub' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Union[Self]]: + """Create an instance of DiscriminatorAllOfSuper from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[Self]]: + """Create an instance of DiscriminatorAllOfSuper from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type: + klass = globals()[object_type] + return klass.from_dict(obj) + else: + raise ValueError("DiscriminatorAllOfSuper failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub +# TODO: Rewrite to not use raise_errors +DiscriminatorAllOfSuper.model_rebuild(raise_errors=False) + diff --git a/samples/openapi3/client/petstore/python-aiohttp/test/test_discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python-aiohttp/test/test_discriminator_all_of_sub.py new file mode 100644 index 000000000000..15941f4f854a --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/test/test_discriminator_all_of_sub.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub + +class TestDiscriminatorAllOfSub(unittest.TestCase): + """DiscriminatorAllOfSub unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DiscriminatorAllOfSub: + """Test DiscriminatorAllOfSub + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DiscriminatorAllOfSub` + """ + model = DiscriminatorAllOfSub() + if include_optional: + return DiscriminatorAllOfSub( + ) + else: + return DiscriminatorAllOfSub( + ) + """ + + def testDiscriminatorAllOfSub(self): + """Test DiscriminatorAllOfSub""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-aiohttp/test/test_discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-aiohttp/test/test_discriminator_all_of_super.py new file mode 100644 index 000000000000..503d6b3c558c --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/test/test_discriminator_all_of_super.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper + +class TestDiscriminatorAllOfSuper(unittest.TestCase): + """DiscriminatorAllOfSuper unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DiscriminatorAllOfSuper: + """Test DiscriminatorAllOfSuper + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DiscriminatorAllOfSuper` + """ + model = DiscriminatorAllOfSuper() + if include_optional: + return DiscriminatorAllOfSuper( + element_type = '' + ) + else: + return DiscriminatorAllOfSuper( + element_type = '', + ) + """ + + def testDiscriminatorAllOfSuper(self): + """Test DiscriminatorAllOfSuper""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/.openapi-generator/FILES index bc131e51c8ed..b00c95d922da 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/.openapi-generator/FILES @@ -31,6 +31,8 @@ docs/CreatureInfo.md docs/DanishPig.md docs/DefaultApi.md docs/DeprecatedObject.md +docs/DiscriminatorAllOfSub.md +docs/DiscriminatorAllOfSuper.md docs/Dog.md docs/DummyModel.md docs/EnumArrays.md @@ -141,6 +143,8 @@ petstore_api/models/creature.py petstore_api/models/creature_info.py petstore_api/models/danish_pig.py petstore_api/models/deprecated_object.py +petstore_api/models/discriminator_all_of_sub.py +petstore_api/models/discriminator_all_of_super.py petstore_api/models/dog.py petstore_api/models/dummy_model.py petstore_api/models/enum_arrays.py @@ -214,4 +218,6 @@ setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_discriminator_all_of_sub.py +test/test_discriminator_all_of_super.py tox.ini diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/README.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/README.md index 80a9446dad3d..ccb95c2319b2 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/README.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/README.md @@ -166,6 +166,8 @@ Class | Method | HTTP request | Description - [CreatureInfo](docs/CreatureInfo.md) - [DanishPig](docs/DanishPig.md) - [DeprecatedObject](docs/DeprecatedObject.md) + - [DiscriminatorAllOfSub](docs/DiscriminatorAllOfSub.md) + - [DiscriminatorAllOfSuper](docs/DiscriminatorAllOfSuper.md) - [Dog](docs/Dog.md) - [DummyModel](docs/DummyModel.md) - [EnumArrays](docs/EnumArrays.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DiscriminatorAllOfSub.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DiscriminatorAllOfSub.md new file mode 100644 index 000000000000..b5dcd9919262 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DiscriminatorAllOfSub.md @@ -0,0 +1,27 @@ +# DiscriminatorAllOfSub + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscriminatorAllOfSub from a JSON string +discriminator_all_of_sub_instance = DiscriminatorAllOfSub.from_json(json) +# print the JSON string representation of the object +print DiscriminatorAllOfSub.to_json() + +# convert the object into a dict +discriminator_all_of_sub_dict = discriminator_all_of_sub_instance.to_dict() +# create an instance of DiscriminatorAllOfSub from a dict +discriminator_all_of_sub_form_dict = discriminator_all_of_sub.from_dict(discriminator_all_of_sub_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DiscriminatorAllOfSuper.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DiscriminatorAllOfSuper.md new file mode 100644 index 000000000000..9564ca75c80e --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DiscriminatorAllOfSuper.md @@ -0,0 +1,28 @@ +# DiscriminatorAllOfSuper + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**element_type** | **str** | | + +## Example + +```python +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscriminatorAllOfSuper from a JSON string +discriminator_all_of_super_instance = DiscriminatorAllOfSuper.from_json(json) +# print the JSON string representation of the object +print DiscriminatorAllOfSuper.to_json() + +# convert the object into a dict +discriminator_all_of_super_dict = discriminator_all_of_super_instance.to_dict() +# create an instance of DiscriminatorAllOfSuper from a dict +discriminator_all_of_super_form_dict = discriminator_all_of_super.from_dict(discriminator_all_of_super_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/__init__.py index adcad6b7cf5c..5b780780fd85 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/__init__.py @@ -64,6 +64,8 @@ from petstore_api.models.creature_info import CreatureInfo from petstore_api.models.danish_pig import DanishPig from petstore_api.models.deprecated_object import DeprecatedObject +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper from petstore_api.models.dog import Dog from petstore_api.models.dummy_model import DummyModel from petstore_api.models.enum_arrays import EnumArrays diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/__init__.py index bedca10121ac..5be0f85af54c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/__init__.py @@ -40,6 +40,8 @@ from petstore_api.models.creature_info import CreatureInfo from petstore_api.models.danish_pig import DanishPig from petstore_api.models.deprecated_object import DeprecatedObject +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper from petstore_api.models.dog import Dog from petstore_api.models.dummy_model import DummyModel from petstore_api.models.enum_arrays import EnumArrays diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_sub.py new file mode 100644 index 000000000000..65d54ea8d1a6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_sub.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + + + +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper + +class DiscriminatorAllOfSub(DiscriminatorAllOfSuper): + """ + DiscriminatorAllOfSub + """ + __properties = ["elementType"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> DiscriminatorAllOfSub: + """Create an instance of DiscriminatorAllOfSub from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> DiscriminatorAllOfSub: + """Create an instance of DiscriminatorAllOfSub from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return DiscriminatorAllOfSub.parse_obj(obj) + + _obj = DiscriminatorAllOfSub.parse_obj({ + "element_type": obj.get("elementType") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_super.py new file mode 100644 index 000000000000..e25ade5c1996 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_super.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Union +from pydantic import BaseModel, Field, StrictStr + +class DiscriminatorAllOfSuper(BaseModel): + """ + DiscriminatorAllOfSuper + """ + element_type: StrictStr = Field(..., alias="elementType") + __properties = ["elementType"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + # JSON field name that stores the object type + __discriminator_property_name = 'elementType' + + # discriminator mappings + __discriminator_value_class_map = { + 'DiscriminatorAllOfSub': 'DiscriminatorAllOfSub' + } + + @classmethod + def get_discriminator_value(cls, obj: dict) -> str: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Union(DiscriminatorAllOfSub): + """Create an instance of DiscriminatorAllOfSuper from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> Union(DiscriminatorAllOfSub): + """Create an instance of DiscriminatorAllOfSuper from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type: + klass = globals()[object_type] + return klass.from_dict(obj) + else: + raise ValueError("DiscriminatorAllOfSuper failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub +DiscriminatorAllOfSuper.update_forward_refs() + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_discriminator_all_of_sub.py new file mode 100644 index 000000000000..50defed512a2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_discriminator_all_of_sub.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub # noqa: E501 + +class TestDiscriminatorAllOfSub(unittest.TestCase): + """DiscriminatorAllOfSub unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DiscriminatorAllOfSub: + """Test DiscriminatorAllOfSub + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DiscriminatorAllOfSub` + """ + model = DiscriminatorAllOfSub() # noqa: E501 + if include_optional: + return DiscriminatorAllOfSub( + ) + else: + return DiscriminatorAllOfSub( + ) + """ + + def testDiscriminatorAllOfSub(self): + """Test DiscriminatorAllOfSub""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_discriminator_all_of_super.py new file mode 100644 index 000000000000..02567a14d3da --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_discriminator_all_of_super.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper # noqa: E501 + +class TestDiscriminatorAllOfSuper(unittest.TestCase): + """DiscriminatorAllOfSuper unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DiscriminatorAllOfSuper: + """Test DiscriminatorAllOfSuper + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DiscriminatorAllOfSuper` + """ + model = DiscriminatorAllOfSuper() # noqa: E501 + if include_optional: + return DiscriminatorAllOfSuper( + element_type = '' + ) + else: + return DiscriminatorAllOfSuper( + element_type = '', + ) + """ + + def testDiscriminatorAllOfSuper(self): + """Test DiscriminatorAllOfSuper""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-pydantic-v1/.openapi-generator/FILES index bc131e51c8ed..b00c95d922da 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-pydantic-v1/.openapi-generator/FILES @@ -31,6 +31,8 @@ docs/CreatureInfo.md docs/DanishPig.md docs/DefaultApi.md docs/DeprecatedObject.md +docs/DiscriminatorAllOfSub.md +docs/DiscriminatorAllOfSuper.md docs/Dog.md docs/DummyModel.md docs/EnumArrays.md @@ -141,6 +143,8 @@ petstore_api/models/creature.py petstore_api/models/creature_info.py petstore_api/models/danish_pig.py petstore_api/models/deprecated_object.py +petstore_api/models/discriminator_all_of_sub.py +petstore_api/models/discriminator_all_of_super.py petstore_api/models/dog.py petstore_api/models/dummy_model.py petstore_api/models/enum_arrays.py @@ -214,4 +218,6 @@ setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_discriminator_all_of_sub.py +test/test_discriminator_all_of_super.py tox.ini diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/README.md b/samples/openapi3/client/petstore/python-pydantic-v1/README.md index cb9e33592a50..b286288a0e91 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/README.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/README.md @@ -166,6 +166,8 @@ Class | Method | HTTP request | Description - [CreatureInfo](docs/CreatureInfo.md) - [DanishPig](docs/DanishPig.md) - [DeprecatedObject](docs/DeprecatedObject.md) + - [DiscriminatorAllOfSub](docs/DiscriminatorAllOfSub.md) + - [DiscriminatorAllOfSuper](docs/DiscriminatorAllOfSuper.md) - [Dog](docs/Dog.md) - [DummyModel](docs/DummyModel.md) - [EnumArrays](docs/EnumArrays.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/DiscriminatorAllOfSub.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/DiscriminatorAllOfSub.md new file mode 100644 index 000000000000..b5dcd9919262 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/DiscriminatorAllOfSub.md @@ -0,0 +1,27 @@ +# DiscriminatorAllOfSub + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscriminatorAllOfSub from a JSON string +discriminator_all_of_sub_instance = DiscriminatorAllOfSub.from_json(json) +# print the JSON string representation of the object +print DiscriminatorAllOfSub.to_json() + +# convert the object into a dict +discriminator_all_of_sub_dict = discriminator_all_of_sub_instance.to_dict() +# create an instance of DiscriminatorAllOfSub from a dict +discriminator_all_of_sub_form_dict = discriminator_all_of_sub.from_dict(discriminator_all_of_sub_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/DiscriminatorAllOfSuper.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/DiscriminatorAllOfSuper.md new file mode 100644 index 000000000000..9564ca75c80e --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/DiscriminatorAllOfSuper.md @@ -0,0 +1,28 @@ +# DiscriminatorAllOfSuper + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**element_type** | **str** | | + +## Example + +```python +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscriminatorAllOfSuper from a JSON string +discriminator_all_of_super_instance = DiscriminatorAllOfSuper.from_json(json) +# print the JSON string representation of the object +print DiscriminatorAllOfSuper.to_json() + +# convert the object into a dict +discriminator_all_of_super_dict = discriminator_all_of_super_instance.to_dict() +# create an instance of DiscriminatorAllOfSuper from a dict +discriminator_all_of_super_form_dict = discriminator_all_of_super.from_dict(discriminator_all_of_super_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/__init__.py index adcad6b7cf5c..5b780780fd85 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/__init__.py @@ -64,6 +64,8 @@ from petstore_api.models.creature_info import CreatureInfo from petstore_api.models.danish_pig import DanishPig from petstore_api.models.deprecated_object import DeprecatedObject +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper from petstore_api.models.dog import Dog from petstore_api.models.dummy_model import DummyModel from petstore_api.models.enum_arrays import EnumArrays diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/__init__.py index bedca10121ac..5be0f85af54c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/__init__.py @@ -40,6 +40,8 @@ from petstore_api.models.creature_info import CreatureInfo from petstore_api.models.danish_pig import DanishPig from petstore_api.models.deprecated_object import DeprecatedObject +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper from petstore_api.models.dog import Dog from petstore_api.models.dummy_model import DummyModel from petstore_api.models.enum_arrays import EnumArrays diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_sub.py new file mode 100644 index 000000000000..271339926344 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_sub.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict + +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper + +class DiscriminatorAllOfSub(DiscriminatorAllOfSuper): + """ + DiscriminatorAllOfSub + """ + additional_properties: Dict[str, Any] = {} + __properties = ["elementType"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> DiscriminatorAllOfSub: + """Create an instance of DiscriminatorAllOfSub from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> DiscriminatorAllOfSub: + """Create an instance of DiscriminatorAllOfSub from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return DiscriminatorAllOfSub.parse_obj(obj) + + _obj = DiscriminatorAllOfSub.parse_obj({ + "element_type": obj.get("elementType") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_super.py new file mode 100644 index 000000000000..dfb9173f4e63 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_super.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Union +from pydantic import BaseModel, Field, StrictStr + +class DiscriminatorAllOfSuper(BaseModel): + """ + DiscriminatorAllOfSuper + """ + element_type: StrictStr = Field(..., alias="elementType") + additional_properties: Dict[str, Any] = {} + __properties = ["elementType"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + # JSON field name that stores the object type + __discriminator_property_name = 'elementType' + + # discriminator mappings + __discriminator_value_class_map = { + 'DiscriminatorAllOfSub': 'DiscriminatorAllOfSub' + } + + @classmethod + def get_discriminator_value(cls, obj: dict) -> str: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Union(DiscriminatorAllOfSub): + """Create an instance of DiscriminatorAllOfSuper from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> Union(DiscriminatorAllOfSub): + """Create an instance of DiscriminatorAllOfSuper from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type: + klass = globals()[object_type] + return klass.from_dict(obj) + else: + raise ValueError("DiscriminatorAllOfSuper failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub +DiscriminatorAllOfSuper.update_forward_refs() + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/test/test_discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python-pydantic-v1/test/test_discriminator_all_of_sub.py new file mode 100644 index 000000000000..50defed512a2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/test/test_discriminator_all_of_sub.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub # noqa: E501 + +class TestDiscriminatorAllOfSub(unittest.TestCase): + """DiscriminatorAllOfSub unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DiscriminatorAllOfSub: + """Test DiscriminatorAllOfSub + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DiscriminatorAllOfSub` + """ + model = DiscriminatorAllOfSub() # noqa: E501 + if include_optional: + return DiscriminatorAllOfSub( + ) + else: + return DiscriminatorAllOfSub( + ) + """ + + def testDiscriminatorAllOfSub(self): + """Test DiscriminatorAllOfSub""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/test/test_discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-pydantic-v1/test/test_discriminator_all_of_super.py new file mode 100644 index 000000000000..02567a14d3da --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/test/test_discriminator_all_of_super.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper # noqa: E501 + +class TestDiscriminatorAllOfSuper(unittest.TestCase): + """DiscriminatorAllOfSuper unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DiscriminatorAllOfSuper: + """Test DiscriminatorAllOfSuper + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DiscriminatorAllOfSuper` + """ + model = DiscriminatorAllOfSuper() # noqa: E501 + if include_optional: + return DiscriminatorAllOfSuper( + element_type = '' + ) + else: + return DiscriminatorAllOfSuper( + element_type = '', + ) + """ + + def testDiscriminatorAllOfSuper(self): + """Test DiscriminatorAllOfSuper""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/FILES b/samples/openapi3/client/petstore/python/.openapi-generator/FILES index d56ebf6ba52a..bdec77f5320d 100755 --- a/samples/openapi3/client/petstore/python/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python/.openapi-generator/FILES @@ -30,6 +30,8 @@ docs/CreatureInfo.md docs/DanishPig.md docs/DefaultApi.md docs/DeprecatedObject.md +docs/DiscriminatorAllOfSub.md +docs/DiscriminatorAllOfSuper.md docs/Dog.md docs/DummyModel.md docs/EnumArrays.md @@ -140,6 +142,8 @@ petstore_api/models/creature.py petstore_api/models/creature_info.py petstore_api/models/danish_pig.py petstore_api/models/deprecated_object.py +petstore_api/models/discriminator_all_of_sub.py +petstore_api/models/discriminator_all_of_super.py petstore_api/models/dog.py petstore_api/models/dummy_model.py petstore_api/models/enum_arrays.py @@ -214,4 +218,6 @@ setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_discriminator_all_of_sub.py +test/test_discriminator_all_of_super.py tox.ini diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index 329b8030e50f..cdee1ebeb627 100755 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -164,6 +164,8 @@ Class | Method | HTTP request | Description - [CreatureInfo](docs/CreatureInfo.md) - [DanishPig](docs/DanishPig.md) - [DeprecatedObject](docs/DeprecatedObject.md) + - [DiscriminatorAllOfSub](docs/DiscriminatorAllOfSub.md) + - [DiscriminatorAllOfSuper](docs/DiscriminatorAllOfSuper.md) - [Dog](docs/Dog.md) - [DummyModel](docs/DummyModel.md) - [EnumArrays](docs/EnumArrays.md) diff --git a/samples/openapi3/client/petstore/python/docs/DiscriminatorAllOfSub.md b/samples/openapi3/client/petstore/python/docs/DiscriminatorAllOfSub.md new file mode 100644 index 000000000000..445cde662829 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/DiscriminatorAllOfSub.md @@ -0,0 +1,28 @@ +# DiscriminatorAllOfSub + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscriminatorAllOfSub from a JSON string +discriminator_all_of_sub_instance = DiscriminatorAllOfSub.from_json(json) +# print the JSON string representation of the object +print DiscriminatorAllOfSub.to_json() + +# convert the object into a dict +discriminator_all_of_sub_dict = discriminator_all_of_sub_instance.to_dict() +# create an instance of DiscriminatorAllOfSub from a dict +discriminator_all_of_sub_form_dict = discriminator_all_of_sub.from_dict(discriminator_all_of_sub_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python/docs/DiscriminatorAllOfSuper.md b/samples/openapi3/client/petstore/python/docs/DiscriminatorAllOfSuper.md new file mode 100644 index 000000000000..4f4c88686082 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/DiscriminatorAllOfSuper.md @@ -0,0 +1,29 @@ +# DiscriminatorAllOfSuper + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**element_type** | **str** | | + +## Example + +```python +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscriminatorAllOfSuper from a JSON string +discriminator_all_of_super_instance = DiscriminatorAllOfSuper.from_json(json) +# print the JSON string representation of the object +print DiscriminatorAllOfSuper.to_json() + +# convert the object into a dict +discriminator_all_of_super_dict = discriminator_all_of_super_instance.to_dict() +# create an instance of DiscriminatorAllOfSuper from a dict +discriminator_all_of_super_form_dict = discriminator_all_of_super.from_dict(discriminator_all_of_super_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python/petstore_api/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/__init__.py index 8a19de3a94ca..b038a7fc2608 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/__init__.py @@ -63,6 +63,8 @@ from petstore_api.models.creature_info import CreatureInfo from petstore_api.models.danish_pig import DanishPig from petstore_api.models.deprecated_object import DeprecatedObject +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper from petstore_api.models.dog import Dog from petstore_api.models.dummy_model import DummyModel from petstore_api.models.enum_arrays import EnumArrays diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py index 07e92b10ce08..4724dd902c60 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py @@ -39,6 +39,8 @@ from petstore_api.models.creature_info import CreatureInfo from petstore_api.models.danish_pig import DanishPig from petstore_api.models.deprecated_object import DeprecatedObject +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper from petstore_api.models.dog import Dog from petstore_api.models.dummy_model import DummyModel from petstore_api.models.enum_arrays import EnumArrays diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_sub.py new file mode 100644 index 000000000000..ec3991985da4 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_sub.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from typing import Any, ClassVar, Dict, List +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper +from typing import Optional, Set +from typing_extensions import Self + +class DiscriminatorAllOfSub(DiscriminatorAllOfSuper): + """ + DiscriminatorAllOfSub + """ # noqa: E501 + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["elementType"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DiscriminatorAllOfSub from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DiscriminatorAllOfSub from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "elementType": obj.get("elementType") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_super.py b/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_super.py new file mode 100644 index 000000000000..fc65d4dc9b54 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_super.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self + +class DiscriminatorAllOfSuper(BaseModel): + """ + DiscriminatorAllOfSuper + """ # noqa: E501 + element_type: StrictStr = Field(alias="elementType") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["elementType"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = 'elementType' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'DiscriminatorAllOfSub': 'DiscriminatorAllOfSub' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Union[Self]]: + """Create an instance of DiscriminatorAllOfSuper from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[Self]]: + """Create an instance of DiscriminatorAllOfSuper from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type: + klass = globals()[object_type] + return klass.from_dict(obj) + else: + raise ValueError("DiscriminatorAllOfSuper failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub +# TODO: Rewrite to not use raise_errors +DiscriminatorAllOfSuper.model_rebuild(raise_errors=False) + diff --git a/samples/openapi3/client/petstore/python/test/test_discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python/test/test_discriminator_all_of_sub.py new file mode 100644 index 000000000000..15941f4f854a --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_discriminator_all_of_sub.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub + +class TestDiscriminatorAllOfSub(unittest.TestCase): + """DiscriminatorAllOfSub unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DiscriminatorAllOfSub: + """Test DiscriminatorAllOfSub + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DiscriminatorAllOfSub` + """ + model = DiscriminatorAllOfSub() + if include_optional: + return DiscriminatorAllOfSub( + ) + else: + return DiscriminatorAllOfSub( + ) + """ + + def testDiscriminatorAllOfSub(self): + """Test DiscriminatorAllOfSub""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_discriminator_all_of_super.py b/samples/openapi3/client/petstore/python/test/test_discriminator_all_of_super.py new file mode 100644 index 000000000000..503d6b3c558c --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_discriminator_all_of_super.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper + +class TestDiscriminatorAllOfSuper(unittest.TestCase): + """DiscriminatorAllOfSuper unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DiscriminatorAllOfSuper: + """Test DiscriminatorAllOfSuper + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DiscriminatorAllOfSuper` + """ + model = DiscriminatorAllOfSuper() + if include_optional: + return DiscriminatorAllOfSuper( + element_type = '' + ) + else: + return DiscriminatorAllOfSuper( + element_type = '', + ) + """ + + def testDiscriminatorAllOfSuper(self): + """Test DiscriminatorAllOfSuper""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() From ffc0d2bc68bd3dd70b9a0454acdd5f49278d8de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Sat, 17 Feb 2024 19:19:43 +0000 Subject: [PATCH 03/12] [python] fix assert in test --- samples/openapi3/client/petstore/python/tests/test_model.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/samples/openapi3/client/petstore/python/tests/test_model.py b/samples/openapi3/client/petstore/python/tests/test_model.py index 7e284d7b19b6..9ca69d0a53c5 100644 --- a/samples/openapi3/client/petstore/python/tests/test_model.py +++ b/samples/openapi3/client/petstore/python/tests/test_model.py @@ -344,9 +344,8 @@ def test_inheritance(self): self.assertEqual(dog2.color, 'white') def test_inheritance_discriminators(self): - petstore_api.DiscriminatorAllOfSuper.from_dict({"className": "dog", "color": "white", "breed": "bulldog"}) - - + model = petstore_api.DiscriminatorAllOfSuper.from_dict({"elementType": "DiscriminatorAllOfSub"}) + self.assertIsInstance(model, petstore_api.DiscriminatorAllOfSub) def test_list(self): # should throw exception as var_123_list should be string From 747a2531d58a79427bf1906e0e00b13a073f7c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Sat, 17 Feb 2024 22:51:17 +0000 Subject: [PATCH 04/12] [python] fix inheritance discriminators circular import --- .../languages/AbstractPythonCodegen.java | 8 ++--- .../resources/python/model_generic.mustache | 31 +++++++++++++------ 2 files changed, 26 insertions(+), 13 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 643983be167f..63092ed54ffa 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 @@ -927,10 +927,7 @@ private ModelsMap postProcessModelsMap(ModelsMap objs) { // if super class if (model.getDiscriminator() != null && model.getDiscriminator().getMappedModels() != null) { moduleImports.add("typing", "Union"); - Set discriminator = model.getDiscriminator().getMappedModels(); - for (CodegenDiscriminator.MappedModel mappedModel : discriminator) { - postponedModelImports.add(mappedModel.getModelName()); - } + moduleImports.add("importlib", "import_module"); } } @@ -1027,6 +1024,9 @@ private ModelsMap postProcessModelsMap(ModelsMap objs) { // skip self import continue; } + if (model.parent != null && model.parent.equals(modelImport)) { + continue; + } modelsToImport.add("from " + packageName + ".models." + underscore(modelImport) + " import " + modelImport); } 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 fe470f8295ff..139d1c293fd8 100644 --- a/modules/openapi-generator/src/main/resources/python/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_generic.mustache @@ -12,6 +12,15 @@ import json from typing import Optional, Set from typing_extensions import Self +{{#hasChildren}}{{#discriminator}} +{{! If this model is a super class, importlib is used. So import the necessary modules for the type here. }} +from typing import TYPE_CHECKING +if TYPE_CHECKING: +{{#mappedModels}} + from {{packageName}}.models.{{model.classVarName}} import {{modelName}} +{{/mappedModels}} +{{/discriminator}}{{/hasChildren}} + class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}): """ {{#description}}{{{description}}}{{/description}}{{^description}}{{{classname}}}{{/description}} @@ -113,7 +122,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[{{^hasChildren}}Self{{/hasChildren}}{{#hasChildren}}{{#discriminator}}Union[{{#children}}Self{{^-last}}, {{/-last}}{{/children}}]{{/discriminator}}{{^discriminator}}Self{{/discriminator}}{{/hasChildren}}]: + def from_json(cls, json_str: str) -> Optional[{{^hasChildren}}Self{{/hasChildren}}{{#hasChildren}}{{#discriminator}}Union[{{#mappedModels}}{{{modelName}}}{{^-last}}, {{/-last}}{{/mappedModels}}]{{/discriminator}}{{^discriminator}}Self{{/discriminator}}{{/hasChildren}}]: """Create an instance of {{{classname}}} from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -236,18 +245,22 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} {{#hasChildren}} @classmethod - def from_dict(cls, obj: Dict[str, Any]) -> Optional[{{#discriminator}}Union[{{#children}}Self{{^-last}}, {{/-last}}{{/children}}]{{/discriminator}}{{^discriminator}}Self{{/discriminator}}]: + def from_dict(cls, obj: Dict[str, Any]) -> Optional[{{#discriminator}}Union[{{#mappedModels}}{{{modelName}}}{{^-last}}, {{/-last}}{{/mappedModels}}]{{/discriminator}}]: """Create an instance of {{{classname}}} from a dict""" {{#discriminator}} # look up the object type based on discriminator mapping object_type = cls.get_discriminator_value(obj) - if object_type: - klass = globals()[object_type] - return klass.from_dict(obj) - else: - raise ValueError("{{{classname}}} failed to lookup discriminator value from " + - json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + - ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + {{#mappedModels}} + if object_type == '{{{mappingName}}}': + return import_module("{{packageName}}.models.{{model.classVarName}}").{{modelName}}.from_dict(obj) # type: ignore + {{/mappedModels}} + + raise ValueError("{{{classname}}} failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + {{/discriminator}} + {{^discriminator}} + return cls.model_validate(obj) {{/discriminator}} {{/hasChildren}} {{^hasChildren}} From 33dbedc2edb66ad17737cbb2143d4366df32fbde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Sat, 17 Feb 2024 22:51:37 +0000 Subject: [PATCH 05/12] [python] update samples --- .../openapi_client/models/bird.py | 2 ++ .../openapi_client/models/category.py | 2 ++ .../openapi_client/models/data_query.py | 2 ++ .../openapi_client/models/default_value.py | 2 ++ .../models/number_properties_only.py | 2 ++ .../openapi_client/models/pet.py | 2 ++ .../openapi_client/models/query.py | 5 ++- .../openapi_client/models/tag.py | 2 ++ ...ue_object_all_of_query_object_parameter.py | 2 ++ ...rue_array_string_query_object_parameter.py | 2 ++ .../python/openapi_client/models/bird.py | 2 ++ .../python/openapi_client/models/category.py | 2 ++ .../openapi_client/models/data_query.py | 2 ++ .../openapi_client/models/default_value.py | 2 ++ .../models/number_properties_only.py | 2 ++ .../python/openapi_client/models/pet.py | 2 ++ .../python/openapi_client/models/query.py | 5 ++- .../python/openapi_client/models/tag.py | 2 ++ ...ue_object_all_of_query_object_parameter.py | 2 ++ ...rue_array_string_query_object_parameter.py | 2 ++ .../python-aiohttp/.openapi-generator/FILES | 2 -- .../models/additional_properties_any_type.py | 2 ++ .../models/additional_properties_class.py | 2 ++ .../models/additional_properties_object.py | 2 ++ ...tional_properties_with_description_only.py | 2 ++ .../models/all_of_with_single_ref.py | 2 ++ .../petstore_api/models/animal.py | 33 +++++++++++-------- .../models/array_of_array_of_model.py | 2 ++ .../models/array_of_array_of_number_only.py | 2 ++ .../models/array_of_number_only.py | 2 ++ .../petstore_api/models/array_test.py | 2 ++ .../petstore_api/models/basque_pig.py | 2 ++ .../petstore_api/models/bathing.py | 2 ++ .../petstore_api/models/capitalization.py | 2 ++ .../python-aiohttp/petstore_api/models/cat.py | 2 ++ .../petstore_api/models/category.py | 2 ++ .../models/circular_reference_model.py | 2 ++ .../petstore_api/models/class_model.py | 2 ++ .../petstore_api/models/client.py | 2 ++ .../petstore_api/models/creature.py | 2 ++ .../petstore_api/models/creature_info.py | 2 ++ .../petstore_api/models/danish_pig.py | 2 ++ .../petstore_api/models/deprecated_object.py | 2 ++ .../models/discriminator_all_of_sub.py | 2 ++ .../models/discriminator_all_of_super.py | 27 ++++++++------- .../python-aiohttp/petstore_api/models/dog.py | 2 ++ .../petstore_api/models/dummy_model.py | 2 ++ .../petstore_api/models/enum_arrays.py | 2 ++ .../petstore_api/models/enum_test.py | 2 ++ .../petstore_api/models/feeding.py | 2 ++ .../petstore_api/models/file.py | 2 ++ .../models/file_schema_test_class.py | 2 ++ .../petstore_api/models/first_ref.py | 2 ++ .../python-aiohttp/petstore_api/models/foo.py | 2 ++ .../models/foo_get_default_response.py | 2 ++ .../petstore_api/models/format_test.py | 2 ++ .../petstore_api/models/has_only_read_only.py | 2 ++ .../models/health_check_result.py | 2 ++ .../models/inner_dict_with_property.py | 2 ++ .../petstore_api/models/input_all_of.py | 2 ++ .../petstore_api/models/list_class.py | 2 ++ .../models/map_of_array_of_model.py | 2 ++ .../petstore_api/models/map_test.py | 2 ++ ...perties_and_additional_properties_class.py | 2 ++ .../petstore_api/models/model200_response.py | 2 ++ .../petstore_api/models/model_api_response.py | 2 ++ .../petstore_api/models/model_return.py | 2 ++ .../petstore_api/models/name.py | 2 ++ .../petstore_api/models/nullable_class.py | 2 ++ .../petstore_api/models/nullable_property.py | 2 ++ .../petstore_api/models/number_only.py | 2 ++ .../object_to_test_additional_properties.py | 2 ++ .../models/object_with_deprecated_fields.py | 2 ++ .../petstore_api/models/order.py | 2 ++ .../petstore_api/models/outer_composite.py | 2 ++ .../models/outer_object_with_enum_property.py | 2 ++ .../petstore_api/models/parent.py | 2 ++ .../models/parent_with_optional_dict.py | 2 ++ .../python-aiohttp/petstore_api/models/pet.py | 2 ++ .../petstore_api/models/poop_cleaning.py | 2 ++ .../petstore_api/models/property_map.py | 2 ++ .../models/property_name_collision.py | 2 ++ .../petstore_api/models/read_only_first.py | 2 ++ .../petstore_api/models/second_ref.py | 2 ++ .../models/self_reference_model.py | 2 ++ .../petstore_api/models/special_model_name.py | 2 ++ .../petstore_api/models/special_name.py | 2 ++ .../python-aiohttp/petstore_api/models/tag.py | 2 ++ .../petstore_api/models/task.py | 2 ++ ..._error_responses_with_model400_response.py | 2 ++ ..._error_responses_with_model404_response.py | 2 ++ ..._freeform_additional_properties_request.py | 2 ++ .../petstore_api/models/tiger.py | 2 ++ ...t_with_additional_model_list_properties.py | 2 ++ ..._with_additional_string_list_properties.py | 2 ++ .../petstore_api/models/user.py | 2 ++ .../petstore_api/models/with_nested_one_of.py | 2 ++ .../.openapi-generator/FILES | 2 -- .../.openapi-generator/FILES | 2 -- .../petstore/python/.openapi-generator/FILES | 2 -- .../models/additional_properties_any_type.py | 2 ++ .../models/additional_properties_class.py | 2 ++ .../models/additional_properties_object.py | 2 ++ ...tional_properties_with_description_only.py | 2 ++ .../models/all_of_with_single_ref.py | 2 ++ .../python/petstore_api/models/animal.py | 33 +++++++++++-------- .../models/array_of_array_of_model.py | 2 ++ .../models/array_of_array_of_number_only.py | 2 ++ .../models/array_of_number_only.py | 2 ++ .../python/petstore_api/models/array_test.py | 2 ++ .../python/petstore_api/models/basque_pig.py | 2 ++ .../python/petstore_api/models/bathing.py | 2 ++ .../petstore_api/models/capitalization.py | 2 ++ .../python/petstore_api/models/cat.py | 2 ++ .../python/petstore_api/models/category.py | 2 ++ .../models/circular_reference_model.py | 2 ++ .../python/petstore_api/models/class_model.py | 2 ++ .../python/petstore_api/models/client.py | 2 ++ .../python/petstore_api/models/creature.py | 2 ++ .../petstore_api/models/creature_info.py | 2 ++ .../python/petstore_api/models/danish_pig.py | 2 ++ .../petstore_api/models/deprecated_object.py | 2 ++ .../models/discriminator_all_of_sub.py | 2 ++ .../models/discriminator_all_of_super.py | 27 ++++++++------- .../python/petstore_api/models/dog.py | 2 ++ .../python/petstore_api/models/dummy_model.py | 2 ++ .../python/petstore_api/models/enum_arrays.py | 2 ++ .../python/petstore_api/models/enum_test.py | 2 ++ .../python/petstore_api/models/feeding.py | 2 ++ .../python/petstore_api/models/file.py | 2 ++ .../models/file_schema_test_class.py | 2 ++ .../python/petstore_api/models/first_ref.py | 2 ++ .../python/petstore_api/models/foo.py | 2 ++ .../models/foo_get_default_response.py | 2 ++ .../python/petstore_api/models/format_test.py | 2 ++ .../petstore_api/models/has_only_read_only.py | 2 ++ .../models/health_check_result.py | 2 ++ .../models/inner_dict_with_property.py | 2 ++ .../petstore_api/models/input_all_of.py | 2 ++ .../python/petstore_api/models/list_class.py | 2 ++ .../models/map_of_array_of_model.py | 2 ++ .../python/petstore_api/models/map_test.py | 2 ++ ...perties_and_additional_properties_class.py | 2 ++ .../petstore_api/models/model200_response.py | 2 ++ .../petstore_api/models/model_api_response.py | 2 ++ .../petstore_api/models/model_return.py | 2 ++ .../python/petstore_api/models/name.py | 2 ++ .../petstore_api/models/nullable_class.py | 2 ++ .../petstore_api/models/nullable_property.py | 2 ++ .../python/petstore_api/models/number_only.py | 2 ++ .../object_to_test_additional_properties.py | 2 ++ .../models/object_with_deprecated_fields.py | 2 ++ .../python/petstore_api/models/order.py | 2 ++ .../petstore_api/models/outer_composite.py | 2 ++ .../models/outer_object_with_enum_property.py | 2 ++ .../python/petstore_api/models/parent.py | 2 ++ .../models/parent_with_optional_dict.py | 2 ++ .../python/petstore_api/models/pet.py | 2 ++ .../petstore_api/models/poop_cleaning.py | 2 ++ .../petstore_api/models/property_map.py | 2 ++ .../models/property_name_collision.py | 2 ++ .../petstore_api/models/read_only_first.py | 2 ++ .../python/petstore_api/models/second_ref.py | 2 ++ .../models/self_reference_model.py | 2 ++ .../petstore_api/models/special_model_name.py | 2 ++ .../petstore_api/models/special_name.py | 2 ++ .../python/petstore_api/models/tag.py | 2 ++ .../python/petstore_api/models/task.py | 2 ++ ..._error_responses_with_model400_response.py | 2 ++ ..._error_responses_with_model404_response.py | 2 ++ ..._freeform_additional_properties_request.py | 2 ++ .../python/petstore_api/models/tiger.py | 2 ++ ...t_with_additional_model_list_properties.py | 2 ++ ..._with_additional_string_list_properties.py | 2 ++ .../python/petstore_api/models/user.py | 2 ++ .../petstore_api/models/with_nested_one_of.py | 2 ++ 176 files changed, 408 insertions(+), 62 deletions(-) diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/bird.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/bird.py index 5481dd4f015f..071517e2c3e3 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/bird.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/bird.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Bird(BaseModel): """ Bird diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/category.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/category.py index e46f6989cb44..df74078f7f70 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/category.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/category.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Category(BaseModel): """ Category diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/data_query.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/data_query.py index 6bac8e154f55..c9d93c62d1cc 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/data_query.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/data_query.py @@ -25,6 +25,8 @@ from typing import Optional, Set from typing_extensions import Self + + class DataQuery(Query): """ DataQuery diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/default_value.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/default_value.py index b5311d7a43c6..545161c4b53a 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/default_value.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/default_value.py @@ -24,6 +24,8 @@ from typing import Optional, Set from typing_extensions import Self + + class DefaultValue(BaseModel): """ to test the default value of properties diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/number_properties_only.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/number_properties_only.py index 051e721ba13b..e3c66e4a8fca 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/number_properties_only.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/number_properties_only.py @@ -24,6 +24,8 @@ from typing import Optional, Set from typing_extensions import Self + + class NumberPropertiesOnly(BaseModel): """ NumberPropertiesOnly diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/pet.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/pet.py index 24eb8075e612..e2641d9f1a77 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/pet.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/pet.py @@ -25,6 +25,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Pet(BaseModel): """ Pet diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/query.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/query.py index 0d2c05017fdc..91c8cd7f090d 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/query.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/query.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Query(BaseModel): """ Query @@ -84,7 +86,8 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict[str, Any]) -> Optional[Self]: + def from_dict(cls, obj: Dict[str, Any]) -> Optional[]: """Create an instance of Query from a dict""" + return cls.model_validate(obj) diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/tag.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/tag.py index bd160fbe153b..3f71992195d7 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/tag.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/tag.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Tag(BaseModel): """ Tag diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py index 34bac06087ce..32d1e8f8af6b 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(BaseModel): """ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py index 7e3bd92a2737..bb8565773f05 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(BaseModel): """ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter 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 f86a1aff96cb..de64611236e3 100644 --- a/samples/client/echo_api/python/openapi_client/models/bird.py +++ b/samples/client/echo_api/python/openapi_client/models/bird.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Bird(BaseModel): """ Bird 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 d9a6df479279..8136c776df88 100644 --- a/samples/client/echo_api/python/openapi_client/models/category.py +++ b/samples/client/echo_api/python/openapi_client/models/category.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Category(BaseModel): """ Category 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 c55a1261d200..e0e25dda4fdf 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 @@ -25,6 +25,8 @@ from typing import Optional, Set from typing_extensions import Self + + class DataQuery(Query): """ DataQuery 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 a8c27c721cdd..9ca0e14c267c 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 @@ -24,6 +24,8 @@ from typing import Optional, Set from typing_extensions import Self + + class DefaultValue(BaseModel): """ to test the default value of properties 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 de1c47ad8454..bc0152629cc5 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 @@ -24,6 +24,8 @@ from typing import Optional, Set from typing_extensions import Self + + class NumberPropertiesOnly(BaseModel): """ NumberPropertiesOnly 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 a3f9d65d7103..297f03d0ecd3 100644 --- a/samples/client/echo_api/python/openapi_client/models/pet.py +++ b/samples/client/echo_api/python/openapi_client/models/pet.py @@ -25,6 +25,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Pet(BaseModel): """ Pet 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 0d2c05017fdc..91c8cd7f090d 100644 --- a/samples/client/echo_api/python/openapi_client/models/query.py +++ b/samples/client/echo_api/python/openapi_client/models/query.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Query(BaseModel): """ Query @@ -84,7 +86,8 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict[str, Any]) -> Optional[Self]: + def from_dict(cls, obj: Dict[str, Any]) -> Optional[]: """Create an instance of Query from a dict""" + return cls.model_validate(obj) 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 b26318f76074..c31ad2cd08b5 100644 --- a/samples/client/echo_api/python/openapi_client/models/tag.py +++ b/samples/client/echo_api/python/openapi_client/models/tag.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Tag(BaseModel): """ Tag 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 80184c582aca..97b271d38f98 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(BaseModel): """ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter 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 1a84a025f48e..daba23990585 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(BaseModel): """ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter diff --git a/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES index bdec77f5320d..8ca56876d60f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES @@ -218,6 +218,4 @@ setup.cfg setup.py test-requirements.txt test/__init__.py -test/test_discriminator_all_of_sub.py -test/test_discriminator_all_of_super.py tox.ini 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 43a139dc1749..bca6e58ee56d 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class AdditionalPropertiesAnyType(BaseModel): """ AdditionalPropertiesAnyType 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 7635dc54330d..5f06ea67ecdb 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class AdditionalPropertiesClass(BaseModel): """ AdditionalPropertiesClass 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 03735c7429c9..d808daa02f94 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class AdditionalPropertiesObject(BaseModel): """ AdditionalPropertiesObject 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 7e3f920ab3cb..155b23d5f65a 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class AdditionalPropertiesWithDescriptionOnly(BaseModel): """ AdditionalPropertiesWithDescriptionOnly 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 30b6645755ee..69322aaf4429 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class AllOfWithSingleRef(BaseModel): """ AllOfWithSingleRef 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 772b2bc93203..0a2f96df70e9 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 @@ -17,11 +17,19 @@ import re # noqa: F401 import json +from importlib import import_module from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Optional, Set from typing_extensions import Self + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from petstore_api.models.cat import Cat + from petstore_api.models.dog import Dog + + class Animal(BaseModel): """ Animal @@ -64,7 +72,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Union[Self, Self]]: + def from_json(cls, json_str: str) -> Optional[Union[Cat, Dog]]: """Create an instance of Animal from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -89,20 +97,17 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[Self, Self]]: + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[Cat, Dog]]: """Create an instance of Animal from a dict""" # look up the object type based on discriminator mapping object_type = cls.get_discriminator_value(obj) - if object_type: - klass = globals()[object_type] - return klass.from_dict(obj) - else: - raise ValueError("Animal failed to lookup discriminator value from " + - json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + - ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) - -from petstore_api.models.cat import Cat -from petstore_api.models.dog import Dog -# TODO: Rewrite to not use raise_errors -Animal.model_rebuild(raise_errors=False) + if object_type == 'Cat': + return import_module("petstore_api.models.cat").Cat.from_dict(obj) # type: ignore + if object_type == 'Dog': + return import_module("petstore_api.models.dog").Dog.from_dict(obj) # type: ignore + + raise ValueError("Animal failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + diff --git a/samples/openapi3/client/petstore/python-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 b1318218a1e9..a12b12ddd48b 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ArrayOfArrayOfModel(BaseModel): """ ArrayOfArrayOfModel 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 9ff34ea19ec0..59d7bea1455a 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ArrayOfArrayOfNumberOnly(BaseModel): """ ArrayOfArrayOfNumberOnly 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 4385be8a0560..11f7e48de0c4 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ArrayOfNumberOnly(BaseModel): """ ArrayOfNumberOnly 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 c5a44501eee7..453f43edf490 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 @@ -24,6 +24,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ArrayTest(BaseModel): """ ArrayTest 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 23ab0585d517..218c03f8e8f6 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class BasquePig(BaseModel): """ BasquePig diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/bathing.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/bathing.py index efc485131032..f2ba962b0833 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/bathing.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/bathing.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Bathing(BaseModel): """ Bathing 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 3a28f990d061..99b43480489d 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Capitalization(BaseModel): """ Capitalization 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 c215d0924705..55c4f546d352 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Cat(Animal): """ Cat 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 f3e78641caa6..8f3847869fc2 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Category(BaseModel): """ Category 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 3cafde6710ab..8514f00d9abb 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class CircularReferenceModel(BaseModel): """ CircularReferenceModel 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 58c3db52adac..4f40cb2f5a60 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ClassModel(BaseModel): """ Model for testing model with \"_class\" property 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 90c36a468676..19b39e4d218f 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Client(BaseModel): """ Client 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 73b1edc237cc..39c560f3b01e 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Creature(BaseModel): """ Creature 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 511ec5191a44..d9ef656e32fb 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class CreatureInfo(BaseModel): """ CreatureInfo 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 56a78bbea26d..b55410d29b66 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class DanishPig(BaseModel): """ DanishPig 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 d7c0fa761b4b..e5f436d61f1c 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class DeprecatedObject(BaseModel): """ DeprecatedObject diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_sub.py index 222e38686bb0..a8446821dfe6 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_sub.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_sub.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class DiscriminatorAllOfSub(DiscriminatorAllOfSuper): """ DiscriminatorAllOfSub diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_super.py index 6f17b73a4ba4..4acea3bf5e8c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_super.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_super.py @@ -17,11 +17,18 @@ import re # noqa: F401 import json +from importlib import import_module from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Union from typing import Optional, Set from typing_extensions import Self + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub + + class DiscriminatorAllOfSuper(BaseModel): """ DiscriminatorAllOfSuper @@ -63,7 +70,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Union[Self]]: + def from_json(cls, json_str: str) -> Optional[Union[DiscriminatorAllOfSub]]: """Create an instance of DiscriminatorAllOfSuper from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -88,19 +95,15 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[Self]]: + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[DiscriminatorAllOfSub]]: """Create an instance of DiscriminatorAllOfSuper from a dict""" # look up the object type based on discriminator mapping object_type = cls.get_discriminator_value(obj) - if object_type: - klass = globals()[object_type] - return klass.from_dict(obj) - else: - raise ValueError("DiscriminatorAllOfSuper failed to lookup discriminator value from " + - json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + - ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + if object_type == 'DiscriminatorAllOfSub': + return import_module("petstore_api.models.discriminator_all_of_sub").DiscriminatorAllOfSub.from_dict(obj) # type: ignore + + raise ValueError("DiscriminatorAllOfSuper failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) -from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub -# TODO: Rewrite to not use raise_errors -DiscriminatorAllOfSuper.model_rebuild(raise_errors=False) 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 71b1bd01bc95..f3d19ea687b8 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Dog(Animal): """ Dog 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 9da3d978f52a..45e85e04e328 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class DummyModel(BaseModel): """ DummyModel 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 6bac8225630a..7dd1873b18c7 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class EnumArrays(BaseModel): """ EnumArrays 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 4f2d86483fb5..8c3cee96419b 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 @@ -26,6 +26,8 @@ from typing import Optional, Set from typing_extensions import Self + + class EnumTest(BaseModel): """ EnumTest diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/feeding.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/feeding.py index 4c5333d3b161..02f2c2413737 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/feeding.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/feeding.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Feeding(BaseModel): """ Feeding 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 c43c9ffa91a7..a03b77962e05 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class File(BaseModel): """ Must be named `File` for test. 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 44324be0cb5f..80e5e9ed1b58 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class FileSchemaTestClass(BaseModel): """ FileSchemaTestClass 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 8c6b8b45bd27..1ccda45dc9da 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class FirstRef(BaseModel): """ FirstRef 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 b2c6fafde0cb..3f5180e60ba2 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Foo(BaseModel): """ Foo 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 205de5807608..0690b9000a72 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class FooGetDefaultResponse(BaseModel): """ FooGetDefaultResponse 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 afa5024f7904..c265c7592bbf 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 @@ -25,6 +25,8 @@ from typing import Optional, Set from typing_extensions import Self + + class FormatTest(BaseModel): """ FormatTest 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 ee0c50cdeb4a..6a5456241b04 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class HasOnlyReadOnly(BaseModel): """ HasOnlyReadOnly 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 325f13a4c3a7..b5bf78513508 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class HealthCheckResult(BaseModel): """ Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. 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 c1c3f5370053..9e9bb78064e9 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class InnerDictWithProperty(BaseModel): """ InnerDictWithProperty diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/input_all_of.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/input_all_of.py index 294df2f17d9e..fbe96080a688 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/input_all_of.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/input_all_of.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class InputAllOf(BaseModel): """ InputAllOf 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 b0c6db34dc6f..2b9d8429bf09 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ListClass(BaseModel): """ ListClass 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 fbcdc17f6928..fb95b26f6eb9 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class MapOfArrayOfModel(BaseModel): """ MapOfArrayOfModel 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 bb674830c01d..1caa9b1bcd73 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class MapTest(BaseModel): """ MapTest 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 1bc0a518afc9..061fb4338b76 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 @@ -24,6 +24,8 @@ from typing import Optional, Set from typing_extensions import Self + + class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): """ MixedPropertiesAndAdditionalPropertiesClass 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 b74ff91feb9c..7020dc4329b7 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Model200Response(BaseModel): """ Model for testing model name starting with number diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_api_response.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_api_response.py index 5e87689a9861..0807f02e67ad 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_api_response.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_api_response.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ModelApiResponse(BaseModel): """ ModelApiResponse 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 86b6d51177ee..59adf500cead 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ModelReturn(BaseModel): """ Model for testing reserved words 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 55a50ac01bd0..91f9f59471c8 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Name(BaseModel): """ Model for testing model name same as property name 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 64a2fe91b29d..9a533251e1da 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class NullableClass(BaseModel): """ NullableClass 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 fe618807e9da..064399d4e38d 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class NullableProperty(BaseModel): """ NullableProperty 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 7ed7b422b52a..3da65c24235a 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class NumberOnly(BaseModel): """ NumberOnly 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 7e3aa7a202ff..3a6e9a9a9882 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ObjectToTestAdditionalProperties(BaseModel): """ Minimal object 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 8b5c19ebd53d..7fee049531ad 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ObjectWithDeprecatedFields(BaseModel): """ ObjectWithDeprecatedFields 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 5c08aae91b1b..98c167bd5ee7 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Order(BaseModel): """ Order 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 52a6e044d097..7d6770d629d5 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class OuterComposite(BaseModel): """ OuterComposite 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 83f4c1b8ef32..9981b2c03ac1 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 @@ -24,6 +24,8 @@ from typing import Optional, Set from typing_extensions import Self + + class OuterObjectWithEnumProperty(BaseModel): """ OuterObjectWithEnumProperty 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 dba6f038d89c..51eeb9a09db2 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Parent(BaseModel): """ Parent 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 3c81088b3b49..c8305ac0ed0b 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ParentWithOptionalDict(BaseModel): """ ParentWithOptionalDict 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 05f24508062d..eb05c5a344db 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 @@ -25,6 +25,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Pet(BaseModel): """ Pet diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/poop_cleaning.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/poop_cleaning.py index 789ef627f0ed..5c50969d5c92 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/poop_cleaning.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/poop_cleaning.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class PoopCleaning(BaseModel): """ PoopCleaning diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/property_map.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/property_map.py index 5ef7f65e40ed..cc31774578a2 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/property_map.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/property_map.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class PropertyMap(BaseModel): """ PropertyMap 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 65135e04cd01..9f0055eb81db 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class PropertyNameCollision(BaseModel): """ PropertyNameCollision 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 b2265203a59f..922664bc5b62 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ReadOnlyFirst(BaseModel): """ ReadOnlyFirst 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 e57459a81490..6ed1cd77a6df 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class SecondRef(BaseModel): """ SecondRef 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 afd8d48a85f2..294dfe000fbc 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class SelfReferenceModel(BaseModel): """ SelfReferenceModel 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 dbf0f7c7a718..87ac3332705d 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class SpecialModelName(BaseModel): """ SpecialModelName 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 9029b789f5ec..0fe05a710713 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class SpecialName(BaseModel): """ SpecialName 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 b3cc7b7bbb7e..d198bd972fd6 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Tag(BaseModel): """ Tag diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/task.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/task.py index 7fb9e638729f..ae26e7a1cf78 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/task.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/task.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Task(BaseModel): """ Used to test oneOf enums with only one string value. diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py index a456097bc7b5..a0361dc48696 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class TestErrorResponsesWithModel400Response(BaseModel): """ TestErrorResponsesWithModel400Response diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py index c4c88b202686..a3a8f16eb499 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class TestErrorResponsesWithModel404Response(BaseModel): """ TestErrorResponsesWithModel404Response 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 2fb96a50dd78..1cb4ea70cdd0 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class TestInlineFreeformAdditionalPropertiesRequest(BaseModel): """ TestInlineFreeformAdditionalPropertiesRequest 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 cd9bb8f356ff..9a603930a682 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Tiger(BaseModel): """ Tiger 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 9e5f2dae96e4..3fd99fd3558c 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class UnnamedDictWithAdditionalModelListProperties(BaseModel): """ UnnamedDictWithAdditionalModelListProperties 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 20840faa9950..1738eab80c57 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class UnnamedDictWithAdditionalStringListProperties(BaseModel): """ UnnamedDictWithAdditionalStringListProperties 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 28ada093f19b..730ebc729652 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class User(BaseModel): """ User 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 5ca2df46c9b6..1e1c542ea3a3 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 @@ -24,6 +24,8 @@ from typing import Optional, Set from typing_extensions import Self + + class WithNestedOneOf(BaseModel): """ WithNestedOneOf diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/.openapi-generator/FILES index b00c95d922da..fa3538ce756b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/.openapi-generator/FILES @@ -218,6 +218,4 @@ setup.cfg setup.py test-requirements.txt test/__init__.py -test/test_discriminator_all_of_sub.py -test/test_discriminator_all_of_super.py tox.ini diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-pydantic-v1/.openapi-generator/FILES index b00c95d922da..fa3538ce756b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-pydantic-v1/.openapi-generator/FILES @@ -218,6 +218,4 @@ setup.cfg setup.py test-requirements.txt test/__init__.py -test/test_discriminator_all_of_sub.py -test/test_discriminator_all_of_super.py tox.ini diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/FILES b/samples/openapi3/client/petstore/python/.openapi-generator/FILES index bdec77f5320d..8ca56876d60f 100755 --- a/samples/openapi3/client/petstore/python/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python/.openapi-generator/FILES @@ -218,6 +218,4 @@ setup.cfg setup.py test-requirements.txt test/__init__.py -test/test_discriminator_all_of_sub.py -test/test_discriminator_all_of_super.py tox.ini 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 43a139dc1749..bca6e58ee56d 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class AdditionalPropertiesAnyType(BaseModel): """ AdditionalPropertiesAnyType 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 f12f7a84965d..ef4cc497cf73 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class AdditionalPropertiesClass(BaseModel): """ AdditionalPropertiesClass 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 03735c7429c9..d808daa02f94 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class AdditionalPropertiesObject(BaseModel): """ AdditionalPropertiesObject 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 7e3f920ab3cb..155b23d5f65a 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class AdditionalPropertiesWithDescriptionOnly(BaseModel): """ AdditionalPropertiesWithDescriptionOnly 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 2be839908d10..8bf3fd3bb318 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class AllOfWithSingleRef(BaseModel): """ AllOfWithSingleRef 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 4e14ccbfc780..5fc65efc0ce0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py @@ -17,11 +17,19 @@ import re # noqa: F401 import json +from importlib import import_module from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Optional, Set from typing_extensions import Self + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from petstore_api.models.cat import Cat + from petstore_api.models.dog import Dog + + class Animal(BaseModel): """ Animal @@ -65,7 +73,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Union[Self, Self]]: + def from_json(cls, json_str: str) -> Optional[Union[Cat, Dog]]: """Create an instance of Animal from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -97,20 +105,17 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[Self, Self]]: + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[Cat, Dog]]: """Create an instance of Animal from a dict""" # look up the object type based on discriminator mapping object_type = cls.get_discriminator_value(obj) - if object_type: - klass = globals()[object_type] - return klass.from_dict(obj) - else: - raise ValueError("Animal failed to lookup discriminator value from " + - json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + - ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) - -from petstore_api.models.cat import Cat -from petstore_api.models.dog import Dog -# TODO: Rewrite to not use raise_errors -Animal.model_rebuild(raise_errors=False) + if object_type == 'Cat': + return import_module("petstore_api.models.cat").Cat.from_dict(obj) # type: ignore + if object_type == 'Dog': + return import_module("petstore_api.models.dog").Dog.from_dict(obj) # type: ignore + + raise ValueError("Animal failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + diff --git a/samples/openapi3/client/petstore/python/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 06b35e19668e..67e503394f76 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ArrayOfArrayOfModel(BaseModel): """ ArrayOfArrayOfModel 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 94aa0ac6539f..d70e172bba37 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ArrayOfArrayOfNumberOnly(BaseModel): """ ArrayOfArrayOfNumberOnly 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 c0da65e33234..8f3f4cd2d1b8 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ArrayOfNumberOnly(BaseModel): """ ArrayOfNumberOnly 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 2986612fad54..386e5d3bd741 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 @@ -24,6 +24,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ArrayTest(BaseModel): """ ArrayTest 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 c1c5b702f33a..bf3862872e5f 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class BasquePig(BaseModel): """ BasquePig diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/bathing.py b/samples/openapi3/client/petstore/python/petstore_api/models/bathing.py index 7ea7084ae9db..560794f4f10f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/bathing.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/bathing.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Bathing(BaseModel): """ Bathing 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 117c5cebac02..46da0b82dde1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Capitalization(BaseModel): """ Capitalization 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 a9c79649401d..a03a0b059841 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/cat.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Cat(Animal): """ Cat 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 d1808eb1a976..1a62d92a4fdf 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/category.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Category(BaseModel): """ Category 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 914e011e9106..be60b103397d 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class CircularReferenceModel(BaseModel): """ CircularReferenceModel 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 6148c24ceed1..60212d240e70 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ClassModel(BaseModel): """ Model for testing model with \"_class\" property 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 72f57b6815d7..2812e46454eb 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/client.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Client(BaseModel): """ Client 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 052e533ac378..eee77945c56d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/creature.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/creature.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Creature(BaseModel): """ Creature 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 6096bbbb5c77..c28192b5741f 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class CreatureInfo(BaseModel): """ CreatureInfo 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 16b44763d28b..cd92b8004adb 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class DanishPig(BaseModel): """ DanishPig 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 ed9dc5912f12..ed2151b652fd 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class DeprecatedObject(BaseModel): """ DeprecatedObject diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_sub.py index ec3991985da4..e050442e3f12 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_sub.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_sub.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class DiscriminatorAllOfSub(DiscriminatorAllOfSuper): """ DiscriminatorAllOfSub diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_super.py b/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_super.py index fc65d4dc9b54..2678c93f3a1a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_super.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_super.py @@ -17,11 +17,18 @@ import re # noqa: F401 import json +from importlib import import_module from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Union from typing import Optional, Set from typing_extensions import Self + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub + + class DiscriminatorAllOfSuper(BaseModel): """ DiscriminatorAllOfSuper @@ -64,7 +71,7 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Union[Self]]: + def from_json(cls, json_str: str) -> Optional[Union[DiscriminatorAllOfSub]]: """Create an instance of DiscriminatorAllOfSuper from a JSON string""" return cls.from_dict(json.loads(json_str)) @@ -96,19 +103,15 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[Self]]: + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[DiscriminatorAllOfSub]]: """Create an instance of DiscriminatorAllOfSuper from a dict""" # look up the object type based on discriminator mapping object_type = cls.get_discriminator_value(obj) - if object_type: - klass = globals()[object_type] - return klass.from_dict(obj) - else: - raise ValueError("DiscriminatorAllOfSuper failed to lookup discriminator value from " + - json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + - ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + if object_type == 'DiscriminatorAllOfSub': + return import_module("petstore_api.models.discriminator_all_of_sub").DiscriminatorAllOfSub.from_dict(obj) # type: ignore + + raise ValueError("DiscriminatorAllOfSuper failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) -from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub -# TODO: Rewrite to not use raise_errors -DiscriminatorAllOfSuper.model_rebuild(raise_errors=False) 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 c7dda299c935..f65853fec8c4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/dog.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Dog(Animal): """ Dog 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 d1211acd8253..565883ed59ab 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class DummyModel(BaseModel): """ DummyModel 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 bd46be86ea60..afd04f290154 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class EnumArrays(BaseModel): """ EnumArrays 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 a3d6f6fc9cc4..6d05e69b4199 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 @@ -26,6 +26,8 @@ from typing import Optional, Set from typing_extensions import Self + + class EnumTest(BaseModel): """ EnumTest diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/feeding.py b/samples/openapi3/client/petstore/python/petstore_api/models/feeding.py index e09b83a21b09..793f7aacb996 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/feeding.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/feeding.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Feeding(BaseModel): """ Feeding 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 ce2688c5f0cb..236a69315afd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/file.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class File(BaseModel): """ Must be named `File` for test. 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 f660e0161ca7..22abdfaa707b 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class FileSchemaTestClass(BaseModel): """ FileSchemaTestClass 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 a7c2af974d43..6e4b2fc72503 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class FirstRef(BaseModel): """ FirstRef 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 24321df43c5b..c43acad85fb5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/foo.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Foo(BaseModel): """ Foo 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 d602be27708d..592c518d2cf6 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class FooGetDefaultResponse(BaseModel): """ FooGetDefaultResponse 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 c2787c1586a3..92309baf79c8 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 @@ -25,6 +25,8 @@ from typing import Optional, Set from typing_extensions import Self + + class FormatTest(BaseModel): """ FormatTest 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 6e80185d9b8d..7ba5f4feb8b2 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class HasOnlyReadOnly(BaseModel): """ HasOnlyReadOnly 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 8f6e6565fd5b..928417853716 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class HealthCheckResult(BaseModel): """ Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. 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 e71b74e0a7db..a1f95ffe9935 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class InnerDictWithProperty(BaseModel): """ InnerDictWithProperty diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/input_all_of.py b/samples/openapi3/client/petstore/python/petstore_api/models/input_all_of.py index 13f53276e381..8b39fcbd105e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/input_all_of.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/input_all_of.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class InputAllOf(BaseModel): """ InputAllOf 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 568454db1e5b..36eea919bc23 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ListClass(BaseModel): """ ListClass 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 8ff27629f5a9..1e69fc116273 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class MapOfArrayOfModel(BaseModel): """ MapOfArrayOfModel 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 711379c0f16d..c643ffa1e9ba 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class MapTest(BaseModel): """ MapTest 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 7b7506264a8e..38e28890fde5 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 @@ -24,6 +24,8 @@ from typing import Optional, Set from typing_extensions import Self + + class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): """ MixedPropertiesAndAdditionalPropertiesClass 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 08010aa12199..f1610e43613a 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Model200Response(BaseModel): """ Model for testing model name starting with number diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/model_api_response.py b/samples/openapi3/client/petstore/python/petstore_api/models/model_api_response.py index 75b120b87984..f1c9896f792c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/model_api_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/model_api_response.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ModelApiResponse(BaseModel): """ ModelApiResponse 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 4648542ef073..a7ebf3f23fd6 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ModelReturn(BaseModel): """ Model for testing reserved words 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 acb8c1a60efe..e2550f79c59f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/name.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Name(BaseModel): """ Model for testing model name same as property name 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 1ad6d35535e0..7216fd172b74 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class NullableClass(BaseModel): """ NullableClass 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 b6c314ecbef8..878aa3c5ca88 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class NullableProperty(BaseModel): """ NullableProperty 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 5674323d5aae..76f59f88847d 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class NumberOnly(BaseModel): """ NumberOnly 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 8923eb7e2c33..73b5bd9e0124 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ObjectToTestAdditionalProperties(BaseModel): """ Minimal object 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 592a5e177f2a..72478927903e 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ObjectWithDeprecatedFields(BaseModel): """ ObjectWithDeprecatedFields 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 19a829bd92db..a14eaecefe65 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/order.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Order(BaseModel): """ Order 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 727440deb47f..1c1c3e61ba39 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class OuterComposite(BaseModel): """ OuterComposite 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 155b41cef8ef..41fb230a44fc 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 @@ -24,6 +24,8 @@ from typing import Optional, Set from typing_extensions import Self + + class OuterObjectWithEnumProperty(BaseModel): """ OuterObjectWithEnumProperty 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 5c9515aef8a1..c0c788b89c2f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/parent.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/parent.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Parent(BaseModel): """ Parent 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 1bff7f8a4ec4..ccafbcf7c482 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ParentWithOptionalDict(BaseModel): """ ParentWithOptionalDict 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 eca4a98dcc9a..b181229762e9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/pet.py @@ -25,6 +25,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Pet(BaseModel): """ Pet diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/poop_cleaning.py b/samples/openapi3/client/petstore/python/petstore_api/models/poop_cleaning.py index 7d881efcd21b..766df47e2804 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/poop_cleaning.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/poop_cleaning.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class PoopCleaning(BaseModel): """ PoopCleaning diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/property_map.py b/samples/openapi3/client/petstore/python/petstore_api/models/property_map.py index e3dcdf506f44..762530a1a45e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/property_map.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/property_map.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class PropertyMap(BaseModel): """ PropertyMap 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 65058950f28d..2da405957c33 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class PropertyNameCollision(BaseModel): """ PropertyNameCollision 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 565612986362..1b461b00d393 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class ReadOnlyFirst(BaseModel): """ ReadOnlyFirst 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 2e181890002f..743a6628415d 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class SecondRef(BaseModel): """ SecondRef 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 8f161da4a200..52c87d48f90a 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class SelfReferenceModel(BaseModel): """ SelfReferenceModel 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 e9d7dbb92aa3..e0652cb3d598 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class SpecialModelName(BaseModel): """ SpecialModelName 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 8ab35951c1ae..88a9d32917e3 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class SpecialName(BaseModel): """ SpecialName 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 b7dde8077f27..9463688e46fd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/tag.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Tag(BaseModel): """ Tag diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/task.py b/samples/openapi3/client/petstore/python/petstore_api/models/task.py index 2a58ebaed92e..e0f50f91f46d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/task.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/task.py @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Task(BaseModel): """ Used to test oneOf enums with only one string value. diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model400_response.py b/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model400_response.py index f6d0e496e495..803299d8d60e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model400_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model400_response.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class TestErrorResponsesWithModel400Response(BaseModel): """ TestErrorResponsesWithModel400Response diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model404_response.py b/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model404_response.py index d9993a5c63c4..caf03090c97c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model404_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model404_response.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class TestErrorResponsesWithModel404Response(BaseModel): """ TestErrorResponsesWithModel404Response 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 2fb96a50dd78..1cb4ea70cdd0 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class TestInlineFreeformAdditionalPropertiesRequest(BaseModel): """ TestInlineFreeformAdditionalPropertiesRequest 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 56f0f8c04ab8..5b860c231d12 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/tiger.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/tiger.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class Tiger(BaseModel): """ Tiger 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 6be5a7eb89c3..57e432d936c3 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 @@ -23,6 +23,8 @@ from typing import Optional, Set from typing_extensions import Self + + class UnnamedDictWithAdditionalModelListProperties(BaseModel): """ UnnamedDictWithAdditionalModelListProperties 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 2fcd15c86f4a..f34a6202f43f 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 @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class UnnamedDictWithAdditionalStringListProperties(BaseModel): """ UnnamedDictWithAdditionalStringListProperties 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 6be27943f015..6193e5e31281 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/user.py @@ -22,6 +22,8 @@ from typing import Optional, Set from typing_extensions import Self + + class User(BaseModel): """ User 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 95c2da7f6295..d3a9e342ef4b 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 @@ -24,6 +24,8 @@ from typing import Optional, Set from typing_extensions import Self + + class WithNestedOneOf(BaseModel): """ WithNestedOneOf From f1365ec881f5d471420df337216ac0fe1291a73d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Sat, 17 Feb 2024 23:06:55 +0000 Subject: [PATCH 06/12] [python] undo type changes related to discriminator --- .../src/main/resources/python/model_generic.mustache | 5 +---- .../openapi_client/models/query.py | 3 +-- .../client/echo_api/python/openapi_client/models/query.py | 3 +-- 3 files changed, 3 insertions(+), 8 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 139d1c293fd8..f86d6e527a50 100644 --- a/modules/openapi-generator/src/main/resources/python/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_generic.mustache @@ -245,7 +245,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} {{#hasChildren}} @classmethod - def from_dict(cls, obj: Dict[str, Any]) -> Optional[{{#discriminator}}Union[{{#mappedModels}}{{{modelName}}}{{^-last}}, {{/-last}}{{/mappedModels}}]{{/discriminator}}]: + def from_dict(cls, obj: Dict[str, Any]) -> Optional[{{#discriminator}}Union[{{#mappedModels}}{{{modelName}}}{{^-last}}, {{/-last}}{{/mappedModels}}]{{/discriminator}}{{^discriminator}}Self{{/discriminator}}]: """Create an instance of {{{classname}}} from a dict""" {{#discriminator}} # look up the object type based on discriminator mapping @@ -259,9 +259,6 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) {{/discriminator}} - {{^discriminator}} - return cls.model_validate(obj) - {{/discriminator}} {{/hasChildren}} {{^hasChildren}} @classmethod diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/query.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/query.py index 91c8cd7f090d..887ed97dc7d8 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/query.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/query.py @@ -86,8 +86,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict[str, Any]) -> Optional[]: + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Self]: """Create an instance of Query from a dict""" - return cls.model_validate(obj) 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 91c8cd7f090d..887ed97dc7d8 100644 --- a/samples/client/echo_api/python/openapi_client/models/query.py +++ b/samples/client/echo_api/python/openapi_client/models/query.py @@ -86,8 +86,7 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Dict[str, Any]) -> Optional[]: + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Self]: """Create an instance of Query from a dict""" - return cls.model_validate(obj) From e910e3e97e2418659c624165f8d21a70b816e0eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Sun, 18 Feb 2024 11:01:11 +0000 Subject: [PATCH 07/12] [python] remove extraneous processing --- .../openapitools/codegen/languages/AbstractPythonCodegen.java | 3 --- 1 file changed, 3 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 63092ed54ffa..d8c680caaa2e 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 @@ -1024,9 +1024,6 @@ private ModelsMap postProcessModelsMap(ModelsMap objs) { // skip self import continue; } - if (model.parent != null && model.parent.equals(modelImport)) { - continue; - } modelsToImport.add("from " + packageName + ".models." + underscore(modelImport) + " import " + modelImport); } From 97ce84cee568645a61c1dc136b89168e4ec962e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Sun, 18 Feb 2024 11:22:59 +0000 Subject: [PATCH 08/12] [python-pydantic-v1] fix inheritance discriminators circular import --- .../AbstractPythonPydanticV1Codegen.java | 4 ---- .../python-pydantic-v1/model_generic.mustache | 24 +++++++++++++------ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java index 2ac56035256e..921f28c3f709 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java @@ -879,10 +879,6 @@ private ModelsMap postProcessModelsMap(ModelsMap objs) { // if super class if (model.getDiscriminator() != null && model.getDiscriminator().getMappedModels() != null) { typingImports.add("Union"); - Set discriminator = model.getDiscriminator().getMappedModels(); - for (CodegenDiscriminator.MappedModel mappedModel : discriminator) { - postponedModelImports.add(mappedModel.getModelName()); - } } } diff --git a/modules/openapi-generator/src/main/resources/python-pydantic-v1/model_generic.mustache b/modules/openapi-generator/src/main/resources/python-pydantic-v1/model_generic.mustache index 6a09b9c9bd19..9322a4466928 100644 --- a/modules/openapi-generator/src/main/resources/python-pydantic-v1/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python-pydantic-v1/model_generic.mustache @@ -10,6 +10,16 @@ import json {{{.}}} {{/vendorExtensions.x-py-model-imports}} +{{#hasChildren}}{{#discriminator}} +{{! If this model is a super class, importlib is used. So import the necessary modules for the type here. }} +from typing import TYPE_CHECKING +from importlib import import_module +if TYPE_CHECKING: +{{#mappedModels}} + from {{packageName}}.models.{{model.classVarName}} import {{modelName}} +{{/mappedModels}} +{{/discriminator}}{{/hasChildren}} + class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}): """ {{#description}}{{{description}}} # noqa: E501{{/description}}{{^description}}{{{classname}}}{{/description}} @@ -222,13 +232,13 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} {{#discriminator}} # look up the object type based on discriminator mapping object_type = cls.get_discriminator_value(obj) - if object_type: - klass = globals()[object_type] - return klass.from_dict(obj) - else: - raise ValueError("{{{classname}}} failed to lookup discriminator value from " + - json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + - ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + {{#mappedModels}} + if object_type == '{{{mappingName}}}': + return import_module("{{packageName}}.models.{{model.classVarName}}").{{modelName}}.from_dict(obj) + {{/mappedModels}} + raise ValueError("{{{classname}}} failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) {{/discriminator}} {{/hasChildren}} {{^hasChildren}} From 89d422985e57a77d11b90f846bc2656f79cd0e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Sun, 18 Feb 2024 11:23:36 +0000 Subject: [PATCH 09/12] [python] remove type ignore comment --- .../src/main/resources/python/model_generic.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f86d6e527a50..2c93dfdfa86e 100644 --- a/modules/openapi-generator/src/main/resources/python/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_generic.mustache @@ -252,7 +252,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} object_type = cls.get_discriminator_value(obj) {{#mappedModels}} if object_type == '{{{mappingName}}}': - return import_module("{{packageName}}.models.{{model.classVarName}}").{{modelName}}.from_dict(obj) # type: ignore + return import_module("{{packageName}}.models.{{model.classVarName}}").{{modelName}}.from_dict(obj) {{/mappedModels}} raise ValueError("{{{classname}}} failed to lookup discriminator value from " + From f922eaa6f77007d6c8638c0db297a34c95db867b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Sun, 18 Feb 2024 11:23:45 +0000 Subject: [PATCH 10/12] [python] update samples --- .../openapi_client/models/bird.py | 2 ++ .../openapi_client/models/category.py | 2 ++ .../openapi_client/models/data_query.py | 2 ++ .../openapi_client/models/default_value.py | 2 ++ .../models/number_properties_only.py | 2 ++ .../openapi_client/models/pet.py | 2 ++ .../openapi_client/models/query.py | 2 ++ .../openapi_client/models/tag.py | 2 ++ ...ue_object_all_of_query_object_parameter.py | 2 ++ ...rue_array_string_query_object_parameter.py | 2 ++ .../petstore_api/models/animal.py | 4 +-- .../models/discriminator_all_of_super.py | 2 +- .../models/additional_properties_any_type.py | 2 ++ .../models/additional_properties_class.py | 2 ++ .../models/additional_properties_object.py | 2 ++ ...tional_properties_with_description_only.py | 2 ++ .../models/all_of_with_single_ref.py | 2 ++ .../petstore_api/models/animal.py | 25 +++++++++++-------- .../petstore_api/models/api_response.py | 2 ++ .../models/array_of_array_of_model.py | 2 ++ .../models/array_of_array_of_number_only.py | 2 ++ .../models/array_of_number_only.py | 2 ++ .../petstore_api/models/array_test.py | 2 ++ .../petstore_api/models/basque_pig.py | 2 ++ .../petstore_api/models/bathing.py | 2 ++ .../petstore_api/models/capitalization.py | 2 ++ .../petstore_api/models/cat.py | 2 ++ .../petstore_api/models/category.py | 2 ++ .../models/circular_reference_model.py | 2 ++ .../petstore_api/models/class_model.py | 2 ++ .../petstore_api/models/client.py | 2 ++ .../petstore_api/models/creature.py | 2 ++ .../petstore_api/models/creature_info.py | 2 ++ .../petstore_api/models/danish_pig.py | 2 ++ .../petstore_api/models/deprecated_object.py | 2 ++ .../models/discriminator_all_of_sub.py | 2 ++ .../models/discriminator_all_of_super.py | 21 +++++++++------- .../petstore_api/models/dog.py | 2 ++ .../petstore_api/models/dummy_model.py | 2 ++ .../petstore_api/models/enum_arrays.py | 2 ++ .../petstore_api/models/enum_test.py | 2 ++ .../petstore_api/models/feeding.py | 2 ++ .../petstore_api/models/file.py | 2 ++ .../models/file_schema_test_class.py | 2 ++ .../petstore_api/models/first_ref.py | 2 ++ .../petstore_api/models/foo.py | 2 ++ .../models/foo_get_default_response.py | 2 ++ .../petstore_api/models/format_test.py | 2 ++ .../petstore_api/models/has_only_read_only.py | 2 ++ .../models/health_check_result.py | 2 ++ .../models/inner_dict_with_property.py | 2 ++ .../petstore_api/models/input_all_of.py | 2 ++ .../petstore_api/models/list_class.py | 2 ++ .../models/map_of_array_of_model.py | 2 ++ .../petstore_api/models/map_test.py | 2 ++ ...perties_and_additional_properties_class.py | 2 ++ .../petstore_api/models/model200_response.py | 2 ++ .../petstore_api/models/model_return.py | 2 ++ .../petstore_api/models/name.py | 2 ++ .../petstore_api/models/nullable_class.py | 2 ++ .../petstore_api/models/nullable_property.py | 2 ++ .../petstore_api/models/number_only.py | 2 ++ .../object_to_test_additional_properties.py | 2 ++ .../models/object_with_deprecated_fields.py | 2 ++ .../petstore_api/models/order.py | 2 ++ .../petstore_api/models/outer_composite.py | 2 ++ .../models/outer_object_with_enum_property.py | 2 ++ .../petstore_api/models/parent.py | 2 ++ .../models/parent_with_optional_dict.py | 2 ++ .../petstore_api/models/pet.py | 2 ++ .../petstore_api/models/poop_cleaning.py | 2 ++ .../petstore_api/models/property_map.py | 2 ++ .../models/property_name_collision.py | 2 ++ .../petstore_api/models/read_only_first.py | 2 ++ .../petstore_api/models/second_ref.py | 2 ++ .../models/self_reference_model.py | 2 ++ .../petstore_api/models/special_model_name.py | 2 ++ .../petstore_api/models/special_name.py | 2 ++ .../petstore_api/models/tag.py | 2 ++ .../petstore_api/models/task.py | 2 ++ ..._error_responses_with_model400_response.py | 2 ++ ..._error_responses_with_model404_response.py | 2 ++ ..._freeform_additional_properties_request.py | 2 ++ .../petstore_api/models/tiger.py | 2 ++ ...t_with_additional_model_list_properties.py | 2 ++ ..._with_additional_string_list_properties.py | 2 ++ .../petstore_api/models/user.py | 2 ++ .../petstore_api/models/with_nested_one_of.py | 2 ++ .../models/additional_properties_any_type.py | 2 ++ .../models/additional_properties_class.py | 2 ++ .../models/additional_properties_object.py | 2 ++ ...tional_properties_with_description_only.py | 2 ++ .../models/all_of_with_single_ref.py | 2 ++ .../petstore_api/models/animal.py | 25 +++++++++++-------- .../petstore_api/models/api_response.py | 2 ++ .../models/array_of_array_of_model.py | 2 ++ .../models/array_of_array_of_number_only.py | 2 ++ .../models/array_of_number_only.py | 2 ++ .../petstore_api/models/array_test.py | 2 ++ .../petstore_api/models/basque_pig.py | 2 ++ .../petstore_api/models/bathing.py | 2 ++ .../petstore_api/models/capitalization.py | 2 ++ .../petstore_api/models/cat.py | 2 ++ .../petstore_api/models/category.py | 2 ++ .../models/circular_reference_model.py | 2 ++ .../petstore_api/models/class_model.py | 2 ++ .../petstore_api/models/client.py | 2 ++ .../petstore_api/models/creature.py | 2 ++ .../petstore_api/models/creature_info.py | 2 ++ .../petstore_api/models/danish_pig.py | 2 ++ .../petstore_api/models/deprecated_object.py | 2 ++ .../models/discriminator_all_of_sub.py | 2 ++ .../models/discriminator_all_of_super.py | 21 +++++++++------- .../petstore_api/models/dog.py | 2 ++ .../petstore_api/models/dummy_model.py | 2 ++ .../petstore_api/models/enum_arrays.py | 2 ++ .../petstore_api/models/enum_test.py | 2 ++ .../petstore_api/models/feeding.py | 2 ++ .../petstore_api/models/file.py | 2 ++ .../models/file_schema_test_class.py | 2 ++ .../petstore_api/models/first_ref.py | 2 ++ .../petstore_api/models/foo.py | 2 ++ .../models/foo_get_default_response.py | 2 ++ .../petstore_api/models/format_test.py | 2 ++ .../petstore_api/models/has_only_read_only.py | 2 ++ .../models/health_check_result.py | 2 ++ .../models/inner_dict_with_property.py | 2 ++ .../petstore_api/models/input_all_of.py | 2 ++ .../petstore_api/models/list_class.py | 2 ++ .../models/map_of_array_of_model.py | 2 ++ .../petstore_api/models/map_test.py | 2 ++ ...perties_and_additional_properties_class.py | 2 ++ .../petstore_api/models/model200_response.py | 2 ++ .../petstore_api/models/model_return.py | 2 ++ .../petstore_api/models/name.py | 2 ++ .../petstore_api/models/nullable_class.py | 2 ++ .../petstore_api/models/nullable_property.py | 2 ++ .../petstore_api/models/number_only.py | 2 ++ .../object_to_test_additional_properties.py | 2 ++ .../models/object_with_deprecated_fields.py | 2 ++ .../petstore_api/models/order.py | 2 ++ .../petstore_api/models/outer_composite.py | 2 ++ .../models/outer_object_with_enum_property.py | 2 ++ .../petstore_api/models/parent.py | 2 ++ .../models/parent_with_optional_dict.py | 2 ++ .../petstore_api/models/pet.py | 2 ++ .../petstore_api/models/poop_cleaning.py | 2 ++ .../petstore_api/models/property_map.py | 2 ++ .../models/property_name_collision.py | 2 ++ .../petstore_api/models/read_only_first.py | 2 ++ .../petstore_api/models/second_ref.py | 2 ++ .../models/self_reference_model.py | 2 ++ .../petstore_api/models/special_model_name.py | 2 ++ .../petstore_api/models/special_name.py | 2 ++ .../petstore_api/models/tag.py | 2 ++ .../petstore_api/models/task.py | 2 ++ ..._error_responses_with_model400_response.py | 2 ++ ..._error_responses_with_model404_response.py | 2 ++ ..._freeform_additional_properties_request.py | 2 ++ .../petstore_api/models/tiger.py | 2 ++ ...t_with_additional_model_list_properties.py | 2 ++ ..._with_additional_string_list_properties.py | 2 ++ .../petstore_api/models/user.py | 2 ++ .../petstore_api/models/with_nested_one_of.py | 2 ++ .../python/petstore_api/models/animal.py | 4 +-- .../models/discriminator_all_of_super.py | 2 +- 166 files changed, 376 insertions(+), 44 deletions(-) diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/bird.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/bird.py index 77887a53120d..c7d93fb4585d 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/bird.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/bird.py @@ -22,6 +22,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr + + class Bird(BaseModel): """ Bird diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/category.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/category.py index ee8e5c258ae9..9dea86e8ddb9 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/category.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/category.py @@ -22,6 +22,8 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr + + class Category(BaseModel): """ Category diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/data_query.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/data_query.py index af8078549f1f..d7e6c28750ce 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/data_query.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/data_query.py @@ -23,6 +23,8 @@ from pydantic import Field, StrictStr from openapi_client.models.query import Query + + class DataQuery(Query): """ DataQuery diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/default_value.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/default_value.py index a73193247fd1..d203a79094cb 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/default_value.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/default_value.py @@ -23,6 +23,8 @@ from pydantic import BaseModel, StrictInt, StrictStr, conlist, validator from openapi_client.models.string_enum_ref import StringEnumRef + + class DefaultValue(BaseModel): """ to test the default value of properties # noqa: E501 diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/number_properties_only.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/number_properties_only.py index 10bb3a590a21..bbe1ffa850e3 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/number_properties_only.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/number_properties_only.py @@ -22,6 +22,8 @@ from typing import Optional, Union from pydantic import BaseModel, StrictFloat, StrictInt, confloat, conint + + class NumberPropertiesOnly(BaseModel): """ NumberPropertiesOnly diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/pet.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/pet.py index 3a40ddc03215..c6cacd95e597 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/pet.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/pet.py @@ -24,6 +24,8 @@ from openapi_client.models.category import Category from openapi_client.models.tag import Tag + + class Pet(BaseModel): """ Pet diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/query.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/query.py index 02e4233d513a..a479de4d68eb 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/query.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/query.py @@ -22,6 +22,8 @@ from typing import List, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist, validator + + class Query(BaseModel): """ Query diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/tag.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/tag.py index 66a39adff29c..51b871c7a299 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/tag.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/tag.py @@ -22,6 +22,8 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr + + class Tag(BaseModel): """ Tag diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py index 42e1101ec022..a5db6ae9dcff 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py @@ -22,6 +22,8 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr + + class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(BaseModel): """ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py index 1bff80a6df1c..e23fc646483c 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py @@ -22,6 +22,8 @@ from typing import List, Optional from pydantic import BaseModel, StrictStr, conlist + + class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(BaseModel): """ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter 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 0a2f96df70e9..c7d31ccd7dde 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 @@ -102,9 +102,9 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[Cat, Dog]]: # look up the object type based on discriminator mapping object_type = cls.get_discriminator_value(obj) if object_type == 'Cat': - return import_module("petstore_api.models.cat").Cat.from_dict(obj) # type: ignore + return import_module("petstore_api.models.cat").Cat.from_dict(obj) if object_type == 'Dog': - return import_module("petstore_api.models.dog").Dog.from_dict(obj) # type: ignore + return import_module("petstore_api.models.dog").Dog.from_dict(obj) raise ValueError("Animal failed to lookup discriminator value from " + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_super.py index 4acea3bf5e8c..895ee5cd192c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_super.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_super.py @@ -100,7 +100,7 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[DiscriminatorAllOfSub] # look up the object type based on discriminator mapping object_type = cls.get_discriminator_value(obj) if object_type == 'DiscriminatorAllOfSub': - return import_module("petstore_api.models.discriminator_all_of_sub").DiscriminatorAllOfSub.from_dict(obj) # type: ignore + return import_module("petstore_api.models.discriminator_all_of_sub").DiscriminatorAllOfSub.from_dict(obj) raise ValueError("DiscriminatorAllOfSuper failed to lookup discriminator value from " + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_any_type.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_any_type.py index 0441dfd99e92..2fbcf416b825 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_any_type.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_any_type.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr + + class AdditionalPropertiesAnyType(BaseModel): """ AdditionalPropertiesAnyType diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_class.py index c53af3e2ca67..7fd35793b2ba 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_class.py @@ -21,6 +21,8 @@ from typing import Dict, Optional from pydantic import BaseModel, StrictStr + + class AdditionalPropertiesClass(BaseModel): """ AdditionalPropertiesClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_object.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_object.py index cff0e89b0568..42c0beee24a6 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_object.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_object.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr + + class AdditionalPropertiesObject(BaseModel): """ AdditionalPropertiesObject diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_with_description_only.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_with_description_only.py index 17d6c461ed1b..8b09061cc2ec 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_with_description_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_with_description_only.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr + + class AdditionalPropertiesWithDescriptionOnly(BaseModel): """ AdditionalPropertiesWithDescriptionOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/all_of_with_single_ref.py index c5d066463f64..2bf7e8257a51 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/all_of_with_single_ref.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/all_of_with_single_ref.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field, StrictStr from petstore_api.models.single_ref_type import SingleRefType + + class AllOfWithSingleRef(BaseModel): """ AllOfWithSingleRef diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/animal.py index 18738e6051bc..e0ed318a1a2e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/animal.py @@ -21,6 +21,14 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictStr + +from typing import TYPE_CHECKING +from importlib import import_module +if TYPE_CHECKING: + from petstore_api.models.cat import Cat + from petstore_api.models.dog import Dog + + class Animal(BaseModel): """ Animal @@ -78,15 +86,12 @@ def from_dict(cls, obj: dict) -> Union(Cat, Dog): """Create an instance of Animal from a dict""" # look up the object type based on discriminator mapping object_type = cls.get_discriminator_value(obj) - if object_type: - klass = globals()[object_type] - return klass.from_dict(obj) - else: - raise ValueError("Animal failed to lookup discriminator value from " + - json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + - ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + if object_type == 'Cat': + return import_module("petstore_api.models.cat").Cat.from_dict(obj) + if object_type == 'Dog': + return import_module("petstore_api.models.dog").Dog.from_dict(obj) + 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)) -from petstore_api.models.cat import Cat -from petstore_api.models.dog import Dog -Animal.update_forward_refs() diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/api_response.py index 2c58b8b9ccb8..516b298aad7a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/api_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/api_response.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr + + class ApiResponse(BaseModel): """ ApiResponse diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_array_of_model.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_array_of_model.py index 6f67b220ccf1..3cf7db4e2fa7 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_array_of_model.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, conlist from petstore_api.models.tag import Tag + + class ArrayOfArrayOfModel(BaseModel): """ ArrayOfArrayOfModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_array_of_number_only.py index 8ce909858b18..80311a80d0ac 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_array_of_number_only.py @@ -21,6 +21,8 @@ from typing import List, Optional from pydantic import BaseModel, Field, conlist + + class ArrayOfArrayOfNumberOnly(BaseModel): """ ArrayOfArrayOfNumberOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_number_only.py index 768ea5ef0baf..2c8f61b9612c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_number_only.py @@ -21,6 +21,8 @@ from typing import List, Optional from pydantic import BaseModel, Field, conlist + + class ArrayOfNumberOnly(BaseModel): """ ArrayOfNumberOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_test.py index 206b34dc4021..1c03622edc63 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_test.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_test.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, StrictInt, StrictStr, conlist from petstore_api.models.read_only_first import ReadOnlyFirst + + class ArrayTest(BaseModel): """ ArrayTest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/basque_pig.py index 5683a73a3bfc..e113cfd0c52a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/basque_pig.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/basque_pig.py @@ -21,6 +21,8 @@ from pydantic import BaseModel, Field, StrictStr + + class BasquePig(BaseModel): """ BasquePig diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/bathing.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/bathing.py index 986de06f0c20..c296ee93f989 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/bathing.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/bathing.py @@ -21,6 +21,8 @@ from pydantic import BaseModel, Field, StrictStr, validator + + class Bathing(BaseModel): """ Bathing diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/capitalization.py index 2bb4435563b2..6ca88611f5a9 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/capitalization.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr + + class Capitalization(BaseModel): """ Capitalization diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/cat.py index efff0890a41a..8ce1ea0b1ad5 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/cat.py @@ -22,6 +22,8 @@ from pydantic import StrictBool from petstore_api.models.animal import Animal + + class Cat(Animal): """ Cat diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/category.py index 86a10a8683cf..2d9190b9a6ad 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/category.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr + + class Category(BaseModel): """ Category diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/circular_reference_model.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/circular_reference_model.py index 6a9956f5af3b..feec550ee80d 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/circular_reference_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/circular_reference_model.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictInt + + class CircularReferenceModel(BaseModel): """ CircularReferenceModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/class_model.py index d345924958ee..53b3d761ba25 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/class_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/class_model.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr + + class ClassModel(BaseModel): """ Model for testing model with \"_class\" property # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/client.py index 01f60acef507..5cb9bdded836 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/client.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr + + class Client(BaseModel): """ Client diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/creature.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/creature.py index dc2d94ece4cb..8344c82e2bcd 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/creature.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/creature.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field, StrictStr from petstore_api.models.creature_info import CreatureInfo + + class Creature(BaseModel): """ Creature diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/creature_info.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/creature_info.py index 327ce9bc4fbc..dd782554bf27 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/creature_info.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/creature_info.py @@ -21,6 +21,8 @@ from pydantic import BaseModel, Field, StrictStr + + class CreatureInfo(BaseModel): """ CreatureInfo diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/danish_pig.py index cfb24a7d5857..6abc73f80c20 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/danish_pig.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/danish_pig.py @@ -21,6 +21,8 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr + + class DanishPig(BaseModel): """ DanishPig diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/deprecated_object.py index 9ce72f88d48b..0c53e502dfb2 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/deprecated_object.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/deprecated_object.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr + + class DeprecatedObject(BaseModel): """ DeprecatedObject diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_sub.py index 65d54ea8d1a6..74e6e293c27d 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_sub.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_sub.py @@ -22,6 +22,8 @@ from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper + + class DiscriminatorAllOfSub(DiscriminatorAllOfSuper): """ DiscriminatorAllOfSub diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_super.py index e25ade5c1996..1468d0836e97 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_super.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_super.py @@ -21,6 +21,13 @@ from typing import Union from pydantic import BaseModel, Field, StrictStr + +from typing import TYPE_CHECKING +from importlib import import_module +if TYPE_CHECKING: + from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub + + class DiscriminatorAllOfSuper(BaseModel): """ DiscriminatorAllOfSuper @@ -76,14 +83,10 @@ def from_dict(cls, obj: dict) -> Union(DiscriminatorAllOfSub): """Create an instance of DiscriminatorAllOfSuper from a dict""" # look up the object type based on discriminator mapping object_type = cls.get_discriminator_value(obj) - if object_type: - klass = globals()[object_type] - return klass.from_dict(obj) - else: - raise ValueError("DiscriminatorAllOfSuper failed to lookup discriminator value from " + - json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + - ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + if object_type == 'DiscriminatorAllOfSub': + return import_module("petstore_api.models.discriminator_all_of_sub").DiscriminatorAllOfSub.from_dict(obj) + raise ValueError("DiscriminatorAllOfSuper failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) -from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub -DiscriminatorAllOfSuper.update_forward_refs() diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/dog.py index f0533a50e495..9982ac479307 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/dog.py @@ -22,6 +22,8 @@ from pydantic import StrictStr from petstore_api.models.animal import Animal + + class Dog(Animal): """ Dog diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/dummy_model.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/dummy_model.py index 8e4db12e5c92..e798b5a5a61d 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/dummy_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/dummy_model.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr + + class DummyModel(BaseModel): """ DummyModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_arrays.py index 5f3363b0a564..4568d9a58d74 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_arrays.py @@ -21,6 +21,8 @@ from typing import List, Optional from pydantic import BaseModel, StrictStr, conlist, validator + + class EnumArrays(BaseModel): """ EnumArrays diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_test.py index b3899720fd30..0d59a82a9a52 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_test.py @@ -25,6 +25,8 @@ from petstore_api.models.outer_enum_integer import OuterEnumInteger from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue + + class EnumTest(BaseModel): """ EnumTest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/feeding.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/feeding.py index ad8143b457aa..cabb939b57a9 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/feeding.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/feeding.py @@ -21,6 +21,8 @@ from pydantic import BaseModel, Field, StrictStr, validator + + class Feeding(BaseModel): """ Feeding diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/file.py index c87e30f73bf2..470af7b01607 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/file.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr + + class File(BaseModel): """ Must be named `File` for test. # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/file_schema_test_class.py index 32058bd16fa0..87a3df27983d 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/file_schema_test_class.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, conlist from petstore_api.models.file import File + + class FileSchemaTestClass(BaseModel): """ FileSchemaTestClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/first_ref.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/first_ref.py index ace84a5bcb84..96e083c598d1 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/first_ref.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/first_ref.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr + + class FirstRef(BaseModel): """ FirstRef diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/foo.py index fc58b159e5f5..a4d0b518ce2c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/foo.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr + + class Foo(BaseModel): """ Foo diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/foo_get_default_response.py index e792358dc002..a6c66d151e49 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/foo_get_default_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/foo_get_default_response.py @@ -22,6 +22,8 @@ from pydantic import BaseModel from petstore_api.models.foo import Foo + + class FooGetDefaultResponse(BaseModel): """ FooGetDefaultResponse diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/format_test.py index a0abc32a6598..5282f8c555fc 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/format_test.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/format_test.py @@ -21,6 +21,8 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictBytes, StrictInt, StrictStr, condecimal, confloat, conint, constr, validator + + class FormatTest(BaseModel): """ FormatTest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/has_only_read_only.py index 5a6dd7857d12..b9da607731ae 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/has_only_read_only.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr + + class HasOnlyReadOnly(BaseModel): """ HasOnlyReadOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/health_check_result.py index 02405bea384e..969004a6ccca 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/health_check_result.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/health_check_result.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr + + class HealthCheckResult(BaseModel): """ Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/inner_dict_with_property.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/inner_dict_with_property.py index 9f134186b6a6..71ec250506a9 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/inner_dict_with_property.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/inner_dict_with_property.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field + + class InnerDictWithProperty(BaseModel): """ InnerDictWithProperty diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/input_all_of.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/input_all_of.py index 03990b32988f..807fb5a75b99 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/input_all_of.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/input_all_of.py @@ -22,6 +22,8 @@ from pydantic import BaseModel from petstore_api.models.tag import Tag + + class InputAllOf(BaseModel): """ InputAllOf diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/list_class.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/list_class.py index ea187d934d4b..b62891d56845 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/list_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/list_class.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr + + class ListClass(BaseModel): """ ListClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/map_of_array_of_model.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/map_of_array_of_model.py index 444732620ab5..d2bb43ce70d2 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/map_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/map_of_array_of_model.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field, conlist from petstore_api.models.tag import Tag + + class MapOfArrayOfModel(BaseModel): """ MapOfArrayOfModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/map_test.py index 42e47b1cb4f3..696148e85a98 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/map_test.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/map_test.py @@ -21,6 +21,8 @@ from typing import Dict, Optional from pydantic import BaseModel, StrictBool, StrictStr, validator + + class MapTest(BaseModel): """ MapTest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py index 03f306af535f..060669e85b80 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field, StrictStr from petstore_api.models.animal import Animal + + class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): """ MixedPropertiesAndAdditionalPropertiesClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/model200_response.py index f129e4dafe80..8a16c13849a3 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/model200_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/model200_response.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr + + class Model200Response(BaseModel): """ Model for testing model name starting with number # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/model_return.py index 1d2b0266d343..ec5a2f1c39c5 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/model_return.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/model_return.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt + + class ModelReturn(BaseModel): """ Model for testing reserved words # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/name.py index 5284db112e9b..73e96559f1d8 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/name.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr + + class Name(BaseModel): """ Model for testing model name same as property name # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/nullable_class.py index f26aac9ff07d..c99ee51d3647 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/nullable_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/nullable_class.py @@ -21,6 +21,8 @@ from typing import Any, Dict, List, Optional from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist + + class NullableClass(BaseModel): """ NullableClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/nullable_property.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/nullable_property.py index 2312fbbbf5fd..1064157d171e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/nullable_property.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/nullable_property.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, constr, validator + + class NullableProperty(BaseModel): """ NullableProperty diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/number_only.py index 6549b2617824..03fc48de3d15 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/number_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/number_only.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, Field + + class NumberOnly(BaseModel): """ NumberOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/object_to_test_additional_properties.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/object_to_test_additional_properties.py index f609e06f6a9c..a6e8f1e2025e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/object_to_test_additional_properties.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/object_to_test_additional_properties.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictBool + + class ObjectToTestAdditionalProperties(BaseModel): """ Minimal object # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/object_with_deprecated_fields.py index 421206c1bc79..ceb8d151a0c4 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/object_with_deprecated_fields.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/object_with_deprecated_fields.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field, StrictStr, conlist from petstore_api.models.deprecated_object import DeprecatedObject + + class ObjectWithDeprecatedFields(BaseModel): """ ObjectWithDeprecatedFields diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/order.py index da726d2096dc..e673e3a14442 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/order.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, validator + + class Order(BaseModel): """ Order diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/outer_composite.py index 63627c3d0fde..cf90232f763b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/outer_composite.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/outer_composite.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictBool, StrictStr + + class OuterComposite(BaseModel): """ OuterComposite diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/outer_object_with_enum_property.py index c4ae68e5510f..603950b41746 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/outer_object_with_enum_property.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/outer_object_with_enum_property.py @@ -23,6 +23,8 @@ from petstore_api.models.outer_enum import OuterEnum from petstore_api.models.outer_enum_integer import OuterEnumInteger + + class OuterObjectWithEnumProperty(BaseModel): """ OuterObjectWithEnumProperty diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/parent.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/parent.py index a3105aff6821..ce41b17cf6ad 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/parent.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/parent.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field from petstore_api.models.inner_dict_with_property import InnerDictWithProperty + + class Parent(BaseModel): """ Parent diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/parent_with_optional_dict.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/parent_with_optional_dict.py index 253747b3abd7..105cbeb170a0 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/parent_with_optional_dict.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/parent_with_optional_dict.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field from petstore_api.models.inner_dict_with_property import InnerDictWithProperty + + class ParentWithOptionalDict(BaseModel): """ ParentWithOptionalDict diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/pet.py index e45fdc4a27d7..602065a69705 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/pet.py @@ -23,6 +23,8 @@ from petstore_api.models.category import Category from petstore_api.models.tag import Tag + + class Pet(BaseModel): """ Pet diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/poop_cleaning.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/poop_cleaning.py index 54dff6de1f12..ab2768fb575e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/poop_cleaning.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/poop_cleaning.py @@ -21,6 +21,8 @@ from pydantic import BaseModel, Field, StrictStr, validator + + class PoopCleaning(BaseModel): """ PoopCleaning diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/property_map.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/property_map.py index 9d3d06512b33..7ab83b602fb5 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/property_map.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/property_map.py @@ -22,6 +22,8 @@ from pydantic import BaseModel from petstore_api.models.tag import Tag + + class PropertyMap(BaseModel): """ PropertyMap diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/property_name_collision.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/property_name_collision.py index ed45ecdf74c4..981fdf521f65 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/property_name_collision.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/property_name_collision.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr + + class PropertyNameCollision(BaseModel): """ PropertyNameCollision diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/read_only_first.py index da66589ee79c..a9e41544f759 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/read_only_first.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/read_only_first.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr + + class ReadOnlyFirst(BaseModel): """ ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/second_ref.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/second_ref.py index 0c4f70eb9395..5fb8021abc3e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/second_ref.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/second_ref.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr + + class SecondRef(BaseModel): """ SecondRef diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/self_reference_model.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/self_reference_model.py index f7470db995e6..f1f0896b5100 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/self_reference_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/self_reference_model.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictInt + + class SelfReferenceModel(BaseModel): """ SelfReferenceModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/special_model_name.py index 43e57ff7b7bd..fd3205f04ee0 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/special_model_name.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/special_model_name.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt + + class SpecialModelName(BaseModel): """ SpecialModelName diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/special_name.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/special_name.py index f8841f7a4cce..7e925e57cc21 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/special_name.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/special_name.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr, validator from petstore_api.models.category import Category + + class SpecialName(BaseModel): """ SpecialName diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/tag.py index 45605d239331..54a7a9ccaa4a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/tag.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr + + class Tag(BaseModel): """ Tag diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/task.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/task.py index 2fb988a0a5d5..9796812e83b8 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/task.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/task.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field, StrictStr from petstore_api.models.task_activity import TaskActivity + + class Task(BaseModel): """ Used to test oneOf enums with only one string value. # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py index c4904af2905c..62700923870b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr + + class TestErrorResponsesWithModel400Response(BaseModel): """ TestErrorResponsesWithModel400Response diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py index 96b5f6c58715..1fa78603b753 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr + + class TestErrorResponsesWithModel404Response(BaseModel): """ TestErrorResponsesWithModel404Response diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py index a77233c5677a..1db2941a3071 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr + + class TestInlineFreeformAdditionalPropertiesRequest(BaseModel): """ TestInlineFreeformAdditionalPropertiesRequest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/tiger.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/tiger.py index 88b2f3c6a04f..2e57342d5c3c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/tiger.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/tiger.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr + + class Tiger(BaseModel): """ Tiger diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py index d948e70725f2..23519f92f8bb 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field, conlist from petstore_api.models.creature_info import CreatureInfo + + class UnnamedDictWithAdditionalModelListProperties(BaseModel): """ UnnamedDictWithAdditionalModelListProperties diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py index df1dcd41074c..ea0975f38eb8 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py @@ -21,6 +21,8 @@ from typing import Dict, List, Optional from pydantic import BaseModel, Field, StrictStr, conlist + + class UnnamedDictWithAdditionalStringListProperties(BaseModel): """ UnnamedDictWithAdditionalStringListProperties diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/user.py index 5c09a897c702..365bbb460418 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/user.py @@ -21,6 +21,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr + + class User(BaseModel): """ User diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/with_nested_one_of.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/with_nested_one_of.py index 0268402b5f4c..f7dfa263fd16 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/with_nested_one_of.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/with_nested_one_of.py @@ -23,6 +23,8 @@ from petstore_api.models.one_of_enum_string import OneOfEnumString from petstore_api.models.pig import Pig + + class WithNestedOneOf(BaseModel): """ WithNestedOneOf diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_any_type.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_any_type.py index a0f5848057e7..c2ecdda3ed4e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_any_type.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_any_type.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr + + class AdditionalPropertiesAnyType(BaseModel): """ AdditionalPropertiesAnyType diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_class.py index 06c924e21f91..4c14f37c4878 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_class.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr + + class AdditionalPropertiesClass(BaseModel): """ AdditionalPropertiesClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_object.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_object.py index 022aa9c286a1..fa75397cca48 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_object.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_object.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr + + class AdditionalPropertiesObject(BaseModel): """ AdditionalPropertiesObject diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_with_description_only.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_with_description_only.py index ab7281d0dc4d..ea104bcf84d9 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_with_description_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_with_description_only.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr + + class AdditionalPropertiesWithDescriptionOnly(BaseModel): """ AdditionalPropertiesWithDescriptionOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/all_of_with_single_ref.py index f0fba0386424..fb1c78b62017 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/all_of_with_single_ref.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/all_of_with_single_ref.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field, StrictStr from petstore_api.models.single_ref_type import SingleRefType + + class AllOfWithSingleRef(BaseModel): """ AllOfWithSingleRef diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/animal.py index 08c51a32b431..1f01a5a0d0ec 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/animal.py @@ -21,6 +21,14 @@ from typing import Any, Dict, Optional, Union from pydantic import BaseModel, Field, StrictStr + +from typing import TYPE_CHECKING +from importlib import import_module +if TYPE_CHECKING: + from petstore_api.models.cat import Cat + from petstore_api.models.dog import Dog + + class Animal(BaseModel): """ Animal @@ -85,15 +93,12 @@ def from_dict(cls, obj: dict) -> Union(Cat, Dog): """Create an instance of Animal from a dict""" # look up the object type based on discriminator mapping object_type = cls.get_discriminator_value(obj) - if object_type: - klass = globals()[object_type] - return klass.from_dict(obj) - else: - raise ValueError("Animal failed to lookup discriminator value from " + - json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + - ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + if object_type == 'Cat': + return import_module("petstore_api.models.cat").Cat.from_dict(obj) + if object_type == 'Dog': + return import_module("petstore_api.models.dog").Dog.from_dict(obj) + 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)) -from petstore_api.models.cat import Cat -from petstore_api.models.dog import Dog -Animal.update_forward_refs() diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/api_response.py index 6224b7b9564d..0ed6cbbc6bcd 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/api_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/api_response.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictInt, StrictStr + + class ApiResponse(BaseModel): """ ApiResponse diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_array_of_model.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_array_of_model.py index 0f444a85a296..bcdd11ff4fcc 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_array_of_model.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, conlist from petstore_api.models.tag import Tag + + class ArrayOfArrayOfModel(BaseModel): """ ArrayOfArrayOfModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_array_of_number_only.py index 45ffc93e2bbd..95f528446794 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_array_of_number_only.py @@ -21,6 +21,8 @@ from typing import Any, Dict, List, Optional from pydantic import BaseModel, Field, StrictFloat, conlist + + class ArrayOfArrayOfNumberOnly(BaseModel): """ ArrayOfArrayOfNumberOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_number_only.py index ff06726b621f..64be9372e39d 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_number_only.py @@ -21,6 +21,8 @@ from typing import Any, Dict, List, Optional from pydantic import BaseModel, Field, StrictFloat, conlist + + class ArrayOfNumberOnly(BaseModel): """ ArrayOfNumberOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_test.py index 399c66702c53..7dbabac4f60b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_test.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_test.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr, conlist from petstore_api.models.read_only_first import ReadOnlyFirst + + class ArrayTest(BaseModel): """ ArrayTest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/basque_pig.py index c9f6603166fb..b77b7bbb3714 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/basque_pig.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/basque_pig.py @@ -21,6 +21,8 @@ from typing import Any, Dict from pydantic import BaseModel, Field, StrictStr + + class BasquePig(BaseModel): """ BasquePig diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/bathing.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/bathing.py index 09bb3b7a0385..0b9784ef5b4c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/bathing.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/bathing.py @@ -21,6 +21,8 @@ from typing import Any, Dict from pydantic import BaseModel, Field, StrictStr, validator + + class Bathing(BaseModel): """ Bathing diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/capitalization.py index 3685da0822c0..fbf20e55d365 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/capitalization.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr + + class Capitalization(BaseModel): """ Capitalization diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/cat.py index b5dd4c4b08da..60d9869a15ef 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/cat.py @@ -22,6 +22,8 @@ from pydantic import StrictBool from petstore_api.models.animal import Animal + + class Cat(Animal): """ Cat diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/category.py index 068827c38788..f14ced0c9f39 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/category.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr + + class Category(BaseModel): """ Category diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/circular_reference_model.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/circular_reference_model.py index 68a202082b28..c175ee17950b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/circular_reference_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/circular_reference_model.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictInt + + class CircularReferenceModel(BaseModel): """ CircularReferenceModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/class_model.py index f9464aa85629..9b14e369ccf3 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/class_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/class_model.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr + + class ClassModel(BaseModel): """ Model for testing model with \"_class\" property # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/client.py index b527c6e6aeed..d765b99d3ddb 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/client.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr + + class Client(BaseModel): """ Client diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/creature.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/creature.py index ade10d2236a1..2602edc83ca2 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/creature.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/creature.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field, StrictStr from petstore_api.models.creature_info import CreatureInfo + + class Creature(BaseModel): """ Creature diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/creature_info.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/creature_info.py index bdc45b05b777..5544c8f768cd 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/creature_info.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/creature_info.py @@ -21,6 +21,8 @@ from typing import Any, Dict from pydantic import BaseModel, Field, StrictStr + + class CreatureInfo(BaseModel): """ CreatureInfo diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/danish_pig.py index 206f58550469..49a1644daec2 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/danish_pig.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/danish_pig.py @@ -21,6 +21,8 @@ from typing import Any, Dict from pydantic import BaseModel, Field, StrictInt, StrictStr + + class DanishPig(BaseModel): """ DanishPig diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/deprecated_object.py index 4e9dc9ddf75e..899fdd3ecb61 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/deprecated_object.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/deprecated_object.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr + + class DeprecatedObject(BaseModel): """ DeprecatedObject diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_sub.py index 271339926344..ecc06fcbfe64 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_sub.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_sub.py @@ -22,6 +22,8 @@ from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper + + class DiscriminatorAllOfSub(DiscriminatorAllOfSuper): """ DiscriminatorAllOfSub diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_super.py index dfb9173f4e63..4e262c32b09e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_super.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_super.py @@ -21,6 +21,13 @@ from typing import Any, Dict, Union from pydantic import BaseModel, Field, StrictStr + +from typing import TYPE_CHECKING +from importlib import import_module +if TYPE_CHECKING: + from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub + + class DiscriminatorAllOfSuper(BaseModel): """ DiscriminatorAllOfSuper @@ -83,14 +90,10 @@ def from_dict(cls, obj: dict) -> Union(DiscriminatorAllOfSub): """Create an instance of DiscriminatorAllOfSuper from a dict""" # look up the object type based on discriminator mapping object_type = cls.get_discriminator_value(obj) - if object_type: - klass = globals()[object_type] - return klass.from_dict(obj) - else: - raise ValueError("DiscriminatorAllOfSuper failed to lookup discriminator value from " + - json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + - ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + if object_type == 'DiscriminatorAllOfSub': + return import_module("petstore_api.models.discriminator_all_of_sub").DiscriminatorAllOfSub.from_dict(obj) + raise ValueError("DiscriminatorAllOfSuper failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) -from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub -DiscriminatorAllOfSuper.update_forward_refs() diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/dog.py index 6317e1fe32a0..6db23a2b6f5f 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/dog.py @@ -22,6 +22,8 @@ from pydantic import StrictStr from petstore_api.models.animal import Animal + + class Dog(Animal): """ Dog diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/dummy_model.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/dummy_model.py index 951906fd28e5..6fca11114e6b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/dummy_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/dummy_model.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr + + class DummyModel(BaseModel): """ DummyModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_arrays.py index f804f117c9b3..0bd51d06dac0 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_arrays.py @@ -21,6 +21,8 @@ from typing import Any, Dict, List, Optional from pydantic import BaseModel, StrictStr, conlist, validator + + class EnumArrays(BaseModel): """ EnumArrays diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_test.py index 8a06dc2f0cf3..97ad4412dc69 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_test.py @@ -25,6 +25,8 @@ from petstore_api.models.outer_enum_integer import OuterEnumInteger from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue + + class EnumTest(BaseModel): """ EnumTest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/feeding.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/feeding.py index 9afe7dce1b4f..625f568e491a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/feeding.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/feeding.py @@ -21,6 +21,8 @@ from typing import Any, Dict from pydantic import BaseModel, Field, StrictStr, validator + + class Feeding(BaseModel): """ Feeding diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/file.py index f45b5114f2c5..df737218d07f 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/file.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr + + class File(BaseModel): """ Must be named `File` for test. # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/file_schema_test_class.py index efbb7d95f03d..9e18c9b29061 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/file_schema_test_class.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, conlist from petstore_api.models.file import File + + class FileSchemaTestClass(BaseModel): """ FileSchemaTestClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/first_ref.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/first_ref.py index 5a44cd22c7e6..8b5444c02c64 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/first_ref.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/first_ref.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr + + class FirstRef(BaseModel): """ FirstRef diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/foo.py index 77f2ef9a359a..a73548cfa11b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/foo.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr + + class Foo(BaseModel): """ Foo diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/foo_get_default_response.py index 3eb736a411e3..5c42e621c742 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/foo_get_default_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/foo_get_default_response.py @@ -22,6 +22,8 @@ from pydantic import BaseModel from petstore_api.models.foo import Foo + + class FooGetDefaultResponse(BaseModel): """ FooGetDefaultResponse diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/format_test.py index 5363f6311963..474eaf40fa36 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/format_test.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/format_test.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional, Union from pydantic import BaseModel, Field, StrictBytes, StrictInt, StrictStr, condecimal, confloat, conint, constr, validator + + class FormatTest(BaseModel): """ FormatTest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/has_only_read_only.py index be7b0eb636b3..df12d09a9a58 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/has_only_read_only.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr + + class HasOnlyReadOnly(BaseModel): """ HasOnlyReadOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/health_check_result.py index ec2c401c3631..1b0840386685 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/health_check_result.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/health_check_result.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr + + class HealthCheckResult(BaseModel): """ Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/inner_dict_with_property.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/inner_dict_with_property.py index f3a50b0851b9..ca3e3eed88a6 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/inner_dict_with_property.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/inner_dict_with_property.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field + + class InnerDictWithProperty(BaseModel): """ InnerDictWithProperty diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/input_all_of.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/input_all_of.py index 1cec578d28e9..d04d17b00616 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/input_all_of.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/input_all_of.py @@ -22,6 +22,8 @@ from pydantic import BaseModel from petstore_api.models.tag import Tag + + class InputAllOf(BaseModel): """ InputAllOf diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/list_class.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/list_class.py index 5dd77934371d..6d709a512754 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/list_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/list_class.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr + + class ListClass(BaseModel): """ ListClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/map_of_array_of_model.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/map_of_array_of_model.py index 0f0bf902f308..f8d0172a2be2 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/map_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/map_of_array_of_model.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field, conlist from petstore_api.models.tag import Tag + + class MapOfArrayOfModel(BaseModel): """ MapOfArrayOfModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/map_test.py index 4270158fd4d0..a94d927911c8 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/map_test.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/map_test.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictBool, StrictStr, validator + + class MapTest(BaseModel): """ MapTest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/mixed_properties_and_additional_properties_class.py index 9345c5b2ab6b..9fa7f3dbbd5b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field, StrictStr from petstore_api.models.animal import Animal + + class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): """ MixedPropertiesAndAdditionalPropertiesClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/model200_response.py index 63c69743338e..16bf937ba522 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/model200_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/model200_response.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr + + class Model200Response(BaseModel): """ Model for testing model name starting with number # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/model_return.py index a7212e506b6c..cb2afef99775 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/model_return.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/model_return.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt + + class ModelReturn(BaseModel): """ Model for testing reserved words # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/name.py index 180e06e24c55..92525798ca6d 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/name.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr + + class Name(BaseModel): """ Model for testing model name same as property name # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/nullable_class.py index 578579888444..4383a7568bb2 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/nullable_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/nullable_class.py @@ -21,6 +21,8 @@ from typing import Any, Dict, List, Optional from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, conlist + + class NullableClass(BaseModel): """ NullableClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/nullable_property.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/nullable_property.py index 059cbdc577cb..ce3bbad9371f 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/nullable_property.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/nullable_property.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt, constr, validator + + class NullableProperty(BaseModel): """ NullableProperty diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/number_only.py index 78a00af5654b..abb528336f9c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/number_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/number_only.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictFloat + + class NumberOnly(BaseModel): """ NumberOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/object_to_test_additional_properties.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/object_to_test_additional_properties.py index 21e9a30d7dfb..3f05026760c1 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/object_to_test_additional_properties.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/object_to_test_additional_properties.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictBool + + class ObjectToTestAdditionalProperties(BaseModel): """ Minimal object # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/object_with_deprecated_fields.py index fda4435b8be3..f059dc1e937c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/object_with_deprecated_fields.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/object_with_deprecated_fields.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field, StrictFloat, StrictStr, conlist from petstore_api.models.deprecated_object import DeprecatedObject + + class ObjectWithDeprecatedFields(BaseModel): """ ObjectWithDeprecatedFields diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/order.py index 691eb04bbb1f..d66e09b3516a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/order.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, validator + + class Order(BaseModel): """ Order diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/outer_composite.py index b453339e1c87..f46b67891e24 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/outer_composite.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/outer_composite.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictBool, StrictFloat, StrictStr + + class OuterComposite(BaseModel): """ OuterComposite diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/outer_object_with_enum_property.py index a5723f0a9321..6c0a4287a09b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/outer_object_with_enum_property.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/outer_object_with_enum_property.py @@ -23,6 +23,8 @@ from petstore_api.models.outer_enum import OuterEnum from petstore_api.models.outer_enum_integer import OuterEnumInteger + + class OuterObjectWithEnumProperty(BaseModel): """ OuterObjectWithEnumProperty diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/parent.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/parent.py index d597e8c4e444..b6294146ae24 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/parent.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/parent.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field from petstore_api.models.inner_dict_with_property import InnerDictWithProperty + + class Parent(BaseModel): """ Parent diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/parent_with_optional_dict.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/parent_with_optional_dict.py index fa23256f5c60..f464a47ab422 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/parent_with_optional_dict.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/parent_with_optional_dict.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field from petstore_api.models.inner_dict_with_property import InnerDictWithProperty + + class ParentWithOptionalDict(BaseModel): """ ParentWithOptionalDict diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/pet.py index 25743a7ef09a..7ca45f448068 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/pet.py @@ -23,6 +23,8 @@ from petstore_api.models.category import Category from petstore_api.models.tag import Tag + + class Pet(BaseModel): """ Pet diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/poop_cleaning.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/poop_cleaning.py index 5649822e4f20..3665587dad73 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/poop_cleaning.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/poop_cleaning.py @@ -21,6 +21,8 @@ from typing import Any, Dict from pydantic import BaseModel, Field, StrictStr, validator + + class PoopCleaning(BaseModel): """ PoopCleaning diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/property_map.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/property_map.py index 28790f7f1ef6..4ad6be385f93 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/property_map.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/property_map.py @@ -22,6 +22,8 @@ from pydantic import BaseModel from petstore_api.models.tag import Tag + + class PropertyMap(BaseModel): """ PropertyMap diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/property_name_collision.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/property_name_collision.py index b5314f3d63e8..f61079c63614 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/property_name_collision.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/property_name_collision.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr + + class PropertyNameCollision(BaseModel): """ PropertyNameCollision diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/read_only_first.py index cfaf97c7091e..4e32ca8dd5fe 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/read_only_first.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/read_only_first.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr + + class ReadOnlyFirst(BaseModel): """ ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/second_ref.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/second_ref.py index 2f0c99ae1b90..a3cf2423cfb6 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/second_ref.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/second_ref.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr + + class SecondRef(BaseModel): """ SecondRef diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/self_reference_model.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/self_reference_model.py index 55512492d8e9..e5e44c3d85f2 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/self_reference_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/self_reference_model.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictInt + + class SelfReferenceModel(BaseModel): """ SelfReferenceModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/special_model_name.py index 1c9804d5b4ae..cba4348c46a8 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/special_model_name.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/special_model_name.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt + + class SpecialModelName(BaseModel): """ SpecialModelName diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/special_name.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/special_name.py index 51d955951d4f..cef62cb56fcb 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/special_name.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/special_name.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr, validator from petstore_api.models.category import Category + + class SpecialName(BaseModel): """ SpecialName diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/tag.py index 299159859552..7fe6ab19dbc1 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/tag.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictInt, StrictStr + + class Tag(BaseModel): """ Tag diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/task.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/task.py index 3bcc9d0c3f22..61ca1300aa38 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/task.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/task.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field, StrictStr from petstore_api.models.task_activity import TaskActivity + + class Task(BaseModel): """ Used to test oneOf enums with only one string value. # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_error_responses_with_model400_response.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_error_responses_with_model400_response.py index 40855d008cce..c831193d35ce 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_error_responses_with_model400_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_error_responses_with_model400_response.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr + + class TestErrorResponsesWithModel400Response(BaseModel): """ TestErrorResponsesWithModel400Response diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_error_responses_with_model404_response.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_error_responses_with_model404_response.py index 77c77d903f53..e623fe086e3a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_error_responses_with_model404_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_error_responses_with_model404_response.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr + + class TestErrorResponsesWithModel404Response(BaseModel): """ TestErrorResponsesWithModel404Response diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_inline_freeform_additional_properties_request.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_inline_freeform_additional_properties_request.py index c61f52a3e9e9..09d3736299bc 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_inline_freeform_additional_properties_request.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_inline_freeform_additional_properties_request.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr + + class TestInlineFreeformAdditionalPropertiesRequest(BaseModel): """ TestInlineFreeformAdditionalPropertiesRequest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/tiger.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/tiger.py index 71453dcec366..3f236ab6c02c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/tiger.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/tiger.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr + + class Tiger(BaseModel): """ Tiger diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py index be7bbac84d79..88876b09febe 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py @@ -22,6 +22,8 @@ from pydantic import BaseModel, Field, conlist from petstore_api.models.creature_info import CreatureInfo + + class UnnamedDictWithAdditionalModelListProperties(BaseModel): """ UnnamedDictWithAdditionalModelListProperties diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py index fa1e5eec56a7..d25fb0b3580e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py @@ -21,6 +21,8 @@ from typing import Any, Dict, List, Optional from pydantic import BaseModel, Field, StrictStr, conlist + + class UnnamedDictWithAdditionalStringListProperties(BaseModel): """ UnnamedDictWithAdditionalStringListProperties diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/user.py index 365c77ceb141..91eaf2c18167 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/user.py @@ -21,6 +21,8 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr + + class User(BaseModel): """ User diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/with_nested_one_of.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/with_nested_one_of.py index 8ec40c8eda1e..59bfdd4f4f4a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/with_nested_one_of.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/with_nested_one_of.py @@ -23,6 +23,8 @@ from petstore_api.models.one_of_enum_string import OneOfEnumString from petstore_api.models.pig import Pig + + class WithNestedOneOf(BaseModel): """ WithNestedOneOf 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 5fc65efc0ce0..63af1000be2d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py @@ -110,9 +110,9 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[Cat, Dog]]: # look up the object type based on discriminator mapping object_type = cls.get_discriminator_value(obj) if object_type == 'Cat': - return import_module("petstore_api.models.cat").Cat.from_dict(obj) # type: ignore + return import_module("petstore_api.models.cat").Cat.from_dict(obj) if object_type == 'Dog': - return import_module("petstore_api.models.dog").Dog.from_dict(obj) # type: ignore + return import_module("petstore_api.models.dog").Dog.from_dict(obj) raise ValueError("Animal failed to lookup discriminator value from " + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_super.py b/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_super.py index 2678c93f3a1a..cb611f06c48f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_super.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_super.py @@ -108,7 +108,7 @@ def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[DiscriminatorAllOfSub] # look up the object type based on discriminator mapping object_type = cls.get_discriminator_value(obj) if object_type == 'DiscriminatorAllOfSub': - return import_module("petstore_api.models.discriminator_all_of_sub").DiscriminatorAllOfSub.from_dict(obj) # type: ignore + return import_module("petstore_api.models.discriminator_all_of_sub").DiscriminatorAllOfSub.from_dict(obj) raise ValueError("DiscriminatorAllOfSuper failed to lookup discriminator value from " + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + From 293bef3a555801e2b2fc215c1bcd09015f4f813a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Tue, 20 Feb 2024 00:55:36 +0000 Subject: [PATCH 11/12] [python] fix avoid the empty line break --- .../resources/python-pydantic-v1/model_generic.mustache | 6 ++++-- .../src/main/resources/python/model_generic.mustache | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python-pydantic-v1/model_generic.mustache b/modules/openapi-generator/src/main/resources/python-pydantic-v1/model_generic.mustache index 9322a4466928..28acda94c886 100644 --- a/modules/openapi-generator/src/main/resources/python-pydantic-v1/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python-pydantic-v1/model_generic.mustache @@ -10,7 +10,8 @@ import json {{{.}}} {{/vendorExtensions.x-py-model-imports}} -{{#hasChildren}}{{#discriminator}} +{{#hasChildren}} +{{#discriminator}} {{! If this model is a super class, importlib is used. So import the necessary modules for the type here. }} from typing import TYPE_CHECKING from importlib import import_module @@ -18,8 +19,9 @@ if TYPE_CHECKING: {{#mappedModels}} from {{packageName}}.models.{{model.classVarName}} import {{modelName}} {{/mappedModels}} -{{/discriminator}}{{/hasChildren}} +{{/discriminator}} +{{/hasChildren}} class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}): """ {{#description}}{{{description}}} # noqa: E501{{/description}}{{^description}}{{{classname}}}{{/description}} 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 2c93dfdfa86e..8dcdd1a48ae3 100644 --- a/modules/openapi-generator/src/main/resources/python/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_generic.mustache @@ -12,15 +12,17 @@ import json from typing import Optional, Set from typing_extensions import Self -{{#hasChildren}}{{#discriminator}} +{{#hasChildren}} +{{#discriminator}} {{! If this model is a super class, importlib is used. So import the necessary modules for the type here. }} from typing import TYPE_CHECKING if TYPE_CHECKING: {{#mappedModels}} from {{packageName}}.models.{{model.classVarName}} import {{modelName}} {{/mappedModels}} -{{/discriminator}}{{/hasChildren}} +{{/discriminator}} +{{/hasChildren}} class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}): """ {{#description}}{{{description}}}{{/description}}{{^description}}{{{classname}}}{{/description}} From 51e66e5dbd947ac24e4ed49b9c1b98683b0650ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Tue, 20 Feb 2024 00:55:53 +0000 Subject: [PATCH 12/12] [python] update samples --- .../openapi_client/models/bird.py | 2 -- .../openapi_client/models/category.py | 2 -- .../openapi_client/models/data_query.py | 2 -- .../openapi_client/models/default_value.py | 2 -- .../openapi_client/models/number_properties_only.py | 2 -- .../openapi_client/models/pet.py | 2 -- .../openapi_client/models/query.py | 2 -- .../openapi_client/models/tag.py | 2 -- ..._object_explode_true_object_all_of_query_object_parameter.py | 2 -- ...yle_form_explode_true_array_string_query_object_parameter.py | 2 -- .../echo_api/python-pydantic-v1/openapi_client/models/bird.py | 2 -- .../python-pydantic-v1/openapi_client/models/category.py | 2 -- .../python-pydantic-v1/openapi_client/models/data_query.py | 2 -- .../python-pydantic-v1/openapi_client/models/default_value.py | 2 -- .../openapi_client/models/number_properties_only.py | 2 -- .../echo_api/python-pydantic-v1/openapi_client/models/pet.py | 2 -- .../echo_api/python-pydantic-v1/openapi_client/models/query.py | 2 -- .../echo_api/python-pydantic-v1/openapi_client/models/tag.py | 2 -- ..._object_explode_true_object_all_of_query_object_parameter.py | 2 -- ...yle_form_explode_true_array_string_query_object_parameter.py | 2 -- samples/client/echo_api/python/openapi_client/models/bird.py | 2 -- .../client/echo_api/python/openapi_client/models/category.py | 2 -- .../client/echo_api/python/openapi_client/models/data_query.py | 2 -- .../echo_api/python/openapi_client/models/default_value.py | 2 -- .../python/openapi_client/models/number_properties_only.py | 2 -- samples/client/echo_api/python/openapi_client/models/pet.py | 2 -- samples/client/echo_api/python/openapi_client/models/query.py | 2 -- samples/client/echo_api/python/openapi_client/models/tag.py | 2 -- ..._object_explode_true_object_all_of_query_object_parameter.py | 2 -- ...yle_form_explode_true_array_string_query_object_parameter.py | 2 -- .../petstore_api/models/additional_properties_any_type.py | 2 -- .../petstore_api/models/additional_properties_class.py | 2 -- .../petstore_api/models/additional_properties_object.py | 2 -- .../models/additional_properties_with_description_only.py | 2 -- .../petstore_api/models/all_of_with_single_ref.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/animal.py | 2 -- .../petstore_api/models/array_of_array_of_model.py | 2 -- .../petstore_api/models/array_of_array_of_number_only.py | 2 -- .../python-aiohttp/petstore_api/models/array_of_number_only.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/array_test.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/basque_pig.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/bathing.py | 2 -- .../python-aiohttp/petstore_api/models/capitalization.py | 2 -- .../client/petstore/python-aiohttp/petstore_api/models/cat.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/category.py | 2 -- .../petstore_api/models/circular_reference_model.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/class_model.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/client.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/creature.py | 2 -- .../python-aiohttp/petstore_api/models/creature_info.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/danish_pig.py | 2 -- .../python-aiohttp/petstore_api/models/deprecated_object.py | 2 -- .../petstore_api/models/discriminator_all_of_sub.py | 2 -- .../petstore_api/models/discriminator_all_of_super.py | 2 -- .../client/petstore/python-aiohttp/petstore_api/models/dog.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/dummy_model.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/enum_arrays.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/enum_test.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/feeding.py | 2 -- .../client/petstore/python-aiohttp/petstore_api/models/file.py | 2 -- .../petstore_api/models/file_schema_test_class.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/first_ref.py | 2 -- .../client/petstore/python-aiohttp/petstore_api/models/foo.py | 2 -- .../petstore_api/models/foo_get_default_response.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/format_test.py | 2 -- .../python-aiohttp/petstore_api/models/has_only_read_only.py | 2 -- .../python-aiohttp/petstore_api/models/health_check_result.py | 2 -- .../petstore_api/models/inner_dict_with_property.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/input_all_of.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/list_class.py | 2 -- .../python-aiohttp/petstore_api/models/map_of_array_of_model.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/map_test.py | 2 -- .../models/mixed_properties_and_additional_properties_class.py | 2 -- .../python-aiohttp/petstore_api/models/model200_response.py | 2 -- .../python-aiohttp/petstore_api/models/model_api_response.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/model_return.py | 2 -- .../client/petstore/python-aiohttp/petstore_api/models/name.py | 2 -- .../python-aiohttp/petstore_api/models/nullable_class.py | 2 -- .../python-aiohttp/petstore_api/models/nullable_property.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/number_only.py | 2 -- .../petstore_api/models/object_to_test_additional_properties.py | 2 -- .../petstore_api/models/object_with_deprecated_fields.py | 2 -- .../client/petstore/python-aiohttp/petstore_api/models/order.py | 2 -- .../python-aiohttp/petstore_api/models/outer_composite.py | 2 -- .../petstore_api/models/outer_object_with_enum_property.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/parent.py | 2 -- .../petstore_api/models/parent_with_optional_dict.py | 2 -- .../client/petstore/python-aiohttp/petstore_api/models/pet.py | 2 -- .../python-aiohttp/petstore_api/models/poop_cleaning.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/property_map.py | 2 -- .../petstore_api/models/property_name_collision.py | 2 -- .../python-aiohttp/petstore_api/models/read_only_first.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/second_ref.py | 2 -- .../python-aiohttp/petstore_api/models/self_reference_model.py | 2 -- .../python-aiohttp/petstore_api/models/special_model_name.py | 2 -- .../petstore/python-aiohttp/petstore_api/models/special_name.py | 2 -- .../client/petstore/python-aiohttp/petstore_api/models/tag.py | 2 -- .../client/petstore/python-aiohttp/petstore_api/models/task.py | 2 -- .../models/test_error_responses_with_model400_response.py | 2 -- .../models/test_error_responses_with_model404_response.py | 2 -- .../test_inline_freeform_additional_properties_request.py | 2 -- .../client/petstore/python-aiohttp/petstore_api/models/tiger.py | 2 -- .../unnamed_dict_with_additional_model_list_properties.py | 2 -- .../unnamed_dict_with_additional_string_list_properties.py | 2 -- .../client/petstore/python-aiohttp/petstore_api/models/user.py | 2 -- .../python-aiohttp/petstore_api/models/with_nested_one_of.py | 2 -- .../petstore_api/models/additional_properties_any_type.py | 2 -- .../petstore_api/models/additional_properties_class.py | 2 -- .../petstore_api/models/additional_properties_object.py | 2 -- .../models/additional_properties_with_description_only.py | 2 -- .../petstore_api/models/all_of_with_single_ref.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/animal.py | 2 -- .../petstore_api/models/api_response.py | 2 -- .../petstore_api/models/array_of_array_of_model.py | 2 -- .../petstore_api/models/array_of_array_of_number_only.py | 2 -- .../petstore_api/models/array_of_number_only.py | 2 -- .../petstore_api/models/array_test.py | 2 -- .../petstore_api/models/basque_pig.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/bathing.py | 2 -- .../petstore_api/models/capitalization.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/cat.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/category.py | 2 -- .../petstore_api/models/circular_reference_model.py | 2 -- .../petstore_api/models/class_model.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/client.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/creature.py | 2 -- .../petstore_api/models/creature_info.py | 2 -- .../petstore_api/models/danish_pig.py | 2 -- .../petstore_api/models/deprecated_object.py | 2 -- .../petstore_api/models/discriminator_all_of_sub.py | 2 -- .../petstore_api/models/discriminator_all_of_super.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/dog.py | 2 -- .../petstore_api/models/dummy_model.py | 2 -- .../petstore_api/models/enum_arrays.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/enum_test.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/feeding.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/file.py | 2 -- .../petstore_api/models/file_schema_test_class.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/first_ref.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/foo.py | 2 -- .../petstore_api/models/foo_get_default_response.py | 2 -- .../petstore_api/models/format_test.py | 2 -- .../petstore_api/models/has_only_read_only.py | 2 -- .../petstore_api/models/health_check_result.py | 2 -- .../petstore_api/models/inner_dict_with_property.py | 2 -- .../petstore_api/models/input_all_of.py | 2 -- .../petstore_api/models/list_class.py | 2 -- .../petstore_api/models/map_of_array_of_model.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/map_test.py | 2 -- .../models/mixed_properties_and_additional_properties_class.py | 2 -- .../petstore_api/models/model200_response.py | 2 -- .../petstore_api/models/model_return.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/name.py | 2 -- .../petstore_api/models/nullable_class.py | 2 -- .../petstore_api/models/nullable_property.py | 2 -- .../petstore_api/models/number_only.py | 2 -- .../petstore_api/models/object_to_test_additional_properties.py | 2 -- .../petstore_api/models/object_with_deprecated_fields.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/order.py | 2 -- .../petstore_api/models/outer_composite.py | 2 -- .../petstore_api/models/outer_object_with_enum_property.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/parent.py | 2 -- .../petstore_api/models/parent_with_optional_dict.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/pet.py | 2 -- .../petstore_api/models/poop_cleaning.py | 2 -- .../petstore_api/models/property_map.py | 2 -- .../petstore_api/models/property_name_collision.py | 2 -- .../petstore_api/models/read_only_first.py | 2 -- .../petstore_api/models/second_ref.py | 2 -- .../petstore_api/models/self_reference_model.py | 2 -- .../petstore_api/models/special_model_name.py | 2 -- .../petstore_api/models/special_name.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/tag.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/task.py | 2 -- .../models/test_error_responses_with_model400_response.py | 2 -- .../models/test_error_responses_with_model404_response.py | 2 -- .../test_inline_freeform_additional_properties_request.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/tiger.py | 2 -- .../unnamed_dict_with_additional_model_list_properties.py | 2 -- .../unnamed_dict_with_additional_string_list_properties.py | 2 -- .../python-pydantic-v1-aiohttp/petstore_api/models/user.py | 2 -- .../petstore_api/models/with_nested_one_of.py | 2 -- .../petstore_api/models/additional_properties_any_type.py | 2 -- .../petstore_api/models/additional_properties_class.py | 2 -- .../petstore_api/models/additional_properties_object.py | 2 -- .../models/additional_properties_with_description_only.py | 2 -- .../petstore_api/models/all_of_with_single_ref.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/animal.py | 2 -- .../python-pydantic-v1/petstore_api/models/api_response.py | 2 -- .../petstore_api/models/array_of_array_of_model.py | 2 -- .../petstore_api/models/array_of_array_of_number_only.py | 2 -- .../petstore_api/models/array_of_number_only.py | 2 -- .../python-pydantic-v1/petstore_api/models/array_test.py | 2 -- .../python-pydantic-v1/petstore_api/models/basque_pig.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/bathing.py | 2 -- .../python-pydantic-v1/petstore_api/models/capitalization.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/cat.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/category.py | 2 -- .../petstore_api/models/circular_reference_model.py | 2 -- .../python-pydantic-v1/petstore_api/models/class_model.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/client.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/creature.py | 2 -- .../python-pydantic-v1/petstore_api/models/creature_info.py | 2 -- .../python-pydantic-v1/petstore_api/models/danish_pig.py | 2 -- .../python-pydantic-v1/petstore_api/models/deprecated_object.py | 2 -- .../petstore_api/models/discriminator_all_of_sub.py | 2 -- .../petstore_api/models/discriminator_all_of_super.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/dog.py | 2 -- .../python-pydantic-v1/petstore_api/models/dummy_model.py | 2 -- .../python-pydantic-v1/petstore_api/models/enum_arrays.py | 2 -- .../python-pydantic-v1/petstore_api/models/enum_test.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/feeding.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/file.py | 2 -- .../petstore_api/models/file_schema_test_class.py | 2 -- .../python-pydantic-v1/petstore_api/models/first_ref.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/foo.py | 2 -- .../petstore_api/models/foo_get_default_response.py | 2 -- .../python-pydantic-v1/petstore_api/models/format_test.py | 2 -- .../petstore_api/models/has_only_read_only.py | 2 -- .../petstore_api/models/health_check_result.py | 2 -- .../petstore_api/models/inner_dict_with_property.py | 2 -- .../python-pydantic-v1/petstore_api/models/input_all_of.py | 2 -- .../python-pydantic-v1/petstore_api/models/list_class.py | 2 -- .../petstore_api/models/map_of_array_of_model.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/map_test.py | 2 -- .../models/mixed_properties_and_additional_properties_class.py | 2 -- .../python-pydantic-v1/petstore_api/models/model200_response.py | 2 -- .../python-pydantic-v1/petstore_api/models/model_return.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/name.py | 2 -- .../python-pydantic-v1/petstore_api/models/nullable_class.py | 2 -- .../python-pydantic-v1/petstore_api/models/nullable_property.py | 2 -- .../python-pydantic-v1/petstore_api/models/number_only.py | 2 -- .../petstore_api/models/object_to_test_additional_properties.py | 2 -- .../petstore_api/models/object_with_deprecated_fields.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/order.py | 2 -- .../python-pydantic-v1/petstore_api/models/outer_composite.py | 2 -- .../petstore_api/models/outer_object_with_enum_property.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/parent.py | 2 -- .../petstore_api/models/parent_with_optional_dict.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/pet.py | 2 -- .../python-pydantic-v1/petstore_api/models/poop_cleaning.py | 2 -- .../python-pydantic-v1/petstore_api/models/property_map.py | 2 -- .../petstore_api/models/property_name_collision.py | 2 -- .../python-pydantic-v1/petstore_api/models/read_only_first.py | 2 -- .../python-pydantic-v1/petstore_api/models/second_ref.py | 2 -- .../petstore_api/models/self_reference_model.py | 2 -- .../petstore_api/models/special_model_name.py | 2 -- .../python-pydantic-v1/petstore_api/models/special_name.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/tag.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/task.py | 2 -- .../models/test_error_responses_with_model400_response.py | 2 -- .../models/test_error_responses_with_model404_response.py | 2 -- .../test_inline_freeform_additional_properties_request.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/tiger.py | 2 -- .../unnamed_dict_with_additional_model_list_properties.py | 2 -- .../unnamed_dict_with_additional_string_list_properties.py | 2 -- .../petstore/python-pydantic-v1/petstore_api/models/user.py | 2 -- .../petstore_api/models/with_nested_one_of.py | 2 -- .../petstore_api/models/additional_properties_any_type.py | 2 -- .../python/petstore_api/models/additional_properties_class.py | 2 -- .../python/petstore_api/models/additional_properties_object.py | 2 -- .../models/additional_properties_with_description_only.py | 2 -- .../python/petstore_api/models/all_of_with_single_ref.py | 2 -- .../client/petstore/python/petstore_api/models/animal.py | 2 -- .../python/petstore_api/models/array_of_array_of_model.py | 2 -- .../python/petstore_api/models/array_of_array_of_number_only.py | 2 -- .../petstore/python/petstore_api/models/array_of_number_only.py | 2 -- .../client/petstore/python/petstore_api/models/array_test.py | 2 -- .../client/petstore/python/petstore_api/models/basque_pig.py | 2 -- .../client/petstore/python/petstore_api/models/bathing.py | 2 -- .../petstore/python/petstore_api/models/capitalization.py | 2 -- .../openapi3/client/petstore/python/petstore_api/models/cat.py | 2 -- .../client/petstore/python/petstore_api/models/category.py | 2 -- .../python/petstore_api/models/circular_reference_model.py | 2 -- .../client/petstore/python/petstore_api/models/class_model.py | 2 -- .../client/petstore/python/petstore_api/models/client.py | 2 -- .../client/petstore/python/petstore_api/models/creature.py | 2 -- .../client/petstore/python/petstore_api/models/creature_info.py | 2 -- .../client/petstore/python/petstore_api/models/danish_pig.py | 2 -- .../petstore/python/petstore_api/models/deprecated_object.py | 2 -- .../python/petstore_api/models/discriminator_all_of_sub.py | 2 -- .../python/petstore_api/models/discriminator_all_of_super.py | 2 -- .../openapi3/client/petstore/python/petstore_api/models/dog.py | 2 -- .../client/petstore/python/petstore_api/models/dummy_model.py | 2 -- .../client/petstore/python/petstore_api/models/enum_arrays.py | 2 -- .../client/petstore/python/petstore_api/models/enum_test.py | 2 -- .../client/petstore/python/petstore_api/models/feeding.py | 2 -- .../openapi3/client/petstore/python/petstore_api/models/file.py | 2 -- .../python/petstore_api/models/file_schema_test_class.py | 2 -- .../client/petstore/python/petstore_api/models/first_ref.py | 2 -- .../openapi3/client/petstore/python/petstore_api/models/foo.py | 2 -- .../python/petstore_api/models/foo_get_default_response.py | 2 -- .../client/petstore/python/petstore_api/models/format_test.py | 2 -- .../petstore/python/petstore_api/models/has_only_read_only.py | 2 -- .../petstore/python/petstore_api/models/health_check_result.py | 2 -- .../python/petstore_api/models/inner_dict_with_property.py | 2 -- .../client/petstore/python/petstore_api/models/input_all_of.py | 2 -- .../client/petstore/python/petstore_api/models/list_class.py | 2 -- .../python/petstore_api/models/map_of_array_of_model.py | 2 -- .../client/petstore/python/petstore_api/models/map_test.py | 2 -- .../models/mixed_properties_and_additional_properties_class.py | 2 -- .../petstore/python/petstore_api/models/model200_response.py | 2 -- .../petstore/python/petstore_api/models/model_api_response.py | 2 -- .../client/petstore/python/petstore_api/models/model_return.py | 2 -- .../openapi3/client/petstore/python/petstore_api/models/name.py | 2 -- .../petstore/python/petstore_api/models/nullable_class.py | 2 -- .../petstore/python/petstore_api/models/nullable_property.py | 2 -- .../client/petstore/python/petstore_api/models/number_only.py | 2 -- .../petstore_api/models/object_to_test_additional_properties.py | 2 -- .../python/petstore_api/models/object_with_deprecated_fields.py | 2 -- .../client/petstore/python/petstore_api/models/order.py | 2 -- .../petstore/python/petstore_api/models/outer_composite.py | 2 -- .../petstore_api/models/outer_object_with_enum_property.py | 2 -- .../client/petstore/python/petstore_api/models/parent.py | 2 -- .../python/petstore_api/models/parent_with_optional_dict.py | 2 -- .../openapi3/client/petstore/python/petstore_api/models/pet.py | 2 -- .../client/petstore/python/petstore_api/models/poop_cleaning.py | 2 -- .../client/petstore/python/petstore_api/models/property_map.py | 2 -- .../python/petstore_api/models/property_name_collision.py | 2 -- .../petstore/python/petstore_api/models/read_only_first.py | 2 -- .../client/petstore/python/petstore_api/models/second_ref.py | 2 -- .../petstore/python/petstore_api/models/self_reference_model.py | 2 -- .../petstore/python/petstore_api/models/special_model_name.py | 2 -- .../client/petstore/python/petstore_api/models/special_name.py | 2 -- .../openapi3/client/petstore/python/petstore_api/models/tag.py | 2 -- .../openapi3/client/petstore/python/petstore_api/models/task.py | 2 -- .../models/test_error_responses_with_model400_response.py | 2 -- .../models/test_error_responses_with_model404_response.py | 2 -- .../test_inline_freeform_additional_properties_request.py | 2 -- .../client/petstore/python/petstore_api/models/tiger.py | 2 -- .../unnamed_dict_with_additional_model_list_properties.py | 2 -- .../unnamed_dict_with_additional_string_list_properties.py | 2 -- .../openapi3/client/petstore/python/petstore_api/models/user.py | 2 -- .../petstore/python/petstore_api/models/with_nested_one_of.py | 2 -- 334 files changed, 668 deletions(-) diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/bird.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/bird.py index 071517e2c3e3..5481dd4f015f 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/bird.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/bird.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Bird(BaseModel): """ Bird diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/category.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/category.py index df74078f7f70..e46f6989cb44 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/category.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/category.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Category(BaseModel): """ Category diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/data_query.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/data_query.py index c9d93c62d1cc..6bac8e154f55 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/data_query.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/data_query.py @@ -25,8 +25,6 @@ from typing import Optional, Set from typing_extensions import Self - - class DataQuery(Query): """ DataQuery diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/default_value.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/default_value.py index 545161c4b53a..b5311d7a43c6 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/default_value.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/default_value.py @@ -24,8 +24,6 @@ from typing import Optional, Set from typing_extensions import Self - - class DefaultValue(BaseModel): """ to test the default value of properties diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/number_properties_only.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/number_properties_only.py index e3c66e4a8fca..051e721ba13b 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/number_properties_only.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/number_properties_only.py @@ -24,8 +24,6 @@ from typing import Optional, Set from typing_extensions import Self - - class NumberPropertiesOnly(BaseModel): """ NumberPropertiesOnly diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/pet.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/pet.py index e2641d9f1a77..24eb8075e612 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/pet.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/pet.py @@ -25,8 +25,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Pet(BaseModel): """ Pet diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/query.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/query.py index 887ed97dc7d8..0d2c05017fdc 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/query.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/query.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Query(BaseModel): """ Query diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/tag.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/tag.py index 3f71992195d7..bd160fbe153b 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/tag.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/tag.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Tag(BaseModel): """ Tag diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py index 32d1e8f8af6b..34bac06087ce 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(BaseModel): """ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py index bb8565773f05..7e3bd92a2737 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(BaseModel): """ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/bird.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/bird.py index c7d93fb4585d..77887a53120d 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/bird.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/bird.py @@ -22,8 +22,6 @@ from typing import Optional from pydantic import BaseModel, StrictStr - - class Bird(BaseModel): """ Bird diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/category.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/category.py index 9dea86e8ddb9..ee8e5c258ae9 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/category.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/category.py @@ -22,8 +22,6 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr - - class Category(BaseModel): """ Category diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/data_query.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/data_query.py index d7e6c28750ce..af8078549f1f 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/data_query.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/data_query.py @@ -23,8 +23,6 @@ from pydantic import Field, StrictStr from openapi_client.models.query import Query - - class DataQuery(Query): """ DataQuery diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/default_value.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/default_value.py index d203a79094cb..a73193247fd1 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/default_value.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/default_value.py @@ -23,8 +23,6 @@ from pydantic import BaseModel, StrictInt, StrictStr, conlist, validator from openapi_client.models.string_enum_ref import StringEnumRef - - class DefaultValue(BaseModel): """ to test the default value of properties # noqa: E501 diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/number_properties_only.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/number_properties_only.py index bbe1ffa850e3..10bb3a590a21 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/number_properties_only.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/number_properties_only.py @@ -22,8 +22,6 @@ from typing import Optional, Union from pydantic import BaseModel, StrictFloat, StrictInt, confloat, conint - - class NumberPropertiesOnly(BaseModel): """ NumberPropertiesOnly diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/pet.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/pet.py index c6cacd95e597..3a40ddc03215 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/pet.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/pet.py @@ -24,8 +24,6 @@ from openapi_client.models.category import Category from openapi_client.models.tag import Tag - - class Pet(BaseModel): """ Pet diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/query.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/query.py index a479de4d68eb..02e4233d513a 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/query.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/query.py @@ -22,8 +22,6 @@ from typing import List, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist, validator - - class Query(BaseModel): """ Query diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/tag.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/tag.py index 51b871c7a299..66a39adff29c 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/tag.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/tag.py @@ -22,8 +22,6 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr - - class Tag(BaseModel): """ Tag diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py index a5db6ae9dcff..42e1101ec022 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py @@ -22,8 +22,6 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr - - class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(BaseModel): """ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py index e23fc646483c..1bff80a6df1c 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py @@ -22,8 +22,6 @@ from typing import List, Optional from pydantic import BaseModel, StrictStr, conlist - - class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(BaseModel): """ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter 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 de64611236e3..f86a1aff96cb 100644 --- a/samples/client/echo_api/python/openapi_client/models/bird.py +++ b/samples/client/echo_api/python/openapi_client/models/bird.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Bird(BaseModel): """ Bird 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 8136c776df88..d9a6df479279 100644 --- a/samples/client/echo_api/python/openapi_client/models/category.py +++ b/samples/client/echo_api/python/openapi_client/models/category.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Category(BaseModel): """ Category 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 e0e25dda4fdf..c55a1261d200 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 @@ -25,8 +25,6 @@ from typing import Optional, Set from typing_extensions import Self - - class DataQuery(Query): """ DataQuery 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 9ca0e14c267c..a8c27c721cdd 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 @@ -24,8 +24,6 @@ from typing import Optional, Set from typing_extensions import Self - - class DefaultValue(BaseModel): """ to test the default value of properties 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 bc0152629cc5..de1c47ad8454 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 @@ -24,8 +24,6 @@ from typing import Optional, Set from typing_extensions import Self - - class NumberPropertiesOnly(BaseModel): """ NumberPropertiesOnly 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 297f03d0ecd3..a3f9d65d7103 100644 --- a/samples/client/echo_api/python/openapi_client/models/pet.py +++ b/samples/client/echo_api/python/openapi_client/models/pet.py @@ -25,8 +25,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Pet(BaseModel): """ Pet 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 887ed97dc7d8..0d2c05017fdc 100644 --- a/samples/client/echo_api/python/openapi_client/models/query.py +++ b/samples/client/echo_api/python/openapi_client/models/query.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Query(BaseModel): """ Query 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 c31ad2cd08b5..b26318f76074 100644 --- a/samples/client/echo_api/python/openapi_client/models/tag.py +++ b/samples/client/echo_api/python/openapi_client/models/tag.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Tag(BaseModel): """ Tag 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 97b271d38f98..80184c582aca 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(BaseModel): """ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter 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 daba23990585..1a84a025f48e 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(BaseModel): """ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter 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 bca6e58ee56d..43a139dc1749 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class AdditionalPropertiesAnyType(BaseModel): """ AdditionalPropertiesAnyType 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 5f06ea67ecdb..7635dc54330d 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class AdditionalPropertiesClass(BaseModel): """ AdditionalPropertiesClass 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 d808daa02f94..03735c7429c9 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class AdditionalPropertiesObject(BaseModel): """ AdditionalPropertiesObject 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 155b23d5f65a..7e3f920ab3cb 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class AdditionalPropertiesWithDescriptionOnly(BaseModel): """ AdditionalPropertiesWithDescriptionOnly 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 69322aaf4429..30b6645755ee 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class AllOfWithSingleRef(BaseModel): """ AllOfWithSingleRef 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 c7d31ccd7dde..2d99a95425f3 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 @@ -23,13 +23,11 @@ from typing import Optional, Set from typing_extensions import Self - from typing import TYPE_CHECKING if TYPE_CHECKING: from petstore_api.models.cat import Cat from petstore_api.models.dog import Dog - class Animal(BaseModel): """ Animal 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 a12b12ddd48b..b1318218a1e9 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ArrayOfArrayOfModel(BaseModel): """ ArrayOfArrayOfModel 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 59d7bea1455a..9ff34ea19ec0 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ArrayOfArrayOfNumberOnly(BaseModel): """ ArrayOfArrayOfNumberOnly 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 11f7e48de0c4..4385be8a0560 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ArrayOfNumberOnly(BaseModel): """ ArrayOfNumberOnly 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 453f43edf490..c5a44501eee7 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 @@ -24,8 +24,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ArrayTest(BaseModel): """ ArrayTest 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 218c03f8e8f6..23ab0585d517 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class BasquePig(BaseModel): """ BasquePig diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/bathing.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/bathing.py index f2ba962b0833..efc485131032 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/bathing.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/bathing.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Bathing(BaseModel): """ Bathing 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 99b43480489d..3a28f990d061 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Capitalization(BaseModel): """ Capitalization 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 55c4f546d352..c215d0924705 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Cat(Animal): """ Cat 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 8f3847869fc2..f3e78641caa6 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Category(BaseModel): """ Category 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 8514f00d9abb..3cafde6710ab 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class CircularReferenceModel(BaseModel): """ CircularReferenceModel 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 4f40cb2f5a60..58c3db52adac 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ClassModel(BaseModel): """ Model for testing model with \"_class\" property 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 19b39e4d218f..90c36a468676 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Client(BaseModel): """ Client 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 39c560f3b01e..73b1edc237cc 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Creature(BaseModel): """ Creature 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 d9ef656e32fb..511ec5191a44 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class CreatureInfo(BaseModel): """ CreatureInfo 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 b55410d29b66..56a78bbea26d 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class DanishPig(BaseModel): """ DanishPig 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 e5f436d61f1c..d7c0fa761b4b 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class DeprecatedObject(BaseModel): """ DeprecatedObject diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_sub.py index a8446821dfe6..222e38686bb0 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_sub.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_sub.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class DiscriminatorAllOfSub(DiscriminatorAllOfSuper): """ DiscriminatorAllOfSub diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_super.py index 895ee5cd192c..813a60643371 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_super.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/discriminator_all_of_super.py @@ -23,12 +23,10 @@ from typing import Optional, Set from typing_extensions import Self - from typing import TYPE_CHECKING if TYPE_CHECKING: from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub - class DiscriminatorAllOfSuper(BaseModel): """ DiscriminatorAllOfSuper 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 f3d19ea687b8..71b1bd01bc95 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Dog(Animal): """ Dog 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 45e85e04e328..9da3d978f52a 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class DummyModel(BaseModel): """ DummyModel 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 7dd1873b18c7..6bac8225630a 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class EnumArrays(BaseModel): """ EnumArrays 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 8c3cee96419b..4f2d86483fb5 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 @@ -26,8 +26,6 @@ from typing import Optional, Set from typing_extensions import Self - - class EnumTest(BaseModel): """ EnumTest diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/feeding.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/feeding.py index 02f2c2413737..4c5333d3b161 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/feeding.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/feeding.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Feeding(BaseModel): """ Feeding 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 a03b77962e05..c43c9ffa91a7 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class File(BaseModel): """ Must be named `File` for test. 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 80e5e9ed1b58..44324be0cb5f 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class FileSchemaTestClass(BaseModel): """ FileSchemaTestClass 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 1ccda45dc9da..8c6b8b45bd27 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class FirstRef(BaseModel): """ FirstRef 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 3f5180e60ba2..b2c6fafde0cb 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Foo(BaseModel): """ Foo 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 0690b9000a72..205de5807608 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class FooGetDefaultResponse(BaseModel): """ FooGetDefaultResponse 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 c265c7592bbf..afa5024f7904 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 @@ -25,8 +25,6 @@ from typing import Optional, Set from typing_extensions import Self - - class FormatTest(BaseModel): """ FormatTest 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 6a5456241b04..ee0c50cdeb4a 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class HasOnlyReadOnly(BaseModel): """ HasOnlyReadOnly 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 b5bf78513508..325f13a4c3a7 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class HealthCheckResult(BaseModel): """ Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. 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 9e9bb78064e9..c1c3f5370053 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class InnerDictWithProperty(BaseModel): """ InnerDictWithProperty diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/input_all_of.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/input_all_of.py index fbe96080a688..294df2f17d9e 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/input_all_of.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/input_all_of.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class InputAllOf(BaseModel): """ InputAllOf 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 2b9d8429bf09..b0c6db34dc6f 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ListClass(BaseModel): """ ListClass 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 fb95b26f6eb9..fbcdc17f6928 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class MapOfArrayOfModel(BaseModel): """ MapOfArrayOfModel 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 1caa9b1bcd73..bb674830c01d 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class MapTest(BaseModel): """ MapTest 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 061fb4338b76..1bc0a518afc9 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 @@ -24,8 +24,6 @@ from typing import Optional, Set from typing_extensions import Self - - class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): """ MixedPropertiesAndAdditionalPropertiesClass 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 7020dc4329b7..b74ff91feb9c 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Model200Response(BaseModel): """ Model for testing model name starting with number diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_api_response.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_api_response.py index 0807f02e67ad..5e87689a9861 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_api_response.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_api_response.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ModelApiResponse(BaseModel): """ ModelApiResponse 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 59adf500cead..86b6d51177ee 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ModelReturn(BaseModel): """ Model for testing reserved words 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 91f9f59471c8..55a50ac01bd0 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Name(BaseModel): """ Model for testing model name same as property name 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 9a533251e1da..64a2fe91b29d 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class NullableClass(BaseModel): """ NullableClass 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 064399d4e38d..fe618807e9da 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class NullableProperty(BaseModel): """ NullableProperty 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 3da65c24235a..7ed7b422b52a 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class NumberOnly(BaseModel): """ NumberOnly 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 3a6e9a9a9882..7e3aa7a202ff 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ObjectToTestAdditionalProperties(BaseModel): """ Minimal object 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 7fee049531ad..8b5c19ebd53d 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ObjectWithDeprecatedFields(BaseModel): """ ObjectWithDeprecatedFields 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 98c167bd5ee7..5c08aae91b1b 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Order(BaseModel): """ Order 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 7d6770d629d5..52a6e044d097 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class OuterComposite(BaseModel): """ OuterComposite 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 9981b2c03ac1..83f4c1b8ef32 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 @@ -24,8 +24,6 @@ from typing import Optional, Set from typing_extensions import Self - - class OuterObjectWithEnumProperty(BaseModel): """ OuterObjectWithEnumProperty 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 51eeb9a09db2..dba6f038d89c 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Parent(BaseModel): """ Parent 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 c8305ac0ed0b..3c81088b3b49 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ParentWithOptionalDict(BaseModel): """ ParentWithOptionalDict 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 eb05c5a344db..05f24508062d 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 @@ -25,8 +25,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Pet(BaseModel): """ Pet diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/poop_cleaning.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/poop_cleaning.py index 5c50969d5c92..789ef627f0ed 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/poop_cleaning.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/poop_cleaning.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class PoopCleaning(BaseModel): """ PoopCleaning diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/property_map.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/property_map.py index cc31774578a2..5ef7f65e40ed 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/property_map.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/property_map.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class PropertyMap(BaseModel): """ PropertyMap 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 9f0055eb81db..65135e04cd01 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class PropertyNameCollision(BaseModel): """ PropertyNameCollision 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 922664bc5b62..b2265203a59f 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ReadOnlyFirst(BaseModel): """ ReadOnlyFirst 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 6ed1cd77a6df..e57459a81490 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class SecondRef(BaseModel): """ SecondRef 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 294dfe000fbc..afd8d48a85f2 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class SelfReferenceModel(BaseModel): """ SelfReferenceModel 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 87ac3332705d..dbf0f7c7a718 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class SpecialModelName(BaseModel): """ SpecialModelName 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 0fe05a710713..9029b789f5ec 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class SpecialName(BaseModel): """ SpecialName 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 d198bd972fd6..b3cc7b7bbb7e 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Tag(BaseModel): """ Tag diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/task.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/task.py index ae26e7a1cf78..7fb9e638729f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/task.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/task.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Task(BaseModel): """ Used to test oneOf enums with only one string value. diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py index a0361dc48696..a456097bc7b5 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class TestErrorResponsesWithModel400Response(BaseModel): """ TestErrorResponsesWithModel400Response diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py index a3a8f16eb499..c4c88b202686 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class TestErrorResponsesWithModel404Response(BaseModel): """ TestErrorResponsesWithModel404Response 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 1cb4ea70cdd0..2fb96a50dd78 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class TestInlineFreeformAdditionalPropertiesRequest(BaseModel): """ TestInlineFreeformAdditionalPropertiesRequest 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 9a603930a682..cd9bb8f356ff 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Tiger(BaseModel): """ Tiger 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 3fd99fd3558c..9e5f2dae96e4 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class UnnamedDictWithAdditionalModelListProperties(BaseModel): """ UnnamedDictWithAdditionalModelListProperties 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 1738eab80c57..20840faa9950 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class UnnamedDictWithAdditionalStringListProperties(BaseModel): """ UnnamedDictWithAdditionalStringListProperties 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 730ebc729652..28ada093f19b 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class User(BaseModel): """ User 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 1e1c542ea3a3..5ca2df46c9b6 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 @@ -24,8 +24,6 @@ from typing import Optional, Set from typing_extensions import Self - - class WithNestedOneOf(BaseModel): """ WithNestedOneOf diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_any_type.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_any_type.py index 2fbcf416b825..0441dfd99e92 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_any_type.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_any_type.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictStr - - class AdditionalPropertiesAnyType(BaseModel): """ AdditionalPropertiesAnyType diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_class.py index 7fd35793b2ba..c53af3e2ca67 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_class.py @@ -21,8 +21,6 @@ from typing import Dict, Optional from pydantic import BaseModel, StrictStr - - class AdditionalPropertiesClass(BaseModel): """ AdditionalPropertiesClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_object.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_object.py index 42c0beee24a6..cff0e89b0568 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_object.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_object.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictStr - - class AdditionalPropertiesObject(BaseModel): """ AdditionalPropertiesObject diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_with_description_only.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_with_description_only.py index 8b09061cc2ec..17d6c461ed1b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_with_description_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_with_description_only.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictStr - - class AdditionalPropertiesWithDescriptionOnly(BaseModel): """ AdditionalPropertiesWithDescriptionOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/all_of_with_single_ref.py index 2bf7e8257a51..c5d066463f64 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/all_of_with_single_ref.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/all_of_with_single_ref.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field, StrictStr from petstore_api.models.single_ref_type import SingleRefType - - class AllOfWithSingleRef(BaseModel): """ AllOfWithSingleRef diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/animal.py index e0ed318a1a2e..5909850c0192 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/animal.py @@ -21,14 +21,12 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictStr - from typing import TYPE_CHECKING from importlib import import_module if TYPE_CHECKING: from petstore_api.models.cat import Cat from petstore_api.models.dog import Dog - class Animal(BaseModel): """ Animal diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/api_response.py index 516b298aad7a..2c58b8b9ccb8 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/api_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/api_response.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr - - class ApiResponse(BaseModel): """ ApiResponse diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_array_of_model.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_array_of_model.py index 3cf7db4e2fa7..6f67b220ccf1 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_array_of_model.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, conlist from petstore_api.models.tag import Tag - - class ArrayOfArrayOfModel(BaseModel): """ ArrayOfArrayOfModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_array_of_number_only.py index 80311a80d0ac..8ce909858b18 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_array_of_number_only.py @@ -21,8 +21,6 @@ from typing import List, Optional from pydantic import BaseModel, Field, conlist - - class ArrayOfArrayOfNumberOnly(BaseModel): """ ArrayOfArrayOfNumberOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_number_only.py index 2c8f61b9612c..768ea5ef0baf 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_of_number_only.py @@ -21,8 +21,6 @@ from typing import List, Optional from pydantic import BaseModel, Field, conlist - - class ArrayOfNumberOnly(BaseModel): """ ArrayOfNumberOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_test.py index 1c03622edc63..206b34dc4021 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_test.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/array_test.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, StrictInt, StrictStr, conlist from petstore_api.models.read_only_first import ReadOnlyFirst - - class ArrayTest(BaseModel): """ ArrayTest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/basque_pig.py index e113cfd0c52a..5683a73a3bfc 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/basque_pig.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/basque_pig.py @@ -21,8 +21,6 @@ from pydantic import BaseModel, Field, StrictStr - - class BasquePig(BaseModel): """ BasquePig diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/bathing.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/bathing.py index c296ee93f989..986de06f0c20 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/bathing.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/bathing.py @@ -21,8 +21,6 @@ from pydantic import BaseModel, Field, StrictStr, validator - - class Bathing(BaseModel): """ Bathing diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/capitalization.py index 6ca88611f5a9..2bb4435563b2 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/capitalization.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr - - class Capitalization(BaseModel): """ Capitalization diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/cat.py index 8ce1ea0b1ad5..efff0890a41a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/cat.py @@ -22,8 +22,6 @@ from pydantic import StrictBool from petstore_api.models.animal import Animal - - class Cat(Animal): """ Cat diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/category.py index 2d9190b9a6ad..86a10a8683cf 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/category.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr - - class Category(BaseModel): """ Category diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/circular_reference_model.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/circular_reference_model.py index feec550ee80d..6a9956f5af3b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/circular_reference_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/circular_reference_model.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictInt - - class CircularReferenceModel(BaseModel): """ CircularReferenceModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/class_model.py index 53b3d761ba25..d345924958ee 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/class_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/class_model.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr - - class ClassModel(BaseModel): """ Model for testing model with \"_class\" property # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/client.py index 5cb9bdded836..01f60acef507 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/client.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictStr - - class Client(BaseModel): """ Client diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/creature.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/creature.py index 8344c82e2bcd..dc2d94ece4cb 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/creature.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/creature.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field, StrictStr from petstore_api.models.creature_info import CreatureInfo - - class Creature(BaseModel): """ Creature diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/creature_info.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/creature_info.py index dd782554bf27..327ce9bc4fbc 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/creature_info.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/creature_info.py @@ -21,8 +21,6 @@ from pydantic import BaseModel, Field, StrictStr - - class CreatureInfo(BaseModel): """ CreatureInfo diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/danish_pig.py index 6abc73f80c20..cfb24a7d5857 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/danish_pig.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/danish_pig.py @@ -21,8 +21,6 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr - - class DanishPig(BaseModel): """ DanishPig diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/deprecated_object.py index 0c53e502dfb2..9ce72f88d48b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/deprecated_object.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/deprecated_object.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictStr - - class DeprecatedObject(BaseModel): """ DeprecatedObject diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_sub.py index 74e6e293c27d..65d54ea8d1a6 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_sub.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_sub.py @@ -22,8 +22,6 @@ from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper - - class DiscriminatorAllOfSub(DiscriminatorAllOfSuper): """ DiscriminatorAllOfSub diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_super.py index 1468d0836e97..4c808fbd4084 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_super.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/discriminator_all_of_super.py @@ -21,13 +21,11 @@ from typing import Union from pydantic import BaseModel, Field, StrictStr - from typing import TYPE_CHECKING from importlib import import_module if TYPE_CHECKING: from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub - class DiscriminatorAllOfSuper(BaseModel): """ DiscriminatorAllOfSuper diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/dog.py index 9982ac479307..f0533a50e495 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/dog.py @@ -22,8 +22,6 @@ from pydantic import StrictStr from petstore_api.models.animal import Animal - - class Dog(Animal): """ Dog diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/dummy_model.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/dummy_model.py index e798b5a5a61d..8e4db12e5c92 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/dummy_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/dummy_model.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictStr - - class DummyModel(BaseModel): """ DummyModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_arrays.py index 4568d9a58d74..5f3363b0a564 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_arrays.py @@ -21,8 +21,6 @@ from typing import List, Optional from pydantic import BaseModel, StrictStr, conlist, validator - - class EnumArrays(BaseModel): """ EnumArrays diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_test.py index 0d59a82a9a52..b3899720fd30 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_test.py @@ -25,8 +25,6 @@ from petstore_api.models.outer_enum_integer import OuterEnumInteger from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue - - class EnumTest(BaseModel): """ EnumTest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/feeding.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/feeding.py index cabb939b57a9..ad8143b457aa 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/feeding.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/feeding.py @@ -21,8 +21,6 @@ from pydantic import BaseModel, Field, StrictStr, validator - - class Feeding(BaseModel): """ Feeding diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/file.py index 470af7b01607..c87e30f73bf2 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/file.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr - - class File(BaseModel): """ Must be named `File` for test. # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/file_schema_test_class.py index 87a3df27983d..32058bd16fa0 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/file_schema_test_class.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, conlist from petstore_api.models.file import File - - class FileSchemaTestClass(BaseModel): """ FileSchemaTestClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/first_ref.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/first_ref.py index 96e083c598d1..ace84a5bcb84 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/first_ref.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/first_ref.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictStr - - class FirstRef(BaseModel): """ FirstRef diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/foo.py index a4d0b518ce2c..fc58b159e5f5 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/foo.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictStr - - class Foo(BaseModel): """ Foo diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/foo_get_default_response.py index a6c66d151e49..e792358dc002 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/foo_get_default_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/foo_get_default_response.py @@ -22,8 +22,6 @@ from pydantic import BaseModel from petstore_api.models.foo import Foo - - class FooGetDefaultResponse(BaseModel): """ FooGetDefaultResponse diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/format_test.py index 5282f8c555fc..a0abc32a6598 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/format_test.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/format_test.py @@ -21,8 +21,6 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictBytes, StrictInt, StrictStr, condecimal, confloat, conint, constr, validator - - class FormatTest(BaseModel): """ FormatTest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/has_only_read_only.py index b9da607731ae..5a6dd7857d12 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/has_only_read_only.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictStr - - class HasOnlyReadOnly(BaseModel): """ HasOnlyReadOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/health_check_result.py index 969004a6ccca..02405bea384e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/health_check_result.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/health_check_result.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr - - class HealthCheckResult(BaseModel): """ Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/inner_dict_with_property.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/inner_dict_with_property.py index 71ec250506a9..9f134186b6a6 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/inner_dict_with_property.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/inner_dict_with_property.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field - - class InnerDictWithProperty(BaseModel): """ InnerDictWithProperty diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/input_all_of.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/input_all_of.py index 807fb5a75b99..03990b32988f 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/input_all_of.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/input_all_of.py @@ -22,8 +22,6 @@ from pydantic import BaseModel from petstore_api.models.tag import Tag - - class InputAllOf(BaseModel): """ InputAllOf diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/list_class.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/list_class.py index b62891d56845..ea187d934d4b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/list_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/list_class.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr - - class ListClass(BaseModel): """ ListClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/map_of_array_of_model.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/map_of_array_of_model.py index d2bb43ce70d2..444732620ab5 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/map_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/map_of_array_of_model.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field, conlist from petstore_api.models.tag import Tag - - class MapOfArrayOfModel(BaseModel): """ MapOfArrayOfModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/map_test.py index 696148e85a98..42e47b1cb4f3 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/map_test.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/map_test.py @@ -21,8 +21,6 @@ from typing import Dict, Optional from pydantic import BaseModel, StrictBool, StrictStr, validator - - class MapTest(BaseModel): """ MapTest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py index 060669e85b80..03f306af535f 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field, StrictStr from petstore_api.models.animal import Animal - - class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): """ MixedPropertiesAndAdditionalPropertiesClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/model200_response.py index 8a16c13849a3..f129e4dafe80 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/model200_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/model200_response.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr - - class Model200Response(BaseModel): """ Model for testing model name starting with number # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/model_return.py index ec5a2f1c39c5..1d2b0266d343 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/model_return.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/model_return.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt - - class ModelReturn(BaseModel): """ Model for testing reserved words # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/name.py index 73e96559f1d8..5284db112e9b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/name.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr - - class Name(BaseModel): """ Model for testing model name same as property name # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/nullable_class.py index c99ee51d3647..f26aac9ff07d 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/nullable_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/nullable_class.py @@ -21,8 +21,6 @@ from typing import Any, Dict, List, Optional from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist - - class NullableClass(BaseModel): """ NullableClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/nullable_property.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/nullable_property.py index 1064157d171e..2312fbbbf5fd 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/nullable_property.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/nullable_property.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, constr, validator - - class NullableProperty(BaseModel): """ NullableProperty diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/number_only.py index 03fc48de3d15..6549b2617824 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/number_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/number_only.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, Field - - class NumberOnly(BaseModel): """ NumberOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/object_to_test_additional_properties.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/object_to_test_additional_properties.py index a6e8f1e2025e..f609e06f6a9c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/object_to_test_additional_properties.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/object_to_test_additional_properties.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, Field, StrictBool - - class ObjectToTestAdditionalProperties(BaseModel): """ Minimal object # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/object_with_deprecated_fields.py index ceb8d151a0c4..421206c1bc79 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/object_with_deprecated_fields.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/object_with_deprecated_fields.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field, StrictStr, conlist from petstore_api.models.deprecated_object import DeprecatedObject - - class ObjectWithDeprecatedFields(BaseModel): """ ObjectWithDeprecatedFields diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/order.py index e673e3a14442..da726d2096dc 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/order.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, validator - - class Order(BaseModel): """ Order diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/outer_composite.py index cf90232f763b..63627c3d0fde 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/outer_composite.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/outer_composite.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictBool, StrictStr - - class OuterComposite(BaseModel): """ OuterComposite diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/outer_object_with_enum_property.py index 603950b41746..c4ae68e5510f 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/outer_object_with_enum_property.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/outer_object_with_enum_property.py @@ -23,8 +23,6 @@ from petstore_api.models.outer_enum import OuterEnum from petstore_api.models.outer_enum_integer import OuterEnumInteger - - class OuterObjectWithEnumProperty(BaseModel): """ OuterObjectWithEnumProperty diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/parent.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/parent.py index ce41b17cf6ad..a3105aff6821 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/parent.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/parent.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field from petstore_api.models.inner_dict_with_property import InnerDictWithProperty - - class Parent(BaseModel): """ Parent diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/parent_with_optional_dict.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/parent_with_optional_dict.py index 105cbeb170a0..253747b3abd7 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/parent_with_optional_dict.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/parent_with_optional_dict.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field from petstore_api.models.inner_dict_with_property import InnerDictWithProperty - - class ParentWithOptionalDict(BaseModel): """ ParentWithOptionalDict diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/pet.py index 602065a69705..e45fdc4a27d7 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/pet.py @@ -23,8 +23,6 @@ from petstore_api.models.category import Category from petstore_api.models.tag import Tag - - class Pet(BaseModel): """ Pet diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/poop_cleaning.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/poop_cleaning.py index ab2768fb575e..54dff6de1f12 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/poop_cleaning.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/poop_cleaning.py @@ -21,8 +21,6 @@ from pydantic import BaseModel, Field, StrictStr, validator - - class PoopCleaning(BaseModel): """ PoopCleaning diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/property_map.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/property_map.py index 7ab83b602fb5..9d3d06512b33 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/property_map.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/property_map.py @@ -22,8 +22,6 @@ from pydantic import BaseModel from petstore_api.models.tag import Tag - - class PropertyMap(BaseModel): """ PropertyMap diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/property_name_collision.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/property_name_collision.py index 981fdf521f65..ed45ecdf74c4 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/property_name_collision.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/property_name_collision.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr - - class PropertyNameCollision(BaseModel): """ PropertyNameCollision diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/read_only_first.py index a9e41544f759..da66589ee79c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/read_only_first.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/read_only_first.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictStr - - class ReadOnlyFirst(BaseModel): """ ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/second_ref.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/second_ref.py index 5fb8021abc3e..0c4f70eb9395 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/second_ref.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/second_ref.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictStr - - class SecondRef(BaseModel): """ SecondRef diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/self_reference_model.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/self_reference_model.py index f1f0896b5100..f7470db995e6 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/self_reference_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/self_reference_model.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictInt - - class SelfReferenceModel(BaseModel): """ SelfReferenceModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/special_model_name.py index fd3205f04ee0..43e57ff7b7bd 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/special_model_name.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/special_model_name.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt - - class SpecialModelName(BaseModel): """ SpecialModelName diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/special_name.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/special_name.py index 7e925e57cc21..f8841f7a4cce 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/special_name.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/special_name.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr, validator from petstore_api.models.category import Category - - class SpecialName(BaseModel): """ SpecialName diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/tag.py index 54a7a9ccaa4a..45605d239331 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/tag.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr - - class Tag(BaseModel): """ Tag diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/task.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/task.py index 9796812e83b8..2fb988a0a5d5 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/task.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/task.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field, StrictStr from petstore_api.models.task_activity import TaskActivity - - class Task(BaseModel): """ Used to test oneOf enums with only one string value. # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py index 62700923870b..c4904af2905c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictStr - - class TestErrorResponsesWithModel400Response(BaseModel): """ TestErrorResponsesWithModel400Response diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py index 1fa78603b753..96b5f6c58715 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictStr - - class TestErrorResponsesWithModel404Response(BaseModel): """ TestErrorResponsesWithModel404Response diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py index 1db2941a3071..a77233c5677a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr - - class TestInlineFreeformAdditionalPropertiesRequest(BaseModel): """ TestInlineFreeformAdditionalPropertiesRequest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/tiger.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/tiger.py index 2e57342d5c3c..88b2f3c6a04f 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/tiger.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/tiger.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, StrictStr - - class Tiger(BaseModel): """ Tiger diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py index 23519f92f8bb..d948e70725f2 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field, conlist from petstore_api.models.creature_info import CreatureInfo - - class UnnamedDictWithAdditionalModelListProperties(BaseModel): """ UnnamedDictWithAdditionalModelListProperties diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py index ea0975f38eb8..df1dcd41074c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py @@ -21,8 +21,6 @@ from typing import Dict, List, Optional from pydantic import BaseModel, Field, StrictStr, conlist - - class UnnamedDictWithAdditionalStringListProperties(BaseModel): """ UnnamedDictWithAdditionalStringListProperties diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/user.py index 365bbb460418..5c09a897c702 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/user.py @@ -21,8 +21,6 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr - - class User(BaseModel): """ User diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/with_nested_one_of.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/with_nested_one_of.py index f7dfa263fd16..0268402b5f4c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/with_nested_one_of.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/with_nested_one_of.py @@ -23,8 +23,6 @@ from petstore_api.models.one_of_enum_string import OneOfEnumString from petstore_api.models.pig import Pig - - class WithNestedOneOf(BaseModel): """ WithNestedOneOf diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_any_type.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_any_type.py index c2ecdda3ed4e..a0f5848057e7 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_any_type.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_any_type.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr - - class AdditionalPropertiesAnyType(BaseModel): """ AdditionalPropertiesAnyType diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_class.py index 4c14f37c4878..06c924e21f91 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_class.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr - - class AdditionalPropertiesClass(BaseModel): """ AdditionalPropertiesClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_object.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_object.py index fa75397cca48..022aa9c286a1 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_object.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_object.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr - - class AdditionalPropertiesObject(BaseModel): """ AdditionalPropertiesObject diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_with_description_only.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_with_description_only.py index ea104bcf84d9..ab7281d0dc4d 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_with_description_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/additional_properties_with_description_only.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr - - class AdditionalPropertiesWithDescriptionOnly(BaseModel): """ AdditionalPropertiesWithDescriptionOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/all_of_with_single_ref.py index fb1c78b62017..f0fba0386424 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/all_of_with_single_ref.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/all_of_with_single_ref.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field, StrictStr from petstore_api.models.single_ref_type import SingleRefType - - class AllOfWithSingleRef(BaseModel): """ AllOfWithSingleRef diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/animal.py index 1f01a5a0d0ec..1c40beec4e5c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/animal.py @@ -21,14 +21,12 @@ from typing import Any, Dict, Optional, Union from pydantic import BaseModel, Field, StrictStr - from typing import TYPE_CHECKING from importlib import import_module if TYPE_CHECKING: from petstore_api.models.cat import Cat from petstore_api.models.dog import Dog - class Animal(BaseModel): """ Animal diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/api_response.py index 0ed6cbbc6bcd..6224b7b9564d 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/api_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/api_response.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictInt, StrictStr - - class ApiResponse(BaseModel): """ ApiResponse diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_array_of_model.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_array_of_model.py index bcdd11ff4fcc..0f444a85a296 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_array_of_model.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, conlist from petstore_api.models.tag import Tag - - class ArrayOfArrayOfModel(BaseModel): """ ArrayOfArrayOfModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_array_of_number_only.py index 95f528446794..45ffc93e2bbd 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_array_of_number_only.py @@ -21,8 +21,6 @@ from typing import Any, Dict, List, Optional from pydantic import BaseModel, Field, StrictFloat, conlist - - class ArrayOfArrayOfNumberOnly(BaseModel): """ ArrayOfArrayOfNumberOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_number_only.py index 64be9372e39d..ff06726b621f 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_of_number_only.py @@ -21,8 +21,6 @@ from typing import Any, Dict, List, Optional from pydantic import BaseModel, Field, StrictFloat, conlist - - class ArrayOfNumberOnly(BaseModel): """ ArrayOfNumberOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_test.py index 7dbabac4f60b..399c66702c53 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_test.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/array_test.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr, conlist from petstore_api.models.read_only_first import ReadOnlyFirst - - class ArrayTest(BaseModel): """ ArrayTest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/basque_pig.py index b77b7bbb3714..c9f6603166fb 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/basque_pig.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/basque_pig.py @@ -21,8 +21,6 @@ from typing import Any, Dict from pydantic import BaseModel, Field, StrictStr - - class BasquePig(BaseModel): """ BasquePig diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/bathing.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/bathing.py index 0b9784ef5b4c..09bb3b7a0385 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/bathing.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/bathing.py @@ -21,8 +21,6 @@ from typing import Any, Dict from pydantic import BaseModel, Field, StrictStr, validator - - class Bathing(BaseModel): """ Bathing diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/capitalization.py index fbf20e55d365..3685da0822c0 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/capitalization.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr - - class Capitalization(BaseModel): """ Capitalization diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/cat.py index 60d9869a15ef..b5dd4c4b08da 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/cat.py @@ -22,8 +22,6 @@ from pydantic import StrictBool from petstore_api.models.animal import Animal - - class Cat(Animal): """ Cat diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/category.py index f14ced0c9f39..068827c38788 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/category.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr - - class Category(BaseModel): """ Category diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/circular_reference_model.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/circular_reference_model.py index c175ee17950b..68a202082b28 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/circular_reference_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/circular_reference_model.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictInt - - class CircularReferenceModel(BaseModel): """ CircularReferenceModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/class_model.py index 9b14e369ccf3..f9464aa85629 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/class_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/class_model.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr - - class ClassModel(BaseModel): """ Model for testing model with \"_class\" property # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/client.py index d765b99d3ddb..b527c6e6aeed 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/client.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr - - class Client(BaseModel): """ Client diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/creature.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/creature.py index 2602edc83ca2..ade10d2236a1 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/creature.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/creature.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field, StrictStr from petstore_api.models.creature_info import CreatureInfo - - class Creature(BaseModel): """ Creature diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/creature_info.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/creature_info.py index 5544c8f768cd..bdc45b05b777 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/creature_info.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/creature_info.py @@ -21,8 +21,6 @@ from typing import Any, Dict from pydantic import BaseModel, Field, StrictStr - - class CreatureInfo(BaseModel): """ CreatureInfo diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/danish_pig.py index 49a1644daec2..206f58550469 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/danish_pig.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/danish_pig.py @@ -21,8 +21,6 @@ from typing import Any, Dict from pydantic import BaseModel, Field, StrictInt, StrictStr - - class DanishPig(BaseModel): """ DanishPig diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/deprecated_object.py index 899fdd3ecb61..4e9dc9ddf75e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/deprecated_object.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/deprecated_object.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr - - class DeprecatedObject(BaseModel): """ DeprecatedObject diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_sub.py index ecc06fcbfe64..271339926344 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_sub.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_sub.py @@ -22,8 +22,6 @@ from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper - - class DiscriminatorAllOfSub(DiscriminatorAllOfSuper): """ DiscriminatorAllOfSub diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_super.py index 4e262c32b09e..67bca0597edd 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_super.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/discriminator_all_of_super.py @@ -21,13 +21,11 @@ from typing import Any, Dict, Union from pydantic import BaseModel, Field, StrictStr - from typing import TYPE_CHECKING from importlib import import_module if TYPE_CHECKING: from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub - class DiscriminatorAllOfSuper(BaseModel): """ DiscriminatorAllOfSuper diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/dog.py index 6db23a2b6f5f..6317e1fe32a0 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/dog.py @@ -22,8 +22,6 @@ from pydantic import StrictStr from petstore_api.models.animal import Animal - - class Dog(Animal): """ Dog diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/dummy_model.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/dummy_model.py index 6fca11114e6b..951906fd28e5 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/dummy_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/dummy_model.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr - - class DummyModel(BaseModel): """ DummyModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_arrays.py index 0bd51d06dac0..f804f117c9b3 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_arrays.py @@ -21,8 +21,6 @@ from typing import Any, Dict, List, Optional from pydantic import BaseModel, StrictStr, conlist, validator - - class EnumArrays(BaseModel): """ EnumArrays diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_test.py index 97ad4412dc69..8a06dc2f0cf3 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_test.py @@ -25,8 +25,6 @@ from petstore_api.models.outer_enum_integer import OuterEnumInteger from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue - - class EnumTest(BaseModel): """ EnumTest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/feeding.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/feeding.py index 625f568e491a..9afe7dce1b4f 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/feeding.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/feeding.py @@ -21,8 +21,6 @@ from typing import Any, Dict from pydantic import BaseModel, Field, StrictStr, validator - - class Feeding(BaseModel): """ Feeding diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/file.py index df737218d07f..f45b5114f2c5 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/file.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr - - class File(BaseModel): """ Must be named `File` for test. # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/file_schema_test_class.py index 9e18c9b29061..efbb7d95f03d 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/file_schema_test_class.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, conlist from petstore_api.models.file import File - - class FileSchemaTestClass(BaseModel): """ FileSchemaTestClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/first_ref.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/first_ref.py index 8b5444c02c64..5a44cd22c7e6 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/first_ref.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/first_ref.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr - - class FirstRef(BaseModel): """ FirstRef diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/foo.py index a73548cfa11b..77f2ef9a359a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/foo.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr - - class Foo(BaseModel): """ Foo diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/foo_get_default_response.py index 5c42e621c742..3eb736a411e3 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/foo_get_default_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/foo_get_default_response.py @@ -22,8 +22,6 @@ from pydantic import BaseModel from petstore_api.models.foo import Foo - - class FooGetDefaultResponse(BaseModel): """ FooGetDefaultResponse diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/format_test.py index 474eaf40fa36..5363f6311963 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/format_test.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/format_test.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional, Union from pydantic import BaseModel, Field, StrictBytes, StrictInt, StrictStr, condecimal, confloat, conint, constr, validator - - class FormatTest(BaseModel): """ FormatTest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/has_only_read_only.py index df12d09a9a58..be7b0eb636b3 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/has_only_read_only.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr - - class HasOnlyReadOnly(BaseModel): """ HasOnlyReadOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/health_check_result.py index 1b0840386685..ec2c401c3631 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/health_check_result.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/health_check_result.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr - - class HealthCheckResult(BaseModel): """ Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/inner_dict_with_property.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/inner_dict_with_property.py index ca3e3eed88a6..f3a50b0851b9 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/inner_dict_with_property.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/inner_dict_with_property.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field - - class InnerDictWithProperty(BaseModel): """ InnerDictWithProperty diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/input_all_of.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/input_all_of.py index d04d17b00616..1cec578d28e9 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/input_all_of.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/input_all_of.py @@ -22,8 +22,6 @@ from pydantic import BaseModel from petstore_api.models.tag import Tag - - class InputAllOf(BaseModel): """ InputAllOf diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/list_class.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/list_class.py index 6d709a512754..5dd77934371d 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/list_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/list_class.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr - - class ListClass(BaseModel): """ ListClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/map_of_array_of_model.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/map_of_array_of_model.py index f8d0172a2be2..0f0bf902f308 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/map_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/map_of_array_of_model.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field, conlist from petstore_api.models.tag import Tag - - class MapOfArrayOfModel(BaseModel): """ MapOfArrayOfModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/map_test.py index a94d927911c8..4270158fd4d0 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/map_test.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/map_test.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictBool, StrictStr, validator - - class MapTest(BaseModel): """ MapTest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/mixed_properties_and_additional_properties_class.py index 9fa7f3dbbd5b..9345c5b2ab6b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field, StrictStr from petstore_api.models.animal import Animal - - class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): """ MixedPropertiesAndAdditionalPropertiesClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/model200_response.py index 16bf937ba522..63c69743338e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/model200_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/model200_response.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr - - class Model200Response(BaseModel): """ Model for testing model name starting with number # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/model_return.py index cb2afef99775..a7212e506b6c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/model_return.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/model_return.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt - - class ModelReturn(BaseModel): """ Model for testing reserved words # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/name.py index 92525798ca6d..180e06e24c55 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/name.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr - - class Name(BaseModel): """ Model for testing model name same as property name # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/nullable_class.py index 4383a7568bb2..578579888444 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/nullable_class.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/nullable_class.py @@ -21,8 +21,6 @@ from typing import Any, Dict, List, Optional from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, conlist - - class NullableClass(BaseModel): """ NullableClass diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/nullable_property.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/nullable_property.py index ce3bbad9371f..059cbdc577cb 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/nullable_property.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/nullable_property.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt, constr, validator - - class NullableProperty(BaseModel): """ NullableProperty diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/number_only.py index abb528336f9c..78a00af5654b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/number_only.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/number_only.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictFloat - - class NumberOnly(BaseModel): """ NumberOnly diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/object_to_test_additional_properties.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/object_to_test_additional_properties.py index 3f05026760c1..21e9a30d7dfb 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/object_to_test_additional_properties.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/object_to_test_additional_properties.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictBool - - class ObjectToTestAdditionalProperties(BaseModel): """ Minimal object # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/object_with_deprecated_fields.py index f059dc1e937c..fda4435b8be3 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/object_with_deprecated_fields.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/object_with_deprecated_fields.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field, StrictFloat, StrictStr, conlist from petstore_api.models.deprecated_object import DeprecatedObject - - class ObjectWithDeprecatedFields(BaseModel): """ ObjectWithDeprecatedFields diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/order.py index d66e09b3516a..691eb04bbb1f 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/order.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, validator - - class Order(BaseModel): """ Order diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/outer_composite.py index f46b67891e24..b453339e1c87 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/outer_composite.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/outer_composite.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictBool, StrictFloat, StrictStr - - class OuterComposite(BaseModel): """ OuterComposite diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/outer_object_with_enum_property.py index 6c0a4287a09b..a5723f0a9321 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/outer_object_with_enum_property.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/outer_object_with_enum_property.py @@ -23,8 +23,6 @@ from petstore_api.models.outer_enum import OuterEnum from petstore_api.models.outer_enum_integer import OuterEnumInteger - - class OuterObjectWithEnumProperty(BaseModel): """ OuterObjectWithEnumProperty diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/parent.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/parent.py index b6294146ae24..d597e8c4e444 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/parent.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/parent.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field from petstore_api.models.inner_dict_with_property import InnerDictWithProperty - - class Parent(BaseModel): """ Parent diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/parent_with_optional_dict.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/parent_with_optional_dict.py index f464a47ab422..fa23256f5c60 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/parent_with_optional_dict.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/parent_with_optional_dict.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field from petstore_api.models.inner_dict_with_property import InnerDictWithProperty - - class ParentWithOptionalDict(BaseModel): """ ParentWithOptionalDict diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/pet.py index 7ca45f448068..25743a7ef09a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/pet.py @@ -23,8 +23,6 @@ from petstore_api.models.category import Category from petstore_api.models.tag import Tag - - class Pet(BaseModel): """ Pet diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/poop_cleaning.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/poop_cleaning.py index 3665587dad73..5649822e4f20 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/poop_cleaning.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/poop_cleaning.py @@ -21,8 +21,6 @@ from typing import Any, Dict from pydantic import BaseModel, Field, StrictStr, validator - - class PoopCleaning(BaseModel): """ PoopCleaning diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/property_map.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/property_map.py index 4ad6be385f93..28790f7f1ef6 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/property_map.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/property_map.py @@ -22,8 +22,6 @@ from pydantic import BaseModel from petstore_api.models.tag import Tag - - class PropertyMap(BaseModel): """ PropertyMap diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/property_name_collision.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/property_name_collision.py index f61079c63614..b5314f3d63e8 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/property_name_collision.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/property_name_collision.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr - - class PropertyNameCollision(BaseModel): """ PropertyNameCollision diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/read_only_first.py index 4e32ca8dd5fe..cfaf97c7091e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/read_only_first.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/read_only_first.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr - - class ReadOnlyFirst(BaseModel): """ ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/second_ref.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/second_ref.py index a3cf2423cfb6..2f0c99ae1b90 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/second_ref.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/second_ref.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr - - class SecondRef(BaseModel): """ SecondRef diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/self_reference_model.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/self_reference_model.py index e5e44c3d85f2..55512492d8e9 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/self_reference_model.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/self_reference_model.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictInt - - class SelfReferenceModel(BaseModel): """ SelfReferenceModel diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/special_model_name.py index cba4348c46a8..1c9804d5b4ae 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/special_model_name.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/special_model_name.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt - - class SpecialModelName(BaseModel): """ SpecialModelName diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/special_name.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/special_name.py index cef62cb56fcb..51d955951d4f 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/special_name.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/special_name.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr, validator from petstore_api.models.category import Category - - class SpecialName(BaseModel): """ SpecialName diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/tag.py index 7fe6ab19dbc1..299159859552 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/tag.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictInt, StrictStr - - class Tag(BaseModel): """ Tag diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/task.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/task.py index 61ca1300aa38..3bcc9d0c3f22 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/task.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/task.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field, StrictStr from petstore_api.models.task_activity import TaskActivity - - class Task(BaseModel): """ Used to test oneOf enums with only one string value. # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_error_responses_with_model400_response.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_error_responses_with_model400_response.py index c831193d35ce..40855d008cce 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_error_responses_with_model400_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_error_responses_with_model400_response.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr - - class TestErrorResponsesWithModel400Response(BaseModel): """ TestErrorResponsesWithModel400Response diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_error_responses_with_model404_response.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_error_responses_with_model404_response.py index e623fe086e3a..77c77d903f53 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_error_responses_with_model404_response.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_error_responses_with_model404_response.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr - - class TestErrorResponsesWithModel404Response(BaseModel): """ TestErrorResponsesWithModel404Response diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_inline_freeform_additional_properties_request.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_inline_freeform_additional_properties_request.py index 09d3736299bc..c61f52a3e9e9 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_inline_freeform_additional_properties_request.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_inline_freeform_additional_properties_request.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr - - class TestInlineFreeformAdditionalPropertiesRequest(BaseModel): """ TestInlineFreeformAdditionalPropertiesRequest diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/tiger.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/tiger.py index 3f236ab6c02c..71453dcec366 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/tiger.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/tiger.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr - - class Tiger(BaseModel): """ Tiger diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py index 88876b09febe..be7bbac84d79 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py @@ -22,8 +22,6 @@ from pydantic import BaseModel, Field, conlist from petstore_api.models.creature_info import CreatureInfo - - class UnnamedDictWithAdditionalModelListProperties(BaseModel): """ UnnamedDictWithAdditionalModelListProperties diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py index d25fb0b3580e..fa1e5eec56a7 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py @@ -21,8 +21,6 @@ from typing import Any, Dict, List, Optional from pydantic import BaseModel, Field, StrictStr, conlist - - class UnnamedDictWithAdditionalStringListProperties(BaseModel): """ UnnamedDictWithAdditionalStringListProperties diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/user.py index 91eaf2c18167..365c77ceb141 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/user.py @@ -21,8 +21,6 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr - - class User(BaseModel): """ User diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/with_nested_one_of.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/with_nested_one_of.py index 59bfdd4f4f4a..8ec40c8eda1e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/with_nested_one_of.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/with_nested_one_of.py @@ -23,8 +23,6 @@ from petstore_api.models.one_of_enum_string import OneOfEnumString from petstore_api.models.pig import Pig - - class WithNestedOneOf(BaseModel): """ WithNestedOneOf 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 bca6e58ee56d..43a139dc1749 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class AdditionalPropertiesAnyType(BaseModel): """ AdditionalPropertiesAnyType 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 ef4cc497cf73..f12f7a84965d 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class AdditionalPropertiesClass(BaseModel): """ AdditionalPropertiesClass 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 d808daa02f94..03735c7429c9 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class AdditionalPropertiesObject(BaseModel): """ AdditionalPropertiesObject 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 155b23d5f65a..7e3f920ab3cb 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class AdditionalPropertiesWithDescriptionOnly(BaseModel): """ AdditionalPropertiesWithDescriptionOnly 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 8bf3fd3bb318..2be839908d10 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class AllOfWithSingleRef(BaseModel): """ AllOfWithSingleRef 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 63af1000be2d..204cabbf1e93 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py @@ -23,13 +23,11 @@ from typing import Optional, Set from typing_extensions import Self - from typing import TYPE_CHECKING if TYPE_CHECKING: from petstore_api.models.cat import Cat from petstore_api.models.dog import Dog - class Animal(BaseModel): """ Animal 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 67e503394f76..06b35e19668e 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ArrayOfArrayOfModel(BaseModel): """ ArrayOfArrayOfModel 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 d70e172bba37..94aa0ac6539f 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ArrayOfArrayOfNumberOnly(BaseModel): """ ArrayOfArrayOfNumberOnly 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 8f3f4cd2d1b8..c0da65e33234 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ArrayOfNumberOnly(BaseModel): """ ArrayOfNumberOnly 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 386e5d3bd741..2986612fad54 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 @@ -24,8 +24,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ArrayTest(BaseModel): """ ArrayTest 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 bf3862872e5f..c1c5b702f33a 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class BasquePig(BaseModel): """ BasquePig diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/bathing.py b/samples/openapi3/client/petstore/python/petstore_api/models/bathing.py index 560794f4f10f..7ea7084ae9db 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/bathing.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/bathing.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Bathing(BaseModel): """ Bathing 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 46da0b82dde1..117c5cebac02 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Capitalization(BaseModel): """ Capitalization 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 a03a0b059841..a9c79649401d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/cat.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Cat(Animal): """ Cat 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 1a62d92a4fdf..d1808eb1a976 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/category.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Category(BaseModel): """ Category 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 be60b103397d..914e011e9106 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class CircularReferenceModel(BaseModel): """ CircularReferenceModel 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 60212d240e70..6148c24ceed1 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ClassModel(BaseModel): """ Model for testing model with \"_class\" property 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 2812e46454eb..72f57b6815d7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/client.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Client(BaseModel): """ Client 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 eee77945c56d..052e533ac378 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/creature.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/creature.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Creature(BaseModel): """ Creature 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 c28192b5741f..6096bbbb5c77 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class CreatureInfo(BaseModel): """ CreatureInfo 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 cd92b8004adb..16b44763d28b 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class DanishPig(BaseModel): """ DanishPig 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 ed2151b652fd..ed9dc5912f12 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class DeprecatedObject(BaseModel): """ DeprecatedObject diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_sub.py index e050442e3f12..ec3991985da4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_sub.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_sub.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class DiscriminatorAllOfSub(DiscriminatorAllOfSuper): """ DiscriminatorAllOfSub diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_super.py b/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_super.py index cb611f06c48f..e7a27350de91 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_super.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/discriminator_all_of_super.py @@ -23,12 +23,10 @@ from typing import Optional, Set from typing_extensions import Self - from typing import TYPE_CHECKING if TYPE_CHECKING: from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub - class DiscriminatorAllOfSuper(BaseModel): """ DiscriminatorAllOfSuper 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 f65853fec8c4..c7dda299c935 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/dog.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Dog(Animal): """ Dog 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 565883ed59ab..d1211acd8253 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class DummyModel(BaseModel): """ DummyModel 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 afd04f290154..bd46be86ea60 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class EnumArrays(BaseModel): """ EnumArrays 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 6d05e69b4199..a3d6f6fc9cc4 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 @@ -26,8 +26,6 @@ from typing import Optional, Set from typing_extensions import Self - - class EnumTest(BaseModel): """ EnumTest diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/feeding.py b/samples/openapi3/client/petstore/python/petstore_api/models/feeding.py index 793f7aacb996..e09b83a21b09 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/feeding.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/feeding.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Feeding(BaseModel): """ Feeding 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 236a69315afd..ce2688c5f0cb 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/file.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class File(BaseModel): """ Must be named `File` for test. 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 22abdfaa707b..f660e0161ca7 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class FileSchemaTestClass(BaseModel): """ FileSchemaTestClass 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 6e4b2fc72503..a7c2af974d43 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class FirstRef(BaseModel): """ FirstRef 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 c43acad85fb5..24321df43c5b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/foo.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Foo(BaseModel): """ Foo 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 592c518d2cf6..d602be27708d 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class FooGetDefaultResponse(BaseModel): """ FooGetDefaultResponse 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 92309baf79c8..c2787c1586a3 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 @@ -25,8 +25,6 @@ from typing import Optional, Set from typing_extensions import Self - - class FormatTest(BaseModel): """ FormatTest 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 7ba5f4feb8b2..6e80185d9b8d 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class HasOnlyReadOnly(BaseModel): """ HasOnlyReadOnly 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 928417853716..8f6e6565fd5b 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class HealthCheckResult(BaseModel): """ Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. 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 a1f95ffe9935..e71b74e0a7db 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class InnerDictWithProperty(BaseModel): """ InnerDictWithProperty diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/input_all_of.py b/samples/openapi3/client/petstore/python/petstore_api/models/input_all_of.py index 8b39fcbd105e..13f53276e381 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/input_all_of.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/input_all_of.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class InputAllOf(BaseModel): """ InputAllOf 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 36eea919bc23..568454db1e5b 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ListClass(BaseModel): """ ListClass 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 1e69fc116273..8ff27629f5a9 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class MapOfArrayOfModel(BaseModel): """ MapOfArrayOfModel 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 c643ffa1e9ba..711379c0f16d 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class MapTest(BaseModel): """ MapTest 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 38e28890fde5..7b7506264a8e 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 @@ -24,8 +24,6 @@ from typing import Optional, Set from typing_extensions import Self - - class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): """ MixedPropertiesAndAdditionalPropertiesClass 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 f1610e43613a..08010aa12199 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Model200Response(BaseModel): """ Model for testing model name starting with number diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/model_api_response.py b/samples/openapi3/client/petstore/python/petstore_api/models/model_api_response.py index f1c9896f792c..75b120b87984 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/model_api_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/model_api_response.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ModelApiResponse(BaseModel): """ ModelApiResponse 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 a7ebf3f23fd6..4648542ef073 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ModelReturn(BaseModel): """ Model for testing reserved words 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 e2550f79c59f..acb8c1a60efe 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/name.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Name(BaseModel): """ Model for testing model name same as property name 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 7216fd172b74..1ad6d35535e0 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class NullableClass(BaseModel): """ NullableClass 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 878aa3c5ca88..b6c314ecbef8 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class NullableProperty(BaseModel): """ NullableProperty 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 76f59f88847d..5674323d5aae 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class NumberOnly(BaseModel): """ NumberOnly 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 73b5bd9e0124..8923eb7e2c33 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ObjectToTestAdditionalProperties(BaseModel): """ Minimal object 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 72478927903e..592a5e177f2a 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ObjectWithDeprecatedFields(BaseModel): """ ObjectWithDeprecatedFields 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 a14eaecefe65..19a829bd92db 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/order.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Order(BaseModel): """ Order 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 1c1c3e61ba39..727440deb47f 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class OuterComposite(BaseModel): """ OuterComposite 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 41fb230a44fc..155b41cef8ef 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 @@ -24,8 +24,6 @@ from typing import Optional, Set from typing_extensions import Self - - class OuterObjectWithEnumProperty(BaseModel): """ OuterObjectWithEnumProperty 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 c0c788b89c2f..5c9515aef8a1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/parent.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/parent.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Parent(BaseModel): """ Parent 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 ccafbcf7c482..1bff7f8a4ec4 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ParentWithOptionalDict(BaseModel): """ ParentWithOptionalDict 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 b181229762e9..eca4a98dcc9a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/pet.py @@ -25,8 +25,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Pet(BaseModel): """ Pet diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/poop_cleaning.py b/samples/openapi3/client/petstore/python/petstore_api/models/poop_cleaning.py index 766df47e2804..7d881efcd21b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/poop_cleaning.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/poop_cleaning.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class PoopCleaning(BaseModel): """ PoopCleaning diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/property_map.py b/samples/openapi3/client/petstore/python/petstore_api/models/property_map.py index 762530a1a45e..e3dcdf506f44 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/property_map.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/property_map.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class PropertyMap(BaseModel): """ PropertyMap 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 2da405957c33..65058950f28d 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class PropertyNameCollision(BaseModel): """ PropertyNameCollision 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 1b461b00d393..565612986362 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class ReadOnlyFirst(BaseModel): """ ReadOnlyFirst 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 743a6628415d..2e181890002f 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class SecondRef(BaseModel): """ SecondRef 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 52c87d48f90a..8f161da4a200 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class SelfReferenceModel(BaseModel): """ SelfReferenceModel 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 e0652cb3d598..e9d7dbb92aa3 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class SpecialModelName(BaseModel): """ SpecialModelName 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 88a9d32917e3..8ab35951c1ae 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class SpecialName(BaseModel): """ SpecialName 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 9463688e46fd..b7dde8077f27 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/tag.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Tag(BaseModel): """ Tag diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/task.py b/samples/openapi3/client/petstore/python/petstore_api/models/task.py index e0f50f91f46d..2a58ebaed92e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/task.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/task.py @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Task(BaseModel): """ Used to test oneOf enums with only one string value. diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model400_response.py b/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model400_response.py index 803299d8d60e..f6d0e496e495 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model400_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model400_response.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class TestErrorResponsesWithModel400Response(BaseModel): """ TestErrorResponsesWithModel400Response diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model404_response.py b/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model404_response.py index caf03090c97c..d9993a5c63c4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model404_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model404_response.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class TestErrorResponsesWithModel404Response(BaseModel): """ TestErrorResponsesWithModel404Response 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 1cb4ea70cdd0..2fb96a50dd78 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class TestInlineFreeformAdditionalPropertiesRequest(BaseModel): """ TestInlineFreeformAdditionalPropertiesRequest 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 5b860c231d12..56f0f8c04ab8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/tiger.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/tiger.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class Tiger(BaseModel): """ Tiger 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 57e432d936c3..6be5a7eb89c3 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 @@ -23,8 +23,6 @@ from typing import Optional, Set from typing_extensions import Self - - class UnnamedDictWithAdditionalModelListProperties(BaseModel): """ UnnamedDictWithAdditionalModelListProperties 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 f34a6202f43f..2fcd15c86f4a 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 @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class UnnamedDictWithAdditionalStringListProperties(BaseModel): """ UnnamedDictWithAdditionalStringListProperties 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 6193e5e31281..6be27943f015 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/user.py @@ -22,8 +22,6 @@ from typing import Optional, Set from typing_extensions import Self - - class User(BaseModel): """ User 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 d3a9e342ef4b..95c2da7f6295 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 @@ -24,8 +24,6 @@ from typing import Optional, Set from typing_extensions import Self - - class WithNestedOneOf(BaseModel): """ WithNestedOneOf