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 a67ccc7d47b..ffe0f96966a 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 @@ -1239,6 +1239,14 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege codegenProperties = model.vars; } + // if model_generic.mustache is used + if (model.oneOf.isEmpty() && !model.isEnum) { + if (!this.disallowAdditionalPropertiesIfNotPresent) { + typingImports.add("Dict"); + typingImports.add("Any"); + } + } + //loop through properties/schemas to set up typing, pydantic for (CodegenProperty cp : codegenProperties) { String typing = getPydanticType(cp, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, model.classname); @@ -1314,13 +1322,11 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege } } - if (!model.isEnum) { - pydanticImports.add("BaseModel"); - } - // add parent model to import if (!StringUtils.isEmpty(model.parent)) { modelImports.add(model.parent); + } else if (!model.isEnum) { + pydanticImports.add("BaseModel"); } // set enum type in extensions and update `name` in enumVars 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 bbccbf9fa10..bdb542231f1 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 @@ -20,7 +20,7 @@ import json from datetime import datetime from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import Field, StrictStr from openapi_client.models.query import Query class DataQuery(Query): 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 b4bc6a226ff..3cfd5c076d9 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 @@ -19,7 +19,7 @@ import json from typing import Optional -from pydantic import BaseModel, StrictBool +from pydantic import StrictBool from petstore_api.models.animal import Animal class Cat(Animal): 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 52df38fcdd5..6441120951e 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 @@ -19,7 +19,7 @@ import json from typing import Optional -from pydantic import BaseModel, StrictStr +from pydantic import StrictStr from petstore_api.models.animal import Animal class Dog(Animal): 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 82e55e0c621..4389a2f9ffe 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Dict, Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr class AdditionalPropertiesClass(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 4a364b413ef..811f81be2ab 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr from petstore_api.models.single_ref_type import SingleRefType 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 446dfeba435..186c6ad04d0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py @@ -19,7 +19,7 @@ import json import petstore_api.models -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr class Animal(BaseModel): 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 4b66a315d1d..c4a61fd6fef 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 @@ -18,7 +18,7 @@ import json import pprint import re # noqa: F401 -from typing import List, Optional +from typing import Any, Dict, List, Optional from pydantic import BaseModel, Field, StrictStr, ValidationError, conint, conlist, constr, validator from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field 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 3e98a0089e2..09590acddb5 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 @@ -18,7 +18,7 @@ import json import pprint import re # noqa: F401 -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from petstore_api.models.basque_pig import BasquePig from petstore_api.models.danish_pig import DanishPig diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python/petstore_api/models/api_response.py index 7c7ae29a6f2..f410ebbb483 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/api_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/api_response.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, StrictInt, StrictStr class ApiResponse(BaseModel): 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 346aacb8f60..9dd6a0bc8f6 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import List, Optional +from typing import Any, Dict, List, Optional from pydantic import BaseModel, conlist from petstore_api.models.tag import Tag 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 78fcaaf5b50..e05f4b26375 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import List, Optional +from typing import Any, Dict, List, Optional from pydantic import BaseModel, Field, StrictFloat, conlist 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 f3968f5b0b2..cd83179f39d 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import List, Optional +from typing import Any, Dict, List, Optional from pydantic import BaseModel, Field, StrictFloat, conlist 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 dcfd951e8d3..9a07810414a 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import List, Optional +from typing import Any, Dict, List, Optional from pydantic import BaseModel, StrictInt, StrictStr, conlist from petstore_api.models.read_only_first import ReadOnlyFirst 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 bdbd436295e..e889edc4ff6 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json - +from typing import Any, Dict from pydantic import BaseModel, Field, StrictStr class BasquePig(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 03532ccd4c8..fe69b1f0f11 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr 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 ec62d7beff5..adf56fe649d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/cat.py @@ -18,8 +18,8 @@ import re # noqa: F401 import json -from typing import Optional -from pydantic import BaseModel, StrictBool +from typing import Any, Dict, Optional +from pydantic import StrictBool from petstore_api.models.animal import Animal 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 17edf3573cf..f46ab43c119 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/category.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr class Category(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 381caa66407..647590a3cfb 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, StrictInt 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 7963b831455..ee9defcac8b 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr 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 5b70640f005..42e672ed484 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/client.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr class Client(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 c4c92e4d292..81dcfaa47a1 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json - +from typing import Any, Dict from pydantic import BaseModel, Field, StrictInt, StrictStr class DanishPig(BaseModel): 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 62775488383..d95f02a6880 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr class DeprecatedObject(BaseModel): 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 a3d3b960079..5d55c469e33 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/dog.py @@ -18,8 +18,8 @@ import re # noqa: F401 import json -from typing import Optional -from pydantic import BaseModel, StrictStr +from typing import Any, Dict, Optional +from pydantic import StrictStr from petstore_api.models.animal import Animal 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 31dcde4857b..40aa5456a81 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr 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 1e9f7e748a4..06e7d007f37 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import List, Optional +from typing import Any, Dict, List, Optional from pydantic import BaseModel, StrictStr, conlist, validator class EnumArrays(BaseModel): 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 49ab3671883..3a07c22505f 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, validator from petstore_api.models.outer_enum import OuterEnum from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue 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 f6c6932f005..51b5229b823 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/file.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr 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 8915c11973d..7a4c8fb3560 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import List, Optional +from typing import Any, Dict, List, Optional from pydantic import BaseModel, conlist from petstore_api.models.file import File 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 2916d18a506..bf34c82e60d 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr 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 e97ebbda9b8..4638e6b0437 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/foo.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr 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 a1400273409..e2f972c1773 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel from petstore_api.models.foo import Foo 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 c2c64089d8a..b3311591880 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json from datetime import date, datetime -from typing import Optional, Union +from typing import Any, Dict, Optional, Union from pydantic import BaseModel, Field, StrictBytes, StrictInt, StrictStr, condecimal, confloat, conint, constr, validator 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 72c07842560..e5f0ea3765c 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr 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 84caace7566..5179eb30f56 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr class HealthCheckResult(BaseModel): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/list.py b/samples/openapi3/client/petstore/python/petstore_api/models/list.py index 378f9a3f098..a97112a8d03 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/list.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/list.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr class List(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 f54b94fdbd5..d46fa49e568 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Dict, List, Optional +from typing import Any, Dict, List, Optional from pydantic import BaseModel, Field, conlist from petstore_api.models.tag import Tag 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 c28cccb50b4..a1f5970a4a2 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Dict, Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, StrictBool, StrictStr, validator 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 bbece70cf3b..8ea1cfbdf4e 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json from datetime import datetime -from typing import Dict, Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr from petstore_api.models.animal import Animal 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 0158f829fb9..c4e39940e9f 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr class Model200Response(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 b4a4d3a6c6c..7781d9bad18 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt class ModelReturn(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 5ce9d8caf1f..aa6943e9db1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/name.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr class Name(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 10e359e7df6..e7c2e0d8ee1 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt, constr, validator 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 16fa97f69e3..5570cd9fb2d 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictFloat class NumberOnly(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 3987fcd787c..30f19678a22 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import List, Optional +from typing import Any, Dict, List, Optional from pydantic import BaseModel, Field, StrictFloat, StrictStr, conlist from petstore_api.models.deprecated_object import DeprecatedObject 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 27df77588bc..b08fa6e018d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/order.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json from datetime import datetime -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, validator 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 1afabc591c2..43f0340dc9e 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, StrictBool, StrictFloat, StrictStr class OuterComposite(BaseModel): 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 de96620dd78..2efc5dc57f2 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field from petstore_api.models.outer_enum import OuterEnum from petstore_api.models.outer_enum_integer import OuterEnumInteger 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 01074916751..0d9390748c4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/parent.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/parent.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Dict, Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field from petstore_api.models.inner_dict_with_property import InnerDictWithProperty 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 53fa6f72cba..16cba1e8f3f 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Dict, Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field from petstore_api.models.inner_dict_with_property import InnerDictWithProperty 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 b13a9b1b8da..29f0ed2d9db 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/pet.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import List, Optional +from typing import Any, Dict, List, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist, validator from petstore_api.models.category import Category from petstore_api.models.tag import Tag 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 9f4cedb385c..2f11b3f31e9 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr 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 cf0814ba688..02d9dd8ea59 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr class ReadOnlyFirst(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 486f5dec934..b9576742598 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr 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 743ece5ae39..7d45857f3a9 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, StrictInt class SelfReferenceModel(BaseModel): 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 ea5cafa061c..e0eb070d952 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt 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 69c7ab7ea93..3705f3032e1 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr, validator from petstore_api.models.category import Category 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 dc39529e068..f6cf832ffad 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/tag.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, StrictInt, StrictStr class Tag(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 7046a2ce644..6be069e6563 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/user.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr 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 781c47de93a..04efa88e686 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 @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from typing import Optional +from typing import Any, Dict, Optional from pydantic import BaseModel, StrictInt from petstore_api.models.one_of_enum_string import OneOfEnumString from petstore_api.models.pig import Pig