diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index affc72120c67..a1caa703f4d2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -442,7 +442,7 @@ public String generatePackageName(String packageName) { @Override public String generatorLanguageVersion() { - return "3.11+"; + return "3.9+"; } @Override diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 62af726c21a1..ae69d74c3138 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -14,7 +14,12 @@ from logging import FileHandler import multiprocessing {{/async}} import sys -from typing import Any, ClassVar, Dict, List, Literal, NotRequired, Optional, TypedDict, Union, Self +from typing import Any, ClassVar, Dict, List Literal, Optional, TypedDict, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import NotRequired, Self +except ImportError: + from typing_extensions import NotRequired, Self {{^async}} import urllib3 diff --git a/modules/openapi-generator/src/main/resources/python/exceptions.mustache b/modules/openapi-generator/src/main/resources/python/exceptions.mustache index b9eb827113f9..33bfdb034942 100644 --- a/modules/openapi-generator/src/main/resources/python/exceptions.mustache +++ b/modules/openapi-generator/src/main/resources/python/exceptions.mustache @@ -1,6 +1,11 @@ {{>partial_header}} -from typing import Any, Optional, Self +from typing import Any, Optional +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" diff --git a/modules/openapi-generator/src/main/resources/python/model_anyof.mustache b/modules/openapi-generator/src/main/resources/python/model_anyof.mustache index b155bb0eca9c..097a5b134ff0 100644 --- a/modules/openapi-generator/src/main/resources/python/model_anyof.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_anyof.mustache @@ -4,7 +4,12 @@ import pprint {{{.}}} {{/vendorExtensions.x-py-model-imports}} from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self {{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ANY_OF_SCHEMAS = [{{#anyOf}}"{{.}}"{{^-last}}, {{/-last}}{{/anyOf}}] diff --git a/modules/openapi-generator/src/main/resources/python/model_enum.mustache b/modules/openapi-generator/src/main/resources/python/model_enum.mustache index 5810ca17293f..e0920a8e3e6a 100644 --- a/modules/openapi-generator/src/main/resources/python/model_enum.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_enum.mustache @@ -1,7 +1,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self {{#vendorExtensions.x-py-other-imports}} {{{.}}} {{/vendorExtensions.x-py-other-imports}} 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 f5fd110903e2..169fe0cffa0f 100644 --- a/modules/openapi-generator/src/main/resources/python/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_generic.mustache @@ -9,7 +9,12 @@ import re # noqa: F401 {{#vendorExtensions.x-py-model-imports}} {{{.}}} {{/vendorExtensions.x-py-model-imports}} -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field {{#hasChildren}} diff --git a/modules/openapi-generator/src/main/resources/python/model_oneof.mustache b/modules/openapi-generator/src/main/resources/python/model_oneof.mustache index a77ea60c8cd9..c39b7e75bbd3 100644 --- a/modules/openapi-generator/src/main/resources/python/model_oneof.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_oneof.mustache @@ -4,7 +4,12 @@ import pprint {{{.}}} {{/vendorExtensions.x-py-model-imports}} from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self {{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ONE_OF_SCHEMAS = [{{#oneOf}}"{{.}}"{{^-last}}, {{/-last}}{{/oneOf}}] diff --git a/modules/openapi-generator/src/main/resources/python/pyproject.mustache b/modules/openapi-generator/src/main/resources/python/pyproject.mustache index 547e7648a12b..6602af4a5c4e 100644 --- a/modules/openapi-generator/src/main/resources/python/pyproject.mustache +++ b/modules/openapi-generator/src/main/resources/python/pyproject.mustache @@ -32,7 +32,7 @@ keywords = ["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"] include = ["{{packageName}}/py.typed"] [tool.poetry.dependencies] -python = "^3.11" +python = "^3.9" urllib3 = ">= 2.1.0, < 3.0.0" python-dateutil = ">= 2.8.2" {{#asyncio}} @@ -56,7 +56,7 @@ lazy-imports = ">= 1, < 2" {{/lazyImports}} {{/poetry1}} {{^poetry1}} -requires-python = ">=3.11" +requires-python = ">=3.9" dependencies = [ "urllib3 (>=2.1.0,<3.0.0)", diff --git a/modules/openapi-generator/src/main/resources/python/setup.mustache b/modules/openapi-generator/src/main/resources/python/setup.mustache index 998ae2e29b50..614a907e5197 100644 --- a/modules/openapi-generator/src/main/resources/python/setup.mustache +++ b/modules/openapi-generator/src/main/resources/python/setup.mustache @@ -11,7 +11,7 @@ from setuptools import setup, find_packages # noqa: H301 # http://pypi.python.org/pypi/setuptools NAME = "{{{projectName}}}" VERSION = "{{packageVersion}}" -PYTHON_REQUIRES = ">= 3.11" +PYTHON_REQUIRES = ">= 3.9" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0", "python-dateutil >= 2.8.2", diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py index dd3d712a41df..a43f82fc576d 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py @@ -19,7 +19,12 @@ from logging import FileHandler import multiprocessing import sys -from typing import Any, ClassVar, Dict, List, Literal, NotRequired, Optional, TypedDict, Union, Self +from typing import Any, ClassVar, Dict, List Literal, Optional, TypedDict, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import NotRequired, Self +except ImportError: + from typing_extensions import NotRequired, Self import urllib3 diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/exceptions.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/exceptions.py index 0ae1b3ff81f7..56ddebc891a5 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/exceptions.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/exceptions.py @@ -11,7 +11,12 @@ """ # noqa: E501 -from typing import Any, Optional, Self +from typing import Any, Optional +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" 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 d7aa5e622c27..c18d3eb9dfd7 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Bird(BaseModel): 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 04e1ec165a93..973750428298 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Category(BaseModel): 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 52bce5955cde..6658f9691359 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 @@ -22,7 +22,12 @@ from pydantic import ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from openapi_client.models.query import Query -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DataQuery(Query): 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 9ffa17b813a4..d018b8927a6d 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 @@ -21,7 +21,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from openapi_client.models.string_enum_ref import StringEnumRef -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DefaultValue(BaseModel): 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 23c1a9b7efcc..d35647cbc4f5 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 @@ -21,7 +21,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt from typing import Any, ClassVar, Dict, List, Optional, Union from typing_extensions import Annotated -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class NumberPropertiesOnly(BaseModel): 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 4c95711c9dcb..5a51a7246ffb 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 @@ -22,7 +22,12 @@ from typing import Any, ClassVar, Dict, List, Optional from openapi_client.models.category import Category from openapi_client.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Pet(BaseModel): 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 48eb8cde3a27..6f9a8b33f47b 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Query(BaseModel): diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/string_enum_ref.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/string_enum_ref.py index e853e6df8b97..228652f431a7 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/string_enum_ref.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/string_enum_ref.py @@ -16,7 +16,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class StringEnumRef(StrEnum): 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 ae11ca9cebb3..905c39f0d1d2 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Tag(BaseModel): diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_form_object_multipart_request_marker.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_form_object_multipart_request_marker.py index b8f2bb979855..5401bd990d9d 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_form_object_multipart_request_marker.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_form_object_multipart_request_marker.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestFormObjectMultipartRequestMarker(BaseModel): 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 600962ca57ac..eb2a6c6201f9 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(BaseModel): 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 676d9741dee7..fb0c89eb00cc 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(BaseModel): diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/pyproject.toml b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/pyproject.toml index 5a646fca20fb..84c2c75e9f88 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/pyproject.toml +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/pyproject.toml @@ -8,7 +8,7 @@ authors = [ license = { text = "Apache 2.0" } readme = "README.md" keywords = ["OpenAPI", "OpenAPI-Generator", "Echo Server API"] -requires-python = ">=3.11" +requires-python = ">=3.9" dependencies = [ "urllib3 (>=2.1.0,<3.0.0)", diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/setup.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/setup.py index e15d7d113db4..f6eb0c722565 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/setup.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/setup.py @@ -22,7 +22,7 @@ # http://pypi.python.org/pypi/setuptools NAME = "openapi-client" VERSION = "1.0.0" -PYTHON_REQUIRES = ">= 3.11" +PYTHON_REQUIRES = ">= 3.9" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0", "python-dateutil >= 2.8.2", diff --git a/samples/client/echo_api/python/openapi_client/configuration.py b/samples/client/echo_api/python/openapi_client/configuration.py index dd3d712a41df..a43f82fc576d 100644 --- a/samples/client/echo_api/python/openapi_client/configuration.py +++ b/samples/client/echo_api/python/openapi_client/configuration.py @@ -19,7 +19,12 @@ from logging import FileHandler import multiprocessing import sys -from typing import Any, ClassVar, Dict, List, Literal, NotRequired, Optional, TypedDict, Union, Self +from typing import Any, ClassVar, Dict, List Literal, Optional, TypedDict, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import NotRequired, Self +except ImportError: + from typing_extensions import NotRequired, Self import urllib3 diff --git a/samples/client/echo_api/python/openapi_client/exceptions.py b/samples/client/echo_api/python/openapi_client/exceptions.py index 0ae1b3ff81f7..56ddebc891a5 100644 --- a/samples/client/echo_api/python/openapi_client/exceptions.py +++ b/samples/client/echo_api/python/openapi_client/exceptions.py @@ -11,7 +11,12 @@ """ # noqa: E501 -from typing import Any, Optional, Self +from typing import Any, Optional +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" 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 d7aa5e622c27..c18d3eb9dfd7 100644 --- a/samples/client/echo_api/python/openapi_client/models/bird.py +++ b/samples/client/echo_api/python/openapi_client/models/bird.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Bird(BaseModel): 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 04e1ec165a93..973750428298 100644 --- a/samples/client/echo_api/python/openapi_client/models/category.py +++ b/samples/client/echo_api/python/openapi_client/models/category.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Category(BaseModel): 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 52bce5955cde..6658f9691359 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 @@ -22,7 +22,12 @@ from pydantic import ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from openapi_client.models.query import Query -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DataQuery(Query): 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 9ffa17b813a4..d018b8927a6d 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 @@ -21,7 +21,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from openapi_client.models.string_enum_ref import StringEnumRef -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DefaultValue(BaseModel): 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 23c1a9b7efcc..d35647cbc4f5 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 @@ -21,7 +21,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt from typing import Any, ClassVar, Dict, List, Optional, Union from typing_extensions import Annotated -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class NumberPropertiesOnly(BaseModel): 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 4c95711c9dcb..5a51a7246ffb 100644 --- a/samples/client/echo_api/python/openapi_client/models/pet.py +++ b/samples/client/echo_api/python/openapi_client/models/pet.py @@ -22,7 +22,12 @@ from typing import Any, ClassVar, Dict, List, Optional from openapi_client.models.category import Category from openapi_client.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Pet(BaseModel): 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 48eb8cde3a27..6f9a8b33f47b 100644 --- a/samples/client/echo_api/python/openapi_client/models/query.py +++ b/samples/client/echo_api/python/openapi_client/models/query.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Query(BaseModel): diff --git a/samples/client/echo_api/python/openapi_client/models/string_enum_ref.py b/samples/client/echo_api/python/openapi_client/models/string_enum_ref.py index e853e6df8b97..228652f431a7 100644 --- a/samples/client/echo_api/python/openapi_client/models/string_enum_ref.py +++ b/samples/client/echo_api/python/openapi_client/models/string_enum_ref.py @@ -16,7 +16,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class StringEnumRef(StrEnum): 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 ae11ca9cebb3..905c39f0d1d2 100644 --- a/samples/client/echo_api/python/openapi_client/models/tag.py +++ b/samples/client/echo_api/python/openapi_client/models/tag.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Tag(BaseModel): diff --git a/samples/client/echo_api/python/openapi_client/models/test_form_object_multipart_request_marker.py b/samples/client/echo_api/python/openapi_client/models/test_form_object_multipart_request_marker.py index b8f2bb979855..5401bd990d9d 100644 --- a/samples/client/echo_api/python/openapi_client/models/test_form_object_multipart_request_marker.py +++ b/samples/client/echo_api/python/openapi_client/models/test_form_object_multipart_request_marker.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestFormObjectMultipartRequestMarker(BaseModel): 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 600962ca57ac..eb2a6c6201f9 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(BaseModel): 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 676d9741dee7..fb0c89eb00cc 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(BaseModel): diff --git a/samples/client/echo_api/python/pyproject.toml b/samples/client/echo_api/python/pyproject.toml index 5a646fca20fb..84c2c75e9f88 100644 --- a/samples/client/echo_api/python/pyproject.toml +++ b/samples/client/echo_api/python/pyproject.toml @@ -8,7 +8,7 @@ authors = [ license = { text = "Apache 2.0" } readme = "README.md" keywords = ["OpenAPI", "OpenAPI-Generator", "Echo Server API"] -requires-python = ">=3.11" +requires-python = ">=3.9" dependencies = [ "urllib3 (>=2.1.0,<3.0.0)", diff --git a/samples/client/echo_api/python/setup.py b/samples/client/echo_api/python/setup.py index e15d7d113db4..f6eb0c722565 100644 --- a/samples/client/echo_api/python/setup.py +++ b/samples/client/echo_api/python/setup.py @@ -22,7 +22,7 @@ # http://pypi.python.org/pypi/setuptools NAME = "openapi-client" VERSION = "1.0.0" -PYTHON_REQUIRES = ">= 3.11" +PYTHON_REQUIRES = ">= 3.9" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0", "python-dateutil >= 2.8.2", diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py index b136a2a6d1a7..129093dbd35b 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py @@ -18,7 +18,12 @@ import logging from logging import FileHandler import sys -from typing import Any, ClassVar, Dict, List, Literal, NotRequired, Optional, TypedDict, Union, Self +from typing import Any, ClassVar, Dict, List Literal, Optional, TypedDict, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import NotRequired, Self +except ImportError: + from typing_extensions import NotRequired, Self from petstore_api.signing import HttpSigningConfiguration diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/exceptions.py index a5d2c10c55be..4069eea7b6d4 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/exceptions.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/exceptions.py @@ -10,7 +10,12 @@ """ # noqa: E501 -from typing import Any, Optional, Self +from typing import Any, Optional +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" 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 605dbfe957ce..85df560d9f37 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AdditionalPropertiesAnyType(BaseModel): 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 2a41a569f7e6..368dc3499f1d 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AdditionalPropertiesClass(BaseModel): 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 ca9b42804ae1..4acc98cef6d8 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AdditionalPropertiesObject(BaseModel): 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 03e45fe3145e..276fe21f1876 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AdditionalPropertiesWithDescriptionOnly(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/all_of_super_model.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/all_of_super_model.py index 53350f4c99e4..15eabda3d922 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/all_of_super_model.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/all_of_super_model.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AllOfSuperModel(BaseModel): 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 c2dee95d9832..7e6a596b83df 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.single_ref_type import SingleRefType -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AllOfWithSingleRef(BaseModel): 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 73fd11d96623..8d5d174c0f37 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 @@ -20,7 +20,12 @@ from importlib import import_module from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field from typing import TYPE_CHECKING diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_color.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_color.py index 409aa313750f..e37e6f0d046e 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_color.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_color.py @@ -15,7 +15,12 @@ from __future__ import annotations import pprint from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self ANYOFCOLOR_ANY_OF_SCHEMAS = ["List[int]", "str"] diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_pig.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_pig.py index 436d2f008161..9b54902cf4f7 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_pig.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_pig.py @@ -17,7 +17,12 @@ from petstore_api.models.basque_pig import BasquePig from petstore_api.models.danish_pig import DanishPig from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self ANYOFPIG_ANY_OF_SCHEMAS = ["BasquePig", "DanishPig"] 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 fb23e31ba48c..5f82feb6e2cc 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ArrayOfArrayOfModel(BaseModel): 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 5d3f8c63e368..cc795c789425 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ArrayOfArrayOfNumberOnly(BaseModel): 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 a183ed9bd084..a3aa532ef568 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ArrayOfNumberOnly(BaseModel): 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 2763a11591cb..29dc2461a1ca 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 @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from petstore_api.models.read_only_first import ReadOnlyFirst -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ArrayTest(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/base_discriminator.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/base_discriminator.py index 40c69fc534c0..341b3038a503 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/base_discriminator.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/base_discriminator.py @@ -20,7 +20,12 @@ from importlib import import_module from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field from typing import TYPE_CHECKING 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 02893546262c..c4a0ec1b97d4 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class BasquePig(BaseModel): 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 b4cdff20a400..80db24107d70 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Bathing(BaseModel): 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 197ba2645f74..743cd99b2eef 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Capitalization(BaseModel): 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 caa43583452d..fcd75bdff2a0 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 @@ -20,7 +20,12 @@ from pydantic import ConfigDict, StrictBool from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.animal import Animal -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Cat(Animal): 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 ad71b3d86cbd..fac99d598f00 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Category(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/circular_all_of_ref.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/circular_all_of_ref.py index d0017f6127ff..7223a583ff1e 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/circular_all_of_ref.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/circular_all_of_ref.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class CircularAllOfRef(BaseModel): 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 7712ab85ce5f..99c83abfac01 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class CircularReferenceModel(BaseModel): 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 421e5a89b18e..400461e02968 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ClassModel(BaseModel): 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 e642a5133b64..8c63c47da726 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Client(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/color.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/color.py index 090044e9000b..ec7cc5950048 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/color.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/color.py @@ -15,7 +15,12 @@ from __future__ import annotations import pprint from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self COLOR_ONE_OF_SCHEMAS = ["List[int]", "str"] 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 254f5c454c22..6ce833112163 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 @@ -21,7 +21,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Union from petstore_api.models.creature_info import CreatureInfo -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field from typing import TYPE_CHECKING 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 3a811b731d8a..cb5f3d2187d3 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class CreatureInfo(BaseModel): 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 4149310f3131..3a70faaccaed 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DanishPig(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/data_output_format.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/data_output_format.py index e32ebe9a5ee4..69b3c8e9c570 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/data_output_format.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/data_output_format.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class DataOutputFormat(StrEnum): 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 ae68e4769d32..61a9f5fc6cdd 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DeprecatedObject(BaseModel): 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 2c621fcb4e13..cb3672f8eef9 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 @@ -20,7 +20,12 @@ from pydantic import ConfigDict from typing import Any, ClassVar, Dict, List from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DiscriminatorAllOfSub(DiscriminatorAllOfSuper): 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 f0b57e40ee39..f0d823854f2e 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 @@ -20,7 +20,12 @@ from importlib import import_module from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Union -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field from typing import TYPE_CHECKING 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 08ca643dc764..d430cd28394d 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 @@ -20,7 +20,12 @@ from pydantic import ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.animal import Animal -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Dog(Animal): 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 6d3d680f4265..77cf3d22668d 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DummyModel(BaseModel): 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 17c81fb3b0a2..5c0c559a79b5 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class EnumArrays(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_class.py index b4e61d237db8..ebfb6a1989db 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_class.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_class.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumClass(StrEnum): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_number_vendor_ext.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_number_vendor_ext.py index 91d2161cbc6d..3cc47a403f43 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_number_vendor_ext.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_number_vendor_ext.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumNumberVendorExt(IntEnum): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_ref_with_default_value.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_ref_with_default_value.py index ce070b55a4f5..e43bd99a9026 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_ref_with_default_value.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_ref_with_default_value.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.data_output_format import DataOutputFormat -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class EnumRefWithDefaultValue(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string1.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string1.py index d6970ff8346f..e980cefe5964 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string1.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string1.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumString1(StrEnum): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string2.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string2.py index c4fc722f826a..04fd5902a901 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string2.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string2.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumString2(StrEnum): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string_vendor_ext.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string_vendor_ext.py index 175ace79326f..aead473c1c3e 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string_vendor_ext.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string_vendor_ext.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumStringVendorExt(StrEnum): 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 7de9efba5e8f..1d8071852220 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 @@ -25,7 +25,12 @@ from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue from petstore_api.models.outer_enum_integer import OuterEnumInteger from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class EnumTest(BaseModel): 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 1cdf1f930dd4..4d7607c83e85 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Feeding(BaseModel): 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 3cacded9ba8b..e09066bc7985 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class File(BaseModel): 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 1a9cab954603..7f4607d4d11e 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.file import File -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class FileSchemaTestClass(BaseModel): 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 9bd1b7617182..ef5fcf8d1101 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class FirstRef(BaseModel): 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 8046535f8f2f..d7bf4f0fe4d4 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Foo(BaseModel): 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 a47649d41882..194aede01f2b 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.foo import Foo -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class FooGetDefaultResponse(BaseModel): 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 7447228b866b..b4d75b7c3ebb 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 @@ -23,7 +23,12 @@ from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated from uuid import UUID -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class FormatTest(BaseModel): 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 413bbc9cac38..8143e6b831e0 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class HasOnlyReadOnly(BaseModel): 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 724eb3e0d4b0..9b3552b96f50 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class HealthCheckResult(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/hunting_dog.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/hunting_dog.py index b7630d871e7a..e4cfe348fa7a 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/hunting_dog.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/hunting_dog.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.creature import Creature from petstore_api.models.creature_info import CreatureInfo -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class HuntingDog(Creature): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/info.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/info.py index fbcaae5a5b4c..f5e05e503e6d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/info.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/info.py @@ -20,7 +20,12 @@ from pydantic import ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.base_discriminator import BaseDiscriminator -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Info(BaseDiscriminator): 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 b90b99c96142..106ac3338d9d 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class InnerDictWithProperty(BaseModel): 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 825e90ba62d9..12dd3cc6d878 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class InputAllOf(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/int_or_string.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/int_or_string.py index d304066f68c0..56f950d30c70 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/int_or_string.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/int_or_string.py @@ -15,7 +15,12 @@ from __future__ import annotations import pprint from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self INTORSTRING_ONE_OF_SCHEMAS = ["int", "str"] 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 7ed3257dff36..cb77950831e0 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ListClass(BaseModel): 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 7c4efa39b4ac..7a922a4e0d91 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class MapOfArrayOfModel(BaseModel): 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 e5fd9b76ca55..cc9bede619cb 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class MapTest(BaseModel): 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 b935392a362e..dd3070614469 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 @@ -22,7 +22,12 @@ from typing import Any, ClassVar, Dict, List, Optional from uuid import UUID from petstore_api.models.animal import Animal -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): 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 52bd5486b808..33898410ea6f 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Model200Response(BaseModel): 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 0fcbc942b627..34259444208a 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ModelApiResponse(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_field.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_field.py index f0ed8daff497..b2faf99974e9 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_field.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_field.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ModelField(BaseModel): 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 20ff47e4e20f..75a0160edae0 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ModelReturn(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/multi_arrays.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/multi_arrays.py index 02f7d3e0d3d6..eb8cffe6f8db 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/multi_arrays.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/multi_arrays.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.file import File from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class MultiArrays(BaseModel): 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 c331614e1408..23e15b2a27c4 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Name(BaseModel): 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 f1e99a04a5ba..c4db84b5d3a7 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 @@ -20,7 +20,12 @@ from datetime import date, datetime from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class NullableClass(BaseModel): 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 74e15d8784ed..7910909abf16 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class NullableProperty(BaseModel): 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 93d907a76b50..0ae8254cc09d 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class NumberOnly(BaseModel): 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 21df5548216b..291effd93c9a 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ObjectToTestAdditionalProperties(BaseModel): 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 e3f21d775e4b..87632eabe1c4 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.deprecated_object import DeprecatedObject -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ObjectWithDeprecatedFields(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/one_of_enum_string.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/one_of_enum_string.py index eff2055e8a61..5947fd8bb68f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/one_of_enum_string.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/one_of_enum_string.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OneOfEnumString(StrEnum): 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 91c90307eab8..4eec70bb3689 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 @@ -20,7 +20,12 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Order(BaseModel): 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 0ac7f9cb52a6..efa446ba77ac 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class OuterComposite(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum.py index ee5753ebef43..5ec677f92dc5 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OuterEnum(StrEnum): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_default_value.py index 7b013c460e2b..61bb40420506 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_default_value.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_default_value.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OuterEnumDefaultValue(StrEnum): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_integer.py index 03ee644405ed..b9c085cc6f0a 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_integer.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_integer.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OuterEnumInteger(IntEnum): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_integer_default_value.py index 55735ba9b13f..9721aad02b08 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_integer_default_value.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_integer_default_value.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OuterEnumIntegerDefaultValue(IntEnum): 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 3009a8c138ee..2086db715860 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 @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.outer_enum import OuterEnum from petstore_api.models.outer_enum_integer import OuterEnumInteger -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class OuterObjectWithEnumProperty(BaseModel): 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 d53c977be0aa..726e3791b75f 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.inner_dict_with_property import InnerDictWithProperty -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Parent(BaseModel): 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 47ca1ce0dfb4..82ad666c7bce 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.inner_dict_with_property import InnerDictWithProperty -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ParentWithOptionalDict(BaseModel): 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 298f313dc77a..a7393e9aac07 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 @@ -22,7 +22,12 @@ from typing_extensions import Annotated from petstore_api.models.category import Category from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Pet(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pig.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pig.py index 72dcce5f6eda..36715ff48b88 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pig.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pig.py @@ -17,7 +17,12 @@ from petstore_api.models.basque_pig import BasquePig from petstore_api.models.danish_pig import DanishPig from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self PIG_ONE_OF_SCHEMAS = ["BasquePig", "DanishPig"] diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pony_sizes.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pony_sizes.py index db6a65f6e165..b637e2bcbc1e 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pony_sizes.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pony_sizes.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.type import Type -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PonySizes(BaseModel): 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 d959b41004de..c8cc192b751f 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PoopCleaning(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/primitive_string.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/primitive_string.py index 81ffb5b357ba..421cc1b32cb9 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/primitive_string.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/primitive_string.py @@ -20,7 +20,12 @@ from pydantic import ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.base_discriminator import BaseDiscriminator -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PrimitiveString(BaseDiscriminator): 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 00f0ed601be4..78c791c51d9e 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PropertyMap(BaseModel): 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 ebd3a4054550..997b1cbe4852 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PropertyNameCollision(BaseModel): 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 134bf1501ab1..787352f1f1b9 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ReadOnlyFirst(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/second_circular_all_of_ref.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/second_circular_all_of_ref.py index 7c3ea1020293..160f92af2556 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/second_circular_all_of_ref.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/second_circular_all_of_ref.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SecondCircularAllOfRef(BaseModel): 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 1a01c92d69e6..83eab4671e31 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SecondRef(BaseModel): 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 ea225177c35e..109519a79c2c 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SelfReferenceModel(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/single_ref_type.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/single_ref_type.py index 32b33b2271fe..7d46ffd18454 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/single_ref_type.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/single_ref_type.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class SingleRefType(StrEnum): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_character_enum.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_character_enum.py index bf8d0a25df90..bcf02d457acb 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_character_enum.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_character_enum.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class SpecialCharacterEnum(StrEnum): 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 a99d9e85968e..0e166b85b25e 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SpecialModelName(BaseModel): 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 41d0795a8ecb..9020d535a958 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.category import Category -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SpecialName(BaseModel): 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 02c6889b3456..83c168d40b93 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Tag(BaseModel): 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 006fb8512b32..fd41f02910d3 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 @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List from uuid import UUID from petstore_api.models.task_activity import TaskActivity -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Task(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/task_activity.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/task_activity.py index 8eb1262d9014..c60e9f7c3576 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/task_activity.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/task_activity.py @@ -18,7 +18,12 @@ from petstore_api.models.feeding import Feeding from petstore_api.models.poop_cleaning import PoopCleaning from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self TASKACTIVITY_ONE_OF_SCHEMAS = ["Bathing", "Feeding", "PoopCleaning"] diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_enum.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_enum.py index 331f0fd597bd..feddb5693db3 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_enum.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_enum.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class TestEnum(StrEnum): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_enum_with_default.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_enum_with_default.py index 0f3d74610b96..7d800b9bf4d3 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_enum_with_default.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_enum_with_default.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class TestEnumWithDefault(StrEnum): 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 da679c216f5f..ba4eddceed9d 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestErrorResponsesWithModel400Response(BaseModel): 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 4a179acf18bf..f7e0980aab0f 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestErrorResponsesWithModel404Response(BaseModel): 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 2b9fab3d655d..c84888abb135 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestInlineFreeformAdditionalPropertiesRequest(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_model_with_enum_default.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_model_with_enum_default.py index 37c3e7a2b0ad..b754467c085a 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_model_with_enum_default.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_model_with_enum_default.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.test_enum import TestEnum from petstore_api.models.test_enum_with_default import TestEnumWithDefault -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestModelWithEnumDefault(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_object_for_multipart_requests_request_marker.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_object_for_multipart_requests_request_marker.py index 5ee754ff793d..fb7159df131c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_object_for_multipart_requests_request_marker.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_object_for_multipart_requests_request_marker.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestObjectForMultipartRequestsRequestMarker(BaseModel): 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 e728afeac368..72373d6525d7 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Tiger(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/type.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/type.py index 3ab767b6125b..6d3f5693e7f5 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/type.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/type.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class Type(Enum): 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 d37103aeb9d1..68d64953f496 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.creature_info import CreatureInfo -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class UnnamedDictWithAdditionalModelListProperties(BaseModel): 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 0340f186acd5..c8a84e8ada0b 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class UnnamedDictWithAdditionalStringListProperties(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/upload_file_with_additional_properties_request_object.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/upload_file_with_additional_properties_request_object.py index 2478f96a284f..e6579e3773e0 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/upload_file_with_additional_properties_request_object.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/upload_file_with_additional_properties_request_object.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class UploadFileWithAdditionalPropertiesRequestObject(BaseModel): 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 7acdcb9f780c..1482cd191d21 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class User(BaseModel): 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 4f7ddb9ee72a..da7c16de93fc 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 @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.one_of_enum_string import OneOfEnumString from petstore_api.models.pig import Pig -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class WithNestedOneOf(BaseModel): diff --git a/samples/openapi3/client/petstore/python-aiohttp/pyproject.toml b/samples/openapi3/client/petstore/python-aiohttp/pyproject.toml index 767476a884d0..fbafbe1e07a2 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/pyproject.toml +++ b/samples/openapi3/client/petstore/python-aiohttp/pyproject.toml @@ -10,7 +10,7 @@ keywords = ["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"] include = ["petstore_api/py.typed"] [tool.poetry.dependencies] -python = "^3.11" +python = "^3.9" urllib3 = ">= 2.1.0, < 3.0.0" python-dateutil = ">= 2.8.2" aiohttp = ">= 3.8.4" diff --git a/samples/openapi3/client/petstore/python-aiohttp/setup.py b/samples/openapi3/client/petstore/python-aiohttp/setup.py index 986bb4a5b3af..8f4703b47f50 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/setup.py +++ b/samples/openapi3/client/petstore/python-aiohttp/setup.py @@ -21,7 +21,7 @@ # http://pypi.python.org/pypi/setuptools NAME = "petstore-api" VERSION = "1.0.0" -PYTHON_REQUIRES = ">= 3.11" +PYTHON_REQUIRES = ">= 3.9" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0", "python-dateutil >= 2.8.2", diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py index b136a2a6d1a7..129093dbd35b 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py @@ -18,7 +18,12 @@ import logging from logging import FileHandler import sys -from typing import Any, ClassVar, Dict, List, Literal, NotRequired, Optional, TypedDict, Union, Self +from typing import Any, ClassVar, Dict, List Literal, Optional, TypedDict, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import NotRequired, Self +except ImportError: + from typing_extensions import NotRequired, Self from petstore_api.signing import HttpSigningConfiguration diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/exceptions.py index a5d2c10c55be..4069eea7b6d4 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/exceptions.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/exceptions.py @@ -10,7 +10,12 @@ """ # noqa: E501 -from typing import Any, Optional, Self +from typing import Any, Optional +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_any_type.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_any_type.py index 605dbfe957ce..85df560d9f37 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_any_type.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_any_type.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AdditionalPropertiesAnyType(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_class.py index 2a41a569f7e6..368dc3499f1d 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_class.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AdditionalPropertiesClass(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_object.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_object.py index ca9b42804ae1..4acc98cef6d8 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_object.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_object.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AdditionalPropertiesObject(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_with_description_only.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_with_description_only.py index 03e45fe3145e..276fe21f1876 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_with_description_only.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/additional_properties_with_description_only.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AdditionalPropertiesWithDescriptionOnly(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/all_of_super_model.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/all_of_super_model.py index 53350f4c99e4..15eabda3d922 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/all_of_super_model.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/all_of_super_model.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AllOfSuperModel(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/all_of_with_single_ref.py index c2dee95d9832..7e6a596b83df 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/all_of_with_single_ref.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/all_of_with_single_ref.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.single_ref_type import SingleRefType -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AllOfWithSingleRef(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/animal.py index 73fd11d96623..8d5d174c0f37 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/animal.py @@ -20,7 +20,12 @@ from importlib import import_module from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field from typing import TYPE_CHECKING diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/any_of_color.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/any_of_color.py index 409aa313750f..e37e6f0d046e 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/any_of_color.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/any_of_color.py @@ -15,7 +15,12 @@ from __future__ import annotations import pprint from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self ANYOFCOLOR_ANY_OF_SCHEMAS = ["List[int]", "str"] diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/any_of_pig.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/any_of_pig.py index 436d2f008161..9b54902cf4f7 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/any_of_pig.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/any_of_pig.py @@ -17,7 +17,12 @@ from petstore_api.models.basque_pig import BasquePig from petstore_api.models.danish_pig import DanishPig from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self ANYOFPIG_ANY_OF_SCHEMAS = ["BasquePig", "DanishPig"] diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_array_of_model.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_array_of_model.py index fb23e31ba48c..5f82feb6e2cc 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_array_of_model.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ArrayOfArrayOfModel(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_array_of_number_only.py index 5d3f8c63e368..cc795c789425 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_array_of_number_only.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ArrayOfArrayOfNumberOnly(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_number_only.py index a183ed9bd084..a3aa532ef568 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_of_number_only.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ArrayOfNumberOnly(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_test.py index 2763a11591cb..29dc2461a1ca 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_test.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/array_test.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from petstore_api.models.read_only_first import ReadOnlyFirst -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ArrayTest(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/base_discriminator.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/base_discriminator.py index 40c69fc534c0..341b3038a503 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/base_discriminator.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/base_discriminator.py @@ -20,7 +20,12 @@ from importlib import import_module from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field from typing import TYPE_CHECKING diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/basque_pig.py index 02893546262c..c4a0ec1b97d4 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/basque_pig.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/basque_pig.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class BasquePig(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/bathing.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/bathing.py index b4cdff20a400..80db24107d70 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/bathing.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/bathing.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Bathing(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/capitalization.py index 197ba2645f74..743cd99b2eef 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/capitalization.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Capitalization(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/cat.py index caa43583452d..fcd75bdff2a0 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/cat.py @@ -20,7 +20,12 @@ from pydantic import ConfigDict, StrictBool from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.animal import Animal -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Cat(Animal): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/category.py index ad71b3d86cbd..fac99d598f00 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/category.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Category(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/circular_all_of_ref.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/circular_all_of_ref.py index d0017f6127ff..7223a583ff1e 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/circular_all_of_ref.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/circular_all_of_ref.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class CircularAllOfRef(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/circular_reference_model.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/circular_reference_model.py index 7712ab85ce5f..99c83abfac01 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/circular_reference_model.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/circular_reference_model.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class CircularReferenceModel(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/class_model.py index 421e5a89b18e..400461e02968 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/class_model.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/class_model.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ClassModel(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/client.py index e642a5133b64..8c63c47da726 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/client.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Client(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/color.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/color.py index 090044e9000b..ec7cc5950048 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/color.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/color.py @@ -15,7 +15,12 @@ from __future__ import annotations import pprint from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self COLOR_ONE_OF_SCHEMAS = ["List[int]", "str"] diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/creature.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/creature.py index 254f5c454c22..6ce833112163 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/creature.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/creature.py @@ -21,7 +21,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Union from petstore_api.models.creature_info import CreatureInfo -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field from typing import TYPE_CHECKING diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/creature_info.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/creature_info.py index 3a811b731d8a..cb5f3d2187d3 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/creature_info.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/creature_info.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class CreatureInfo(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/danish_pig.py index 4149310f3131..3a70faaccaed 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/danish_pig.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/danish_pig.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DanishPig(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/data_output_format.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/data_output_format.py index e32ebe9a5ee4..69b3c8e9c570 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/data_output_format.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/data_output_format.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class DataOutputFormat(StrEnum): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/deprecated_object.py index ae68e4769d32..61a9f5fc6cdd 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/deprecated_object.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/deprecated_object.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DeprecatedObject(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/discriminator_all_of_sub.py index 2c621fcb4e13..cb3672f8eef9 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/discriminator_all_of_sub.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/discriminator_all_of_sub.py @@ -20,7 +20,12 @@ from pydantic import ConfigDict from typing import Any, ClassVar, Dict, List from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DiscriminatorAllOfSub(DiscriminatorAllOfSuper): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/discriminator_all_of_super.py index f0b57e40ee39..f0d823854f2e 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/discriminator_all_of_super.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/discriminator_all_of_super.py @@ -20,7 +20,12 @@ from importlib import import_module from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Union -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field from typing import TYPE_CHECKING diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/dog.py index 08ca643dc764..d430cd28394d 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/dog.py @@ -20,7 +20,12 @@ from pydantic import ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.animal import Animal -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Dog(Animal): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/dummy_model.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/dummy_model.py index 6d3d680f4265..77cf3d22668d 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/dummy_model.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/dummy_model.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DummyModel(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_arrays.py index 17c81fb3b0a2..5c0c559a79b5 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_arrays.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class EnumArrays(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_class.py index b4e61d237db8..ebfb6a1989db 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_class.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_class.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumClass(StrEnum): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_number_vendor_ext.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_number_vendor_ext.py index 91d2161cbc6d..3cc47a403f43 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_number_vendor_ext.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_number_vendor_ext.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumNumberVendorExt(IntEnum): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_ref_with_default_value.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_ref_with_default_value.py index ce070b55a4f5..e43bd99a9026 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_ref_with_default_value.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_ref_with_default_value.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.data_output_format import DataOutputFormat -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class EnumRefWithDefaultValue(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string1.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string1.py index d6970ff8346f..e980cefe5964 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string1.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string1.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumString1(StrEnum): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string2.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string2.py index c4fc722f826a..04fd5902a901 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string2.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string2.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumString2(StrEnum): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string_vendor_ext.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string_vendor_ext.py index 175ace79326f..aead473c1c3e 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string_vendor_ext.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_string_vendor_ext.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumStringVendorExt(StrEnum): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_test.py index 7de9efba5e8f..1d8071852220 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/enum_test.py @@ -25,7 +25,12 @@ from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue from petstore_api.models.outer_enum_integer import OuterEnumInteger from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class EnumTest(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/feeding.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/feeding.py index 1cdf1f930dd4..4d7607c83e85 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/feeding.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/feeding.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Feeding(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/file.py index 3cacded9ba8b..e09066bc7985 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/file.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class File(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/file_schema_test_class.py index 1a9cab954603..7f4607d4d11e 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/file_schema_test_class.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.file import File -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class FileSchemaTestClass(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/first_ref.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/first_ref.py index 9bd1b7617182..ef5fcf8d1101 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/first_ref.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/first_ref.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class FirstRef(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/foo.py index 8046535f8f2f..d7bf4f0fe4d4 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/foo.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Foo(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/foo_get_default_response.py index a47649d41882..194aede01f2b 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/foo_get_default_response.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/foo_get_default_response.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.foo import Foo -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class FooGetDefaultResponse(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/format_test.py index 7447228b866b..b4d75b7c3ebb 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/format_test.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/format_test.py @@ -23,7 +23,12 @@ from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated from uuid import UUID -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class FormatTest(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/has_only_read_only.py index 413bbc9cac38..8143e6b831e0 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/has_only_read_only.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class HasOnlyReadOnly(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/health_check_result.py index 724eb3e0d4b0..9b3552b96f50 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/health_check_result.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/health_check_result.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class HealthCheckResult(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/hunting_dog.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/hunting_dog.py index b7630d871e7a..e4cfe348fa7a 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/hunting_dog.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/hunting_dog.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.creature import Creature from petstore_api.models.creature_info import CreatureInfo -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class HuntingDog(Creature): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/info.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/info.py index fbcaae5a5b4c..f5e05e503e6d 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/info.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/info.py @@ -20,7 +20,12 @@ from pydantic import ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.base_discriminator import BaseDiscriminator -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Info(BaseDiscriminator): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/inner_dict_with_property.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/inner_dict_with_property.py index b90b99c96142..106ac3338d9d 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/inner_dict_with_property.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/inner_dict_with_property.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class InnerDictWithProperty(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/input_all_of.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/input_all_of.py index 825e90ba62d9..12dd3cc6d878 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/input_all_of.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/input_all_of.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class InputAllOf(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/int_or_string.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/int_or_string.py index d304066f68c0..56f950d30c70 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/int_or_string.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/int_or_string.py @@ -15,7 +15,12 @@ from __future__ import annotations import pprint from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self INTORSTRING_ONE_OF_SCHEMAS = ["int", "str"] diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/list_class.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/list_class.py index 7ed3257dff36..cb77950831e0 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/list_class.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/list_class.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ListClass(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/map_of_array_of_model.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/map_of_array_of_model.py index 7c4efa39b4ac..7a922a4e0d91 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/map_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/map_of_array_of_model.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class MapOfArrayOfModel(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/map_test.py index e5fd9b76ca55..cc9bede619cb 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/map_test.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/map_test.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class MapTest(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/mixed_properties_and_additional_properties_class.py index b935392a362e..dd3070614469 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -22,7 +22,12 @@ from typing import Any, ClassVar, Dict, List, Optional from uuid import UUID from petstore_api.models.animal import Animal -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model200_response.py index 52bd5486b808..33898410ea6f 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model200_response.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model200_response.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Model200Response(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_api_response.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_api_response.py index 0fcbc942b627..34259444208a 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_api_response.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_api_response.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ModelApiResponse(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_field.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_field.py index f0ed8daff497..b2faf99974e9 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_field.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_field.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ModelField(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_return.py index 20ff47e4e20f..75a0160edae0 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_return.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/model_return.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ModelReturn(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/multi_arrays.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/multi_arrays.py index 02f7d3e0d3d6..eb8cffe6f8db 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/multi_arrays.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/multi_arrays.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.file import File from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class MultiArrays(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/name.py index c331614e1408..23e15b2a27c4 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/name.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Name(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/nullable_class.py index f1e99a04a5ba..c4db84b5d3a7 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/nullable_class.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/nullable_class.py @@ -20,7 +20,12 @@ from datetime import date, datetime from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class NullableClass(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/nullable_property.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/nullable_property.py index 74e15d8784ed..7910909abf16 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/nullable_property.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/nullable_property.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class NullableProperty(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/number_only.py index 93d907a76b50..0ae8254cc09d 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/number_only.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/number_only.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class NumberOnly(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/object_to_test_additional_properties.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/object_to_test_additional_properties.py index 21df5548216b..291effd93c9a 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/object_to_test_additional_properties.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/object_to_test_additional_properties.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ObjectToTestAdditionalProperties(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/object_with_deprecated_fields.py index e3f21d775e4b..87632eabe1c4 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/object_with_deprecated_fields.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/object_with_deprecated_fields.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.deprecated_object import DeprecatedObject -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ObjectWithDeprecatedFields(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/one_of_enum_string.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/one_of_enum_string.py index eff2055e8a61..5947fd8bb68f 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/one_of_enum_string.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/one_of_enum_string.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OneOfEnumString(StrEnum): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/order.py index 91c90307eab8..4eec70bb3689 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/order.py @@ -20,7 +20,12 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Order(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_composite.py index 0ac7f9cb52a6..efa446ba77ac 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_composite.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_composite.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class OuterComposite(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum.py index ee5753ebef43..5ec677f92dc5 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OuterEnum(StrEnum): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_default_value.py index 7b013c460e2b..61bb40420506 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_default_value.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_default_value.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OuterEnumDefaultValue(StrEnum): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_integer.py index 03ee644405ed..b9c085cc6f0a 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_integer.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_integer.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OuterEnumInteger(IntEnum): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_integer_default_value.py index 55735ba9b13f..9721aad02b08 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_integer_default_value.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_enum_integer_default_value.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OuterEnumIntegerDefaultValue(IntEnum): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_object_with_enum_property.py index 3009a8c138ee..2086db715860 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_object_with_enum_property.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/outer_object_with_enum_property.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.outer_enum import OuterEnum from petstore_api.models.outer_enum_integer import OuterEnumInteger -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class OuterObjectWithEnumProperty(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/parent.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/parent.py index d53c977be0aa..726e3791b75f 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/parent.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/parent.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.inner_dict_with_property import InnerDictWithProperty -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Parent(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/parent_with_optional_dict.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/parent_with_optional_dict.py index 47ca1ce0dfb4..82ad666c7bce 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/parent_with_optional_dict.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/parent_with_optional_dict.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.inner_dict_with_property import InnerDictWithProperty -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ParentWithOptionalDict(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pet.py index 298f313dc77a..a7393e9aac07 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pet.py @@ -22,7 +22,12 @@ from typing_extensions import Annotated from petstore_api.models.category import Category from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Pet(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pig.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pig.py index 72dcce5f6eda..36715ff48b88 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pig.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pig.py @@ -17,7 +17,12 @@ from petstore_api.models.basque_pig import BasquePig from petstore_api.models.danish_pig import DanishPig from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self PIG_ONE_OF_SCHEMAS = ["BasquePig", "DanishPig"] diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pony_sizes.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pony_sizes.py index db6a65f6e165..b637e2bcbc1e 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pony_sizes.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/pony_sizes.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.type import Type -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PonySizes(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/poop_cleaning.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/poop_cleaning.py index d959b41004de..c8cc192b751f 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/poop_cleaning.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/poop_cleaning.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PoopCleaning(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/primitive_string.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/primitive_string.py index 81ffb5b357ba..421cc1b32cb9 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/primitive_string.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/primitive_string.py @@ -20,7 +20,12 @@ from pydantic import ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.base_discriminator import BaseDiscriminator -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PrimitiveString(BaseDiscriminator): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/property_map.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/property_map.py index 00f0ed601be4..78c791c51d9e 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/property_map.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/property_map.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PropertyMap(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/property_name_collision.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/property_name_collision.py index ebd3a4054550..997b1cbe4852 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/property_name_collision.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/property_name_collision.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PropertyNameCollision(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/read_only_first.py index 134bf1501ab1..787352f1f1b9 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/read_only_first.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/read_only_first.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ReadOnlyFirst(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/second_circular_all_of_ref.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/second_circular_all_of_ref.py index 7c3ea1020293..160f92af2556 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/second_circular_all_of_ref.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/second_circular_all_of_ref.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SecondCircularAllOfRef(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/second_ref.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/second_ref.py index 1a01c92d69e6..83eab4671e31 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/second_ref.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/second_ref.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SecondRef(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/self_reference_model.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/self_reference_model.py index ea225177c35e..109519a79c2c 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/self_reference_model.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/self_reference_model.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SelfReferenceModel(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/single_ref_type.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/single_ref_type.py index 32b33b2271fe..7d46ffd18454 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/single_ref_type.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/single_ref_type.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class SingleRefType(StrEnum): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_character_enum.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_character_enum.py index bf8d0a25df90..bcf02d457acb 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_character_enum.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_character_enum.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class SpecialCharacterEnum(StrEnum): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_model_name.py index a99d9e85968e..0e166b85b25e 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_model_name.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_model_name.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SpecialModelName(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_name.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_name.py index 41d0795a8ecb..9020d535a958 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_name.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/special_name.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.category import Category -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SpecialName(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/tag.py index 02c6889b3456..83c168d40b93 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/tag.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Tag(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/task.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/task.py index 006fb8512b32..fd41f02910d3 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/task.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/task.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List from uuid import UUID from petstore_api.models.task_activity import TaskActivity -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Task(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/task_activity.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/task_activity.py index 8eb1262d9014..c60e9f7c3576 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/task_activity.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/task_activity.py @@ -18,7 +18,12 @@ from petstore_api.models.feeding import Feeding from petstore_api.models.poop_cleaning import PoopCleaning from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self TASKACTIVITY_ONE_OF_SCHEMAS = ["Bathing", "Feeding", "PoopCleaning"] diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_enum.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_enum.py index 331f0fd597bd..feddb5693db3 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_enum.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_enum.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class TestEnum(StrEnum): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_enum_with_default.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_enum_with_default.py index 0f3d74610b96..7d800b9bf4d3 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_enum_with_default.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_enum_with_default.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class TestEnumWithDefault(StrEnum): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_error_responses_with_model400_response.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_error_responses_with_model400_response.py index da679c216f5f..ba4eddceed9d 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_error_responses_with_model400_response.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_error_responses_with_model400_response.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestErrorResponsesWithModel400Response(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_error_responses_with_model404_response.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_error_responses_with_model404_response.py index 4a179acf18bf..f7e0980aab0f 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_error_responses_with_model404_response.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_error_responses_with_model404_response.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestErrorResponsesWithModel404Response(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_inline_freeform_additional_properties_request.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_inline_freeform_additional_properties_request.py index 2b9fab3d655d..c84888abb135 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_inline_freeform_additional_properties_request.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_inline_freeform_additional_properties_request.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestInlineFreeformAdditionalPropertiesRequest(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_model_with_enum_default.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_model_with_enum_default.py index 37c3e7a2b0ad..b754467c085a 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_model_with_enum_default.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_model_with_enum_default.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.test_enum import TestEnum from petstore_api.models.test_enum_with_default import TestEnumWithDefault -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestModelWithEnumDefault(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_object_for_multipart_requests_request_marker.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_object_for_multipart_requests_request_marker.py index 5ee754ff793d..fb7159df131c 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_object_for_multipart_requests_request_marker.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/test_object_for_multipart_requests_request_marker.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestObjectForMultipartRequestsRequestMarker(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/tiger.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/tiger.py index e728afeac368..72373d6525d7 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/tiger.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/tiger.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Tiger(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/type.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/type.py index 3ab767b6125b..6d3f5693e7f5 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/type.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/type.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class Type(Enum): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py index d37103aeb9d1..68d64953f496 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.creature_info import CreatureInfo -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class UnnamedDictWithAdditionalModelListProperties(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py index 0340f186acd5..c8a84e8ada0b 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class UnnamedDictWithAdditionalStringListProperties(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/upload_file_with_additional_properties_request_object.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/upload_file_with_additional_properties_request_object.py index 2478f96a284f..e6579e3773e0 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/upload_file_with_additional_properties_request_object.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/upload_file_with_additional_properties_request_object.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class UploadFileWithAdditionalPropertiesRequestObject(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/user.py index 7acdcb9f780c..1482cd191d21 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/user.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class User(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/with_nested_one_of.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/with_nested_one_of.py index 4f7ddb9ee72a..da7c16de93fc 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/models/with_nested_one_of.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/models/with_nested_one_of.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.one_of_enum_string import OneOfEnumString from petstore_api.models.pig import Pig -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class WithNestedOneOf(BaseModel): diff --git a/samples/openapi3/client/petstore/python-httpx/pyproject.toml b/samples/openapi3/client/petstore/python-httpx/pyproject.toml index a4ee37d24b50..eed3d1a1ac49 100644 --- a/samples/openapi3/client/petstore/python-httpx/pyproject.toml +++ b/samples/openapi3/client/petstore/python-httpx/pyproject.toml @@ -8,7 +8,7 @@ authors = [ license = { text = "Apache-2.0" } readme = "README.md" keywords = ["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"] -requires-python = ">=3.11" +requires-python = ">=3.9" dependencies = [ "urllib3 (>=2.1.0,<3.0.0)", diff --git a/samples/openapi3/client/petstore/python-httpx/setup.py b/samples/openapi3/client/petstore/python-httpx/setup.py index 6fcb284b3ad3..812fa06657ad 100644 --- a/samples/openapi3/client/petstore/python-httpx/setup.py +++ b/samples/openapi3/client/petstore/python-httpx/setup.py @@ -21,7 +21,7 @@ # http://pypi.python.org/pypi/setuptools NAME = "petstore-api" VERSION = "1.0.0" -PYTHON_REQUIRES = ">= 3.11" +PYTHON_REQUIRES = ">= 3.9" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0", "python-dateutil >= 2.8.2", diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py index 5a5242c4ea31..2d009246937e 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py @@ -18,7 +18,12 @@ from logging import FileHandler import multiprocessing import sys -from typing import Any, ClassVar, Dict, List, Literal, NotRequired, Optional, TypedDict, Union, Self +from typing import Any, ClassVar, Dict, List Literal, Optional, TypedDict, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import NotRequired, Self +except ImportError: + from typing_extensions import NotRequired, Self import urllib3 diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/exceptions.py index a5d2c10c55be..4069eea7b6d4 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/exceptions.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/exceptions.py @@ -10,7 +10,12 @@ """ # noqa: E501 -from typing import Any, Optional, Self +from typing import Any, Optional +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_any_type.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_any_type.py index 605dbfe957ce..85df560d9f37 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_any_type.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_any_type.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AdditionalPropertiesAnyType(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_class.py index c8e836e83b9b..b5e08aa86a4f 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_class.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AdditionalPropertiesClass(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_object.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_object.py index ca9b42804ae1..4acc98cef6d8 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_object.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_object.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AdditionalPropertiesObject(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_with_description_only.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_with_description_only.py index 03e45fe3145e..276fe21f1876 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_with_description_only.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_with_description_only.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AdditionalPropertiesWithDescriptionOnly(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/all_of_super_model.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/all_of_super_model.py index c9724286626e..8db6944f75ff 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/all_of_super_model.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/all_of_super_model.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AllOfSuperModel(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/all_of_with_single_ref.py index 96d83a781d49..120572007721 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/all_of_with_single_ref.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/all_of_with_single_ref.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.single_ref_type import SingleRefType -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AllOfWithSingleRef(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/animal.py index 17bcc87c4c70..8568510ee341 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/animal.py @@ -20,7 +20,12 @@ from importlib import import_module from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field from typing import TYPE_CHECKING diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/any_of_color.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/any_of_color.py index 409aa313750f..e37e6f0d046e 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/any_of_color.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/any_of_color.py @@ -15,7 +15,12 @@ from __future__ import annotations import pprint from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self ANYOFCOLOR_ANY_OF_SCHEMAS = ["List[int]", "str"] diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/any_of_pig.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/any_of_pig.py index 436d2f008161..9b54902cf4f7 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/any_of_pig.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/any_of_pig.py @@ -17,7 +17,12 @@ from petstore_api.models.basque_pig import BasquePig from petstore_api.models.danish_pig import DanishPig from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self ANYOFPIG_ANY_OF_SCHEMAS = ["BasquePig", "DanishPig"] diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_array_of_model.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_array_of_model.py index 0c9abb82837e..de8ba7802883 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_array_of_model.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ArrayOfArrayOfModel(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_array_of_number_only.py index fb1a13ff5df0..1e1d7f9045b0 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_array_of_number_only.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ArrayOfArrayOfNumberOnly(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_number_only.py index 4652fb95c82d..85841f097156 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_number_only.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ArrayOfNumberOnly(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_test.py index 1341fa16f859..45c6534000d4 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_test.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_test.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from petstore_api.models.read_only_first import ReadOnlyFirst -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ArrayTest(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/base_discriminator.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/base_discriminator.py index 51f5634d71f5..0f0e7cd5fb49 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/base_discriminator.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/base_discriminator.py @@ -20,7 +20,12 @@ from importlib import import_module from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field from typing import TYPE_CHECKING diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/basque_pig.py index d65730f3b7f0..c2cd8dbbb1e1 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/basque_pig.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/basque_pig.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class BasquePig(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/bathing.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/bathing.py index e0d15ccedc0b..93ac4500d0fe 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/bathing.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/bathing.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Bathing(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/capitalization.py index 14146467839c..805fe4108b51 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/capitalization.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Capitalization(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/cat.py index 79737d663326..b68c93781b91 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/cat.py @@ -20,7 +20,12 @@ from pydantic import ConfigDict, StrictBool from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.animal import Animal -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Cat(Animal): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/category.py index a5a72f2fa830..1ea75403b948 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/category.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Category(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/circular_all_of_ref.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/circular_all_of_ref.py index 4af91602323d..e6f645e0a24c 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/circular_all_of_ref.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/circular_all_of_ref.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class CircularAllOfRef(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/circular_reference_model.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/circular_reference_model.py index f5b84746fe7d..892d9711402f 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/circular_reference_model.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/circular_reference_model.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class CircularReferenceModel(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/class_model.py index 2ba2c0cc5a2f..0853fb65bad8 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/class_model.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/class_model.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ClassModel(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/client.py index d77512715f81..183726d18db3 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/client.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Client(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/color.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/color.py index 090044e9000b..ec7cc5950048 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/color.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/color.py @@ -15,7 +15,12 @@ from __future__ import annotations import pprint from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self COLOR_ONE_OF_SCHEMAS = ["List[int]", "str"] diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/creature.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/creature.py index 5a4df05de344..2fc7149a5d87 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/creature.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/creature.py @@ -21,7 +21,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Union from petstore_api.models.creature_info import CreatureInfo -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field from typing import TYPE_CHECKING diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/creature_info.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/creature_info.py index 3c640faf6d77..2f4938fe02a0 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/creature_info.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/creature_info.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class CreatureInfo(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/danish_pig.py index 0479861b0089..89f884552e9f 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/danish_pig.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/danish_pig.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DanishPig(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/data_output_format.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/data_output_format.py index e32ebe9a5ee4..69b3c8e9c570 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/data_output_format.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/data_output_format.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class DataOutputFormat(StrEnum): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/deprecated_object.py index f778ca7f03f4..dd6cd83d3837 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/deprecated_object.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/deprecated_object.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DeprecatedObject(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/discriminator_all_of_sub.py index ba59592faee2..868f74dcb5c7 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/discriminator_all_of_sub.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/discriminator_all_of_sub.py @@ -20,7 +20,12 @@ from pydantic import ConfigDict from typing import Any, ClassVar, Dict, List from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DiscriminatorAllOfSub(DiscriminatorAllOfSuper): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/discriminator_all_of_super.py index 3cac28252bf3..6278ab30f2d3 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/discriminator_all_of_super.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/discriminator_all_of_super.py @@ -20,7 +20,12 @@ from importlib import import_module from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Union -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field from typing import TYPE_CHECKING diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/dog.py index 1c825e89365a..f5d54fc52e02 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/dog.py @@ -20,7 +20,12 @@ from pydantic import ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.animal import Animal -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Dog(Animal): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/dummy_model.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/dummy_model.py index 0d2f3614105c..8046e431efcc 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/dummy_model.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/dummy_model.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DummyModel(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_arrays.py index 12746c83c7db..9058e733f38d 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_arrays.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class EnumArrays(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_class.py index b4e61d237db8..ebfb6a1989db 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_class.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_class.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumClass(StrEnum): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_number_vendor_ext.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_number_vendor_ext.py index 91d2161cbc6d..3cc47a403f43 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_number_vendor_ext.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_number_vendor_ext.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumNumberVendorExt(IntEnum): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_ref_with_default_value.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_ref_with_default_value.py index 957a552e2fc5..3e449adf0e6f 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_ref_with_default_value.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_ref_with_default_value.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.data_output_format import DataOutputFormat -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class EnumRefWithDefaultValue(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string1.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string1.py index d6970ff8346f..e980cefe5964 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string1.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string1.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumString1(StrEnum): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string2.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string2.py index c4fc722f826a..04fd5902a901 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string2.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string2.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumString2(StrEnum): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string_vendor_ext.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string_vendor_ext.py index 175ace79326f..aead473c1c3e 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string_vendor_ext.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string_vendor_ext.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumStringVendorExt(StrEnum): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_test.py index b77c620e4bcb..073dedc9bdc6 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_test.py @@ -25,7 +25,12 @@ from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue from petstore_api.models.outer_enum_integer import OuterEnumInteger from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class EnumTest(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/feeding.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/feeding.py index 64142278a50b..e09011847472 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/feeding.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/feeding.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Feeding(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/file.py index f3dd8d6d43d4..eac2fc3fa75f 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/file.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class File(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/file_schema_test_class.py index 6072cd162b67..87305783132d 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/file_schema_test_class.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.file import File -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class FileSchemaTestClass(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/first_ref.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/first_ref.py index c12dba8d76ed..aa09b8fc35d1 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/first_ref.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/first_ref.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class FirstRef(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/foo.py index ec196e9ea2d3..54b789dc9898 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/foo.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Foo(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/foo_get_default_response.py index b102224ce946..57b8300cf68a 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/foo_get_default_response.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/foo_get_default_response.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.foo import Foo -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class FooGetDefaultResponse(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/format_test.py index 78cdcb46795b..0a0d3f749467 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/format_test.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/format_test.py @@ -23,7 +23,12 @@ from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated from uuid import UUID -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class FormatTest(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/has_only_read_only.py index 92d96ff14304..c257362d962c 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/has_only_read_only.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class HasOnlyReadOnly(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/health_check_result.py index 079807b36794..ee3556ed4bd9 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/health_check_result.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/health_check_result.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class HealthCheckResult(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/hunting_dog.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/hunting_dog.py index dd855c334259..ed6f42ca5e72 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/hunting_dog.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/hunting_dog.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.creature import Creature from petstore_api.models.creature_info import CreatureInfo -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class HuntingDog(Creature): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/info.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/info.py index ac665215b6b9..eb39bdbbf9b3 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/info.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/info.py @@ -20,7 +20,12 @@ from pydantic import ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.base_discriminator import BaseDiscriminator -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Info(BaseDiscriminator): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/inner_dict_with_property.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/inner_dict_with_property.py index e04313b90a30..8f9dccae1049 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/inner_dict_with_property.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/inner_dict_with_property.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class InnerDictWithProperty(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/input_all_of.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/input_all_of.py index 68d41d1161b5..6efebc64bb8e 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/input_all_of.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/input_all_of.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class InputAllOf(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/int_or_string.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/int_or_string.py index d304066f68c0..56f950d30c70 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/int_or_string.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/int_or_string.py @@ -15,7 +15,12 @@ from __future__ import annotations import pprint from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self INTORSTRING_ONE_OF_SCHEMAS = ["int", "str"] diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/list_class.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/list_class.py index a8ffddde3e7e..dbb29d6bb664 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/list_class.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/list_class.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ListClass(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/map_of_array_of_model.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/map_of_array_of_model.py index 97bdaf031b75..a126c9d91a52 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/map_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/map_of_array_of_model.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class MapOfArrayOfModel(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/map_test.py index ef7c87f5129f..46761c0c152c 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/map_test.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/map_test.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class MapTest(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/mixed_properties_and_additional_properties_class.py index 0937fd7279b2..f48e64f4d4e1 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -22,7 +22,12 @@ from typing import Any, ClassVar, Dict, List, Optional from uuid import UUID from petstore_api.models.animal import Animal -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model200_response.py index 37e2cb8437bc..0c8d37878e27 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model200_response.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model200_response.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Model200Response(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_api_response.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_api_response.py index fe0b0c205528..7f8083a2c723 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_api_response.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_api_response.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ModelApiResponse(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_field.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_field.py index 5e2648982263..ade9abbc7c5a 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_field.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_field.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ModelField(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_return.py index e55be39e9ea5..dd0b7c0543db 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_return.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_return.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ModelReturn(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/multi_arrays.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/multi_arrays.py index 609239f47642..f6a8d5f85471 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/multi_arrays.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/multi_arrays.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.file import File from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class MultiArrays(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/name.py index c20b05eb1242..789ef0f1d4a3 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/name.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Name(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/nullable_class.py index 4dd721d81d76..3a45254f66e8 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/nullable_class.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/nullable_class.py @@ -20,7 +20,12 @@ from datetime import date, datetime from pydantic import BaseModel, ConfigDict, StrictBool, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class NullableClass(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/nullable_property.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/nullable_property.py index b719c5d2fbfc..02b7aad029f2 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/nullable_property.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/nullable_property.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class NullableProperty(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/number_only.py index 6d2ad59bea24..212c773d7c2c 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/number_only.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/number_only.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class NumberOnly(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/object_to_test_additional_properties.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/object_to_test_additional_properties.py index 2c52932810c9..b7f82ceecb7f 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/object_to_test_additional_properties.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/object_to_test_additional_properties.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ObjectToTestAdditionalProperties(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/object_with_deprecated_fields.py index e717aca9f840..58177ea3b446 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/object_with_deprecated_fields.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/object_with_deprecated_fields.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictStr from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.deprecated_object import DeprecatedObject -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ObjectWithDeprecatedFields(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/one_of_enum_string.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/one_of_enum_string.py index 296305139b24..14c2747d90f2 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/one_of_enum_string.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/one_of_enum_string.py @@ -17,7 +17,12 @@ from petstore_api.models.enum_string1 import EnumString1 from petstore_api.models.enum_string2 import EnumString2 from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self ONEOFENUMSTRING_ONE_OF_SCHEMAS = ["EnumString1", "EnumString2"] diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/order.py index bedc245834de..f041cc53d7ee 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/order.py @@ -20,7 +20,12 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Order(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_composite.py index dc5c6e2ce918..3e3f8b2c937a 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_composite.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_composite.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictBool, StrictFloat, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class OuterComposite(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum.py index ee5753ebef43..5ec677f92dc5 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OuterEnum(StrEnum): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_default_value.py index 7b013c460e2b..61bb40420506 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_default_value.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_default_value.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OuterEnumDefaultValue(StrEnum): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_integer.py index 03ee644405ed..b9c085cc6f0a 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_integer.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_integer.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OuterEnumInteger(IntEnum): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_integer_default_value.py index 55735ba9b13f..9721aad02b08 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_integer_default_value.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_integer_default_value.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OuterEnumIntegerDefaultValue(IntEnum): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_object_with_enum_property.py index 9f87402e6872..e57f5bced289 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_object_with_enum_property.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_object_with_enum_property.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.outer_enum import OuterEnum from petstore_api.models.outer_enum_integer import OuterEnumInteger -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class OuterObjectWithEnumProperty(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/parent.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/parent.py index f73c90b585e8..ad733ac8da5d 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/parent.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/parent.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.inner_dict_with_property import InnerDictWithProperty -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Parent(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/parent_with_optional_dict.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/parent_with_optional_dict.py index 3c6dabd2622e..4478538d6f3d 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/parent_with_optional_dict.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/parent_with_optional_dict.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.inner_dict_with_property import InnerDictWithProperty -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ParentWithOptionalDict(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pet.py index 72b735cfc4a5..c3a7db673d05 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pet.py @@ -22,7 +22,12 @@ from typing_extensions import Annotated from petstore_api.models.category import Category from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Pet(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pig.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pig.py index 72dcce5f6eda..36715ff48b88 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pig.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pig.py @@ -17,7 +17,12 @@ from petstore_api.models.basque_pig import BasquePig from petstore_api.models.danish_pig import DanishPig from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self PIG_ONE_OF_SCHEMAS = ["BasquePig", "DanishPig"] diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pony_sizes.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pony_sizes.py index 3d8dd39f423d..dd567f0fe33a 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pony_sizes.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pony_sizes.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.type import Type -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PonySizes(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/poop_cleaning.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/poop_cleaning.py index f3ee4b1beeab..66989c9df600 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/poop_cleaning.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/poop_cleaning.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PoopCleaning(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/primitive_string.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/primitive_string.py index 73cf769c420f..fbea28277e65 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/primitive_string.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/primitive_string.py @@ -20,7 +20,12 @@ from pydantic import ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.base_discriminator import BaseDiscriminator -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PrimitiveString(BaseDiscriminator): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/property_map.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/property_map.py index 1a88be774cff..76ea44f26a87 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/property_map.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/property_map.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PropertyMap(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/property_name_collision.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/property_name_collision.py index fa03a8d6a2dc..057c7f6c1a4b 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/property_name_collision.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/property_name_collision.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PropertyNameCollision(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/read_only_first.py index 83a979697427..2cf760a02076 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/read_only_first.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/read_only_first.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ReadOnlyFirst(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/second_circular_all_of_ref.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/second_circular_all_of_ref.py index 60995a2f86e4..be7983dc2f20 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/second_circular_all_of_ref.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/second_circular_all_of_ref.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SecondCircularAllOfRef(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/second_ref.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/second_ref.py index 0f5def8cd63b..a10a60ccf21f 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/second_ref.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/second_ref.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SecondRef(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/self_reference_model.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/self_reference_model.py index c7d8d05de11e..4343e2220413 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/self_reference_model.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/self_reference_model.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SelfReferenceModel(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/single_ref_type.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/single_ref_type.py index 32b33b2271fe..7d46ffd18454 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/single_ref_type.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/single_ref_type.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class SingleRefType(StrEnum): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_character_enum.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_character_enum.py index bf8d0a25df90..bcf02d457acb 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_character_enum.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_character_enum.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class SpecialCharacterEnum(StrEnum): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_model_name.py index 415b1a3cfc70..8c015def6b52 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_model_name.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_model_name.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SpecialModelName(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_name.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_name.py index 37f1dbc0a145..8b975e1994c0 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_name.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_name.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.category import Category -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SpecialName(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/tag.py index 45ddf84f09c0..2ef47be87be6 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/tag.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Tag(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/task.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/task.py index 3facc2817f37..663316edfa32 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/task.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/task.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List from uuid import UUID from petstore_api.models.task_activity import TaskActivity -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Task(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/task_activity.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/task_activity.py index 8eb1262d9014..c60e9f7c3576 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/task_activity.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/task_activity.py @@ -18,7 +18,12 @@ from petstore_api.models.feeding import Feeding from petstore_api.models.poop_cleaning import PoopCleaning from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self TASKACTIVITY_ONE_OF_SCHEMAS = ["Bathing", "Feeding", "PoopCleaning"] diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_enum.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_enum.py index 331f0fd597bd..feddb5693db3 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_enum.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_enum.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class TestEnum(StrEnum): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_enum_with_default.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_enum_with_default.py index 0f3d74610b96..7d800b9bf4d3 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_enum_with_default.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_enum_with_default.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class TestEnumWithDefault(StrEnum): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_error_responses_with_model400_response.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_error_responses_with_model400_response.py index f044de875d5a..5fee02f6f074 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_error_responses_with_model400_response.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_error_responses_with_model400_response.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestErrorResponsesWithModel400Response(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_error_responses_with_model404_response.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_error_responses_with_model404_response.py index a2fc98ccef6b..667c21b33ee7 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_error_responses_with_model404_response.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_error_responses_with_model404_response.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestErrorResponsesWithModel404Response(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_inline_freeform_additional_properties_request.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_inline_freeform_additional_properties_request.py index 2b9fab3d655d..c84888abb135 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_inline_freeform_additional_properties_request.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_inline_freeform_additional_properties_request.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestInlineFreeformAdditionalPropertiesRequest(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_model_with_enum_default.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_model_with_enum_default.py index b88a6db05c88..11a7f8d8be53 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_model_with_enum_default.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_model_with_enum_default.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.test_enum import TestEnum from petstore_api.models.test_enum_with_default import TestEnumWithDefault -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestModelWithEnumDefault(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_object_for_multipart_requests_request_marker.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_object_for_multipart_requests_request_marker.py index 5e9aa624e3ef..b1903937130e 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_object_for_multipart_requests_request_marker.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_object_for_multipart_requests_request_marker.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestObjectForMultipartRequestsRequestMarker(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/tiger.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/tiger.py index e460c28ba072..2fa9f7b85517 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/tiger.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/tiger.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Tiger(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/type.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/type.py index 3ab767b6125b..6d3f5693e7f5 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/type.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/type.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class Type(Enum): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py index 02fa163400ac..025fbcecb0a3 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.creature_info import CreatureInfo -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class UnnamedDictWithAdditionalModelListProperties(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py index cece847fccd8..c8aa25e7e51f 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class UnnamedDictWithAdditionalStringListProperties(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/upload_file_with_additional_properties_request_object.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/upload_file_with_additional_properties_request_object.py index 90e3548352f1..9c861c822ea2 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/upload_file_with_additional_properties_request_object.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/upload_file_with_additional_properties_request_object.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class UploadFileWithAdditionalPropertiesRequestObject(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/user.py index 11c2fee0b58e..3c1d1f299a0c 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/user.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class User(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/with_nested_one_of.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/with_nested_one_of.py index b0c0c9509e18..732dcf720ecc 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/with_nested_one_of.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/with_nested_one_of.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.one_of_enum_string import OneOfEnumString from petstore_api.models.pig import Pig -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class WithNestedOneOf(BaseModel): diff --git a/samples/openapi3/client/petstore/python-lazyImports/pyproject.toml b/samples/openapi3/client/petstore/python-lazyImports/pyproject.toml index 238f4e671ac6..a466656e8b6e 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/pyproject.toml +++ b/samples/openapi3/client/petstore/python-lazyImports/pyproject.toml @@ -8,7 +8,7 @@ authors = [ license = { text = "Apache-2.0" } readme = "README.md" keywords = ["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"] -requires-python = ">=3.11" +requires-python = ">=3.9" dependencies = [ "urllib3 (>=2.1.0,<3.0.0)", diff --git a/samples/openapi3/client/petstore/python-lazyImports/setup.py b/samples/openapi3/client/petstore/python-lazyImports/setup.py index 0a454926a270..9151759e1fda 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/setup.py +++ b/samples/openapi3/client/petstore/python-lazyImports/setup.py @@ -21,7 +21,7 @@ # http://pypi.python.org/pypi/setuptools NAME = "petstore-api" VERSION = "1.0.0" -PYTHON_REQUIRES = ">= 3.11" +PYTHON_REQUIRES = ">= 3.9" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0", "python-dateutil >= 2.8.2", diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index 5a5242c4ea31..2d009246937e 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -18,7 +18,12 @@ from logging import FileHandler import multiprocessing import sys -from typing import Any, ClassVar, Dict, List, Literal, NotRequired, Optional, TypedDict, Union, Self +from typing import Any, ClassVar, Dict, List Literal, Optional, TypedDict, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import NotRequired, Self +except ImportError: + from typing_extensions import NotRequired, Self import urllib3 diff --git a/samples/openapi3/client/petstore/python/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python/petstore_api/exceptions.py index a5d2c10c55be..4069eea7b6d4 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/exceptions.py +++ b/samples/openapi3/client/petstore/python/petstore_api/exceptions.py @@ -10,7 +10,12 @@ """ # noqa: E501 -from typing import Any, Optional, Self +from typing import Any, Optional +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" 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 605dbfe957ce..85df560d9f37 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AdditionalPropertiesAnyType(BaseModel): 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 c8e836e83b9b..b5e08aa86a4f 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AdditionalPropertiesClass(BaseModel): 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 ca9b42804ae1..4acc98cef6d8 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AdditionalPropertiesObject(BaseModel): 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 03e45fe3145e..276fe21f1876 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AdditionalPropertiesWithDescriptionOnly(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/all_of_super_model.py b/samples/openapi3/client/petstore/python/petstore_api/models/all_of_super_model.py index c9724286626e..8db6944f75ff 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/all_of_super_model.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/all_of_super_model.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AllOfSuperModel(BaseModel): 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 96d83a781d49..120572007721 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.single_ref_type import SingleRefType -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class AllOfWithSingleRef(BaseModel): 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 17bcc87c4c70..8568510ee341 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py @@ -20,7 +20,12 @@ from importlib import import_module from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field from typing import TYPE_CHECKING diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/any_of_color.py b/samples/openapi3/client/petstore/python/petstore_api/models/any_of_color.py index 409aa313750f..e37e6f0d046e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/any_of_color.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/any_of_color.py @@ -15,7 +15,12 @@ from __future__ import annotations import pprint from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self ANYOFCOLOR_ANY_OF_SCHEMAS = ["List[int]", "str"] diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/any_of_pig.py b/samples/openapi3/client/petstore/python/petstore_api/models/any_of_pig.py index 436d2f008161..9b54902cf4f7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/any_of_pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/any_of_pig.py @@ -17,7 +17,12 @@ from petstore_api.models.basque_pig import BasquePig from petstore_api.models.danish_pig import DanishPig from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self ANYOFPIG_ANY_OF_SCHEMAS = ["BasquePig", "DanishPig"] 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 0c9abb82837e..de8ba7802883 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ArrayOfArrayOfModel(BaseModel): 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 fb1a13ff5df0..1e1d7f9045b0 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ArrayOfArrayOfNumberOnly(BaseModel): 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 4652fb95c82d..85841f097156 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ArrayOfNumberOnly(BaseModel): 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 1341fa16f859..45c6534000d4 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 @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from petstore_api.models.read_only_first import ReadOnlyFirst -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ArrayTest(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/base_discriminator.py b/samples/openapi3/client/petstore/python/petstore_api/models/base_discriminator.py index 51f5634d71f5..0f0e7cd5fb49 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/base_discriminator.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/base_discriminator.py @@ -20,7 +20,12 @@ from importlib import import_module from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field from typing import TYPE_CHECKING 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 d65730f3b7f0..c2cd8dbbb1e1 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class BasquePig(BaseModel): 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 e0d15ccedc0b..93ac4500d0fe 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/bathing.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/bathing.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Bathing(BaseModel): 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 14146467839c..805fe4108b51 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Capitalization(BaseModel): 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 79737d663326..b68c93781b91 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/cat.py @@ -20,7 +20,12 @@ from pydantic import ConfigDict, StrictBool from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.animal import Animal -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Cat(Animal): 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 a5a72f2fa830..1ea75403b948 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/category.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Category(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/circular_all_of_ref.py b/samples/openapi3/client/petstore/python/petstore_api/models/circular_all_of_ref.py index 4af91602323d..e6f645e0a24c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/circular_all_of_ref.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/circular_all_of_ref.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class CircularAllOfRef(BaseModel): 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 f5b84746fe7d..892d9711402f 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class CircularReferenceModel(BaseModel): 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 2ba2c0cc5a2f..0853fb65bad8 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ClassModel(BaseModel): 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 d77512715f81..183726d18db3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/client.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Client(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/color.py b/samples/openapi3/client/petstore/python/petstore_api/models/color.py index 090044e9000b..ec7cc5950048 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/color.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/color.py @@ -15,7 +15,12 @@ from __future__ import annotations import pprint from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self COLOR_ONE_OF_SCHEMAS = ["List[int]", "str"] 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 5a4df05de344..2fc7149a5d87 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/creature.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/creature.py @@ -21,7 +21,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Union from petstore_api.models.creature_info import CreatureInfo -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field from typing import TYPE_CHECKING 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 3c640faf6d77..2f4938fe02a0 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class CreatureInfo(BaseModel): 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 0479861b0089..89f884552e9f 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DanishPig(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/data_output_format.py b/samples/openapi3/client/petstore/python/petstore_api/models/data_output_format.py index e32ebe9a5ee4..69b3c8e9c570 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/data_output_format.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/data_output_format.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class DataOutputFormat(StrEnum): 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 f778ca7f03f4..dd6cd83d3837 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DeprecatedObject(BaseModel): 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 ba59592faee2..868f74dcb5c7 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 @@ -20,7 +20,12 @@ from pydantic import ConfigDict from typing import Any, ClassVar, Dict, List from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DiscriminatorAllOfSub(DiscriminatorAllOfSuper): 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 3cac28252bf3..6278ab30f2d3 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 @@ -20,7 +20,12 @@ from importlib import import_module from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Union -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field from typing import TYPE_CHECKING 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 1c825e89365a..f5d54fc52e02 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/dog.py @@ -20,7 +20,12 @@ from pydantic import ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.animal import Animal -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Dog(Animal): 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 0d2f3614105c..8046e431efcc 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class DummyModel(BaseModel): 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 12746c83c7db..9058e733f38d 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class EnumArrays(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python/petstore_api/models/enum_class.py index b4e61d237db8..ebfb6a1989db 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/enum_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/enum_class.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumClass(StrEnum): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_number_vendor_ext.py b/samples/openapi3/client/petstore/python/petstore_api/models/enum_number_vendor_ext.py index 91d2161cbc6d..3cc47a403f43 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/enum_number_vendor_ext.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/enum_number_vendor_ext.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumNumberVendorExt(IntEnum): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_ref_with_default_value.py b/samples/openapi3/client/petstore/python/petstore_api/models/enum_ref_with_default_value.py index 957a552e2fc5..3e449adf0e6f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/enum_ref_with_default_value.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/enum_ref_with_default_value.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.data_output_format import DataOutputFormat -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class EnumRefWithDefaultValue(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_string1.py b/samples/openapi3/client/petstore/python/petstore_api/models/enum_string1.py index d6970ff8346f..e980cefe5964 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/enum_string1.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/enum_string1.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumString1(StrEnum): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_string2.py b/samples/openapi3/client/petstore/python/petstore_api/models/enum_string2.py index c4fc722f826a..04fd5902a901 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/enum_string2.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/enum_string2.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumString2(StrEnum): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_string_vendor_ext.py b/samples/openapi3/client/petstore/python/petstore_api/models/enum_string_vendor_ext.py index 175ace79326f..aead473c1c3e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/enum_string_vendor_ext.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/enum_string_vendor_ext.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class EnumStringVendorExt(StrEnum): 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 b77c620e4bcb..073dedc9bdc6 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 @@ -25,7 +25,12 @@ from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue from petstore_api.models.outer_enum_integer import OuterEnumInteger from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class EnumTest(BaseModel): 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 64142278a50b..e09011847472 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/feeding.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/feeding.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Feeding(BaseModel): 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 f3dd8d6d43d4..eac2fc3fa75f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/file.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class File(BaseModel): 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 6072cd162b67..87305783132d 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.file import File -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class FileSchemaTestClass(BaseModel): 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 c12dba8d76ed..aa09b8fc35d1 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class FirstRef(BaseModel): 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 ec196e9ea2d3..54b789dc9898 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/foo.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Foo(BaseModel): 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 b102224ce946..57b8300cf68a 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.foo import Foo -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class FooGetDefaultResponse(BaseModel): 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 78cdcb46795b..0a0d3f749467 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 @@ -23,7 +23,12 @@ from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated from uuid import UUID -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class FormatTest(BaseModel): 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 92d96ff14304..c257362d962c 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class HasOnlyReadOnly(BaseModel): 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 079807b36794..ee3556ed4bd9 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class HealthCheckResult(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/hunting_dog.py b/samples/openapi3/client/petstore/python/petstore_api/models/hunting_dog.py index dd855c334259..ed6f42ca5e72 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/hunting_dog.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/hunting_dog.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.creature import Creature from petstore_api.models.creature_info import CreatureInfo -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class HuntingDog(Creature): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/info.py b/samples/openapi3/client/petstore/python/petstore_api/models/info.py index ac665215b6b9..eb39bdbbf9b3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/info.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/info.py @@ -20,7 +20,12 @@ from pydantic import ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.base_discriminator import BaseDiscriminator -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Info(BaseDiscriminator): 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 e04313b90a30..8f9dccae1049 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class InnerDictWithProperty(BaseModel): 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 68d41d1161b5..6efebc64bb8e 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class InputAllOf(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/int_or_string.py b/samples/openapi3/client/petstore/python/petstore_api/models/int_or_string.py index d304066f68c0..56f950d30c70 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/int_or_string.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/int_or_string.py @@ -15,7 +15,12 @@ from __future__ import annotations import pprint from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self INTORSTRING_ONE_OF_SCHEMAS = ["int", "str"] 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 a8ffddde3e7e..dbb29d6bb664 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ListClass(BaseModel): 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 97bdaf031b75..a126c9d91a52 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class MapOfArrayOfModel(BaseModel): 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 ef7c87f5129f..46761c0c152c 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class MapTest(BaseModel): 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 0937fd7279b2..f48e64f4d4e1 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 @@ -22,7 +22,12 @@ from typing import Any, ClassVar, Dict, List, Optional from uuid import UUID from petstore_api.models.animal import Animal -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): 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 37e2cb8437bc..0c8d37878e27 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Model200Response(BaseModel): 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 fe0b0c205528..7f8083a2c723 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ModelApiResponse(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/model_field.py b/samples/openapi3/client/petstore/python/petstore_api/models/model_field.py index 5e2648982263..ade9abbc7c5a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/model_field.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/model_field.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ModelField(BaseModel): 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 e55be39e9ea5..dd0b7c0543db 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ModelReturn(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/multi_arrays.py b/samples/openapi3/client/petstore/python/petstore_api/models/multi_arrays.py index 609239f47642..f6a8d5f85471 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/multi_arrays.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/multi_arrays.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.file import File from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class MultiArrays(BaseModel): 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 c20b05eb1242..789ef0f1d4a3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/name.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Name(BaseModel): 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 4dd721d81d76..3a45254f66e8 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 @@ -20,7 +20,12 @@ from datetime import date, datetime from pydantic import BaseModel, ConfigDict, StrictBool, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class NullableClass(BaseModel): 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 b719c5d2fbfc..02b7aad029f2 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class NullableProperty(BaseModel): 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 6d2ad59bea24..212c773d7c2c 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class NumberOnly(BaseModel): 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 2c52932810c9..b7f82ceecb7f 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ObjectToTestAdditionalProperties(BaseModel): 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 e717aca9f840..58177ea3b446 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictStr from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.deprecated_object import DeprecatedObject -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ObjectWithDeprecatedFields(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/one_of_enum_string.py b/samples/openapi3/client/petstore/python/petstore_api/models/one_of_enum_string.py index 296305139b24..14c2747d90f2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/one_of_enum_string.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/one_of_enum_string.py @@ -17,7 +17,12 @@ from petstore_api.models.enum_string1 import EnumString1 from petstore_api.models.enum_string2 import EnumString2 from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self ONEOFENUMSTRING_ONE_OF_SCHEMAS = ["EnumString1", "EnumString2"] 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 bedc245834de..f041cc53d7ee 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/order.py @@ -20,7 +20,12 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Order(BaseModel): 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 dc5c6e2ce918..3e3f8b2c937a 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictBool, StrictFloat, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class OuterComposite(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum.py index ee5753ebef43..5ec677f92dc5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OuterEnum(StrEnum): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_default_value.py index 7b013c460e2b..61bb40420506 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_default_value.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_default_value.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OuterEnumDefaultValue(StrEnum): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer.py index 03ee644405ed..b9c085cc6f0a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OuterEnumInteger(IntEnum): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer_default_value.py index 55735ba9b13f..9721aad02b08 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer_default_value.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer_default_value.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class OuterEnumIntegerDefaultValue(IntEnum): 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 9f87402e6872..e57f5bced289 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 @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.outer_enum import OuterEnum from petstore_api.models.outer_enum_integer import OuterEnumInteger -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class OuterObjectWithEnumProperty(BaseModel): 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 f73c90b585e8..ad733ac8da5d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/parent.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/parent.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.inner_dict_with_property import InnerDictWithProperty -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Parent(BaseModel): 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 3c6dabd2622e..4478538d6f3d 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.inner_dict_with_property import InnerDictWithProperty -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ParentWithOptionalDict(BaseModel): 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 72b735cfc4a5..c3a7db673d05 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/pet.py @@ -22,7 +22,12 @@ from typing_extensions import Annotated from petstore_api.models.category import Category from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Pet(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/pig.py b/samples/openapi3/client/petstore/python/petstore_api/models/pig.py index 72dcce5f6eda..36715ff48b88 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/pig.py @@ -17,7 +17,12 @@ from petstore_api.models.basque_pig import BasquePig from petstore_api.models.danish_pig import DanishPig from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self PIG_ONE_OF_SCHEMAS = ["BasquePig", "DanishPig"] diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/pony_sizes.py b/samples/openapi3/client/petstore/python/petstore_api/models/pony_sizes.py index 3d8dd39f423d..dd567f0fe33a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/pony_sizes.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/pony_sizes.py @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.type import Type -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PonySizes(BaseModel): 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 f3ee4b1beeab..66989c9df600 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PoopCleaning(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/primitive_string.py b/samples/openapi3/client/petstore/python/petstore_api/models/primitive_string.py index 73cf769c420f..fbea28277e65 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/primitive_string.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/primitive_string.py @@ -20,7 +20,12 @@ from pydantic import ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.base_discriminator import BaseDiscriminator -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PrimitiveString(BaseDiscriminator): 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 1a88be774cff..76ea44f26a87 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.tag import Tag -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PropertyMap(BaseModel): 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 fa03a8d6a2dc..057c7f6c1a4b 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class PropertyNameCollision(BaseModel): 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 83a979697427..2cf760a02076 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class ReadOnlyFirst(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/second_circular_all_of_ref.py b/samples/openapi3/client/petstore/python/petstore_api/models/second_circular_all_of_ref.py index 60995a2f86e4..be7983dc2f20 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/second_circular_all_of_ref.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/second_circular_all_of_ref.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SecondCircularAllOfRef(BaseModel): 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 0f5def8cd63b..a10a60ccf21f 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SecondRef(BaseModel): 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 c7d8d05de11e..4343e2220413 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SelfReferenceModel(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/single_ref_type.py b/samples/openapi3/client/petstore/python/petstore_api/models/single_ref_type.py index 32b33b2271fe..7d46ffd18454 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/single_ref_type.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/single_ref_type.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class SingleRefType(StrEnum): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/special_character_enum.py b/samples/openapi3/client/petstore/python/petstore_api/models/special_character_enum.py index bf8d0a25df90..bcf02d457acb 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/special_character_enum.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/special_character_enum.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class SpecialCharacterEnum(StrEnum): 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 415b1a3cfc70..8c015def6b52 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SpecialModelName(BaseModel): 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 37f1dbc0a145..8b975e1994c0 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.category import Category -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class SpecialName(BaseModel): 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 45ddf84f09c0..2ef47be87be6 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/tag.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Tag(BaseModel): 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 3facc2817f37..663316edfa32 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/task.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/task.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List from uuid import UUID from petstore_api.models.task_activity import TaskActivity -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Task(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/task_activity.py b/samples/openapi3/client/petstore/python/petstore_api/models/task_activity.py index 8eb1262d9014..c60e9f7c3576 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/task_activity.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/task_activity.py @@ -18,7 +18,12 @@ from petstore_api.models.feeding import Feeding from petstore_api.models.poop_cleaning import PoopCleaning from pydantic import Field, RootModel -from typing import Any, Dict, List, Union, Self +from typing import Any, Dict, List, Union +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self TASKACTIVITY_ONE_OF_SCHEMAS = ["Bathing", "Feeding", "PoopCleaning"] diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/test_enum.py b/samples/openapi3/client/petstore/python/petstore_api/models/test_enum.py index 331f0fd597bd..feddb5693db3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/test_enum.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/test_enum.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class TestEnum(StrEnum): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/test_enum_with_default.py b/samples/openapi3/client/petstore/python/petstore_api/models/test_enum_with_default.py index 0f3d74610b96..7d800b9bf4d3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/test_enum_with_default.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/test_enum_with_default.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class TestEnumWithDefault(StrEnum): 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 f044de875d5a..5fee02f6f074 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestErrorResponsesWithModel400Response(BaseModel): 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 a2fc98ccef6b..667c21b33ee7 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestErrorResponsesWithModel404Response(BaseModel): 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 2b9fab3d655d..c84888abb135 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestInlineFreeformAdditionalPropertiesRequest(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/test_model_with_enum_default.py b/samples/openapi3/client/petstore/python/petstore_api/models/test_model_with_enum_default.py index b88a6db05c88..11a7f8d8be53 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/test_model_with_enum_default.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/test_model_with_enum_default.py @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.test_enum import TestEnum from petstore_api.models.test_enum_with_default import TestEnumWithDefault -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestModelWithEnumDefault(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/test_object_for_multipart_requests_request_marker.py b/samples/openapi3/client/petstore/python/petstore_api/models/test_object_for_multipart_requests_request_marker.py index 5e9aa624e3ef..b1903937130e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/test_object_for_multipart_requests_request_marker.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/test_object_for_multipart_requests_request_marker.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class TestObjectForMultipartRequestsRequestMarker(BaseModel): 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 e460c28ba072..2fa9f7b85517 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/tiger.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/tiger.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class Tiger(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/type.py b/samples/openapi3/client/petstore/python/petstore_api/models/type.py index 3ab767b6125b..6d3f5693e7f5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/type.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/type.py @@ -15,7 +15,11 @@ from __future__ import annotations import json from enum import Enum, StrEnum, IntEnum -from typing import Self +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self class Type(Enum): 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 02fa163400ac..025fbcecb0a3 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 @@ -20,7 +20,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.creature_info import CreatureInfo -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class UnnamedDictWithAdditionalModelListProperties(BaseModel): 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 cece847fccd8..c8aa25e7e51f 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 @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class UnnamedDictWithAdditionalStringListProperties(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/upload_file_with_additional_properties_request_object.py b/samples/openapi3/client/petstore/python/petstore_api/models/upload_file_with_additional_properties_request_object.py index 90e3548352f1..9c861c822ea2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/upload_file_with_additional_properties_request_object.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/upload_file_with_additional_properties_request_object.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class UploadFileWithAdditionalPropertiesRequestObject(BaseModel): 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 11c2fee0b58e..3c1d1f299a0c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/user.py @@ -19,7 +19,12 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class User(BaseModel): 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 b0c0c9509e18..732dcf720ecc 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 @@ -21,7 +21,12 @@ from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.one_of_enum_string import OneOfEnumString from petstore_api.models.pig import Pig -from typing import Literal, Self +from typing import Literal +# TODO: When dropping Python 3.10 support, remove fallback +try: + from typing import Self +except ImportError: + from typing_extensions import Self from pydantic import Field class WithNestedOneOf(BaseModel): diff --git a/samples/openapi3/client/petstore/python/pyproject.toml b/samples/openapi3/client/petstore/python/pyproject.toml index a4ee37d24b50..eed3d1a1ac49 100644 --- a/samples/openapi3/client/petstore/python/pyproject.toml +++ b/samples/openapi3/client/petstore/python/pyproject.toml @@ -8,7 +8,7 @@ authors = [ license = { text = "Apache-2.0" } readme = "README.md" keywords = ["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"] -requires-python = ">=3.11" +requires-python = ">=3.9" dependencies = [ "urllib3 (>=2.1.0,<3.0.0)", diff --git a/samples/openapi3/client/petstore/python/setup.py b/samples/openapi3/client/petstore/python/setup.py index 5f62e953eef2..8c014ad79605 100755 --- a/samples/openapi3/client/petstore/python/setup.py +++ b/samples/openapi3/client/petstore/python/setup.py @@ -21,7 +21,7 @@ # http://pypi.python.org/pypi/setuptools NAME = "petstore-api" VERSION = "1.0.0" -PYTHON_REQUIRES = ">= 3.11" +PYTHON_REQUIRES = ">= 3.9" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0", "python-dateutil >= 2.8.2",