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 a67ccc7d47b3..ffe0f96966a8 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 @@ private ModelsMap postProcessModelsMap(ModelsMap objs) { 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 @@ private ModelsMap postProcessModelsMap(ModelsMap objs) { } } - 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 bbccbf9fa106..bdb542231f1a 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 @@ 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 b4bc6a226ffd..3cfd5c076d95 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 @@ 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 52df38fcdd55..6441120951ec 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 @@ 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 82e55e0c6215..4389a2f9ffe3 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 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 4a364b413ef1..811f81be2ab6 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 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 446dfeba4355..186c6ad04d06 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 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 a48b11b59264..6771d78a1f1a 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 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 Any, List 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 909d95d4d43c..cc182a5b7e6d 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 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 7c7ae29a6f26..f410ebbb483e 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 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 346aacb8f600..9dd6a0bc8f6c 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 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 78fcaaf5b50d..e05f4b263753 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 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 f3968f5b0b2e..cd83179f39d5 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 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 dcfd951e8d35..9a07810414a0 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 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 bdbd436295ee..e889edc4ff6c 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 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 03532ccd4c8f..fe69b1f0f11b 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 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 ec62d7beff5a..adf56fe649d7 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 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 17edf3573cf0..f46ab43c1196 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 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 381caa664070..647590a3cfb3 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 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 7963b8314556..ee9defcac8bd 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 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 5b70640f0059..42e672ed484b 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 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 c4c92e4d2925..81dcfaa47a17 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 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 627754883837..d95f02a6880e 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 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 a3d3b960079f..5d55c469e33f 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 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 31dcde4857be..40aa5456a81c 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 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 1e9f7e748a47..06e7d007f37c 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 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 49ab3671883e..3a07c22505f5 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 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 f6c6932f005e..51b5229b823a 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 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 8915c11973da..7a4c8fb35608 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 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 2916d18a5066..bf34c82e60d8 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 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 e97ebbda9b80..4638e6b04374 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 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 a1400273409a..e2f972c17734 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 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 c2c64089d8aa..b33115918805 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 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 72c07842560b..e5f0ea3765c2 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 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 84caace75668..5179eb30f568 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 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 378f9a3f0985..a97112a8d037 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 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 f54b94fdbd57..d46fa49e5688 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 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 c28cccb50b44..a1f5970a4a25 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 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 bbece70cf3bb..8ea1cfbdf4e0 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 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 0158f829fb98..c4e39940e9f5 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 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 b4a4d3a6c6c9..7781d9bad18c 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 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 5ce9d8caf1f9..aa6943e9db1a 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 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 10e359e7df67..e7c2e0d8ee17 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 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 16fa97f69e36..5570cd9fb2db 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 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 3987fcd787ca..30f19678a22b 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 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 27df77588bcf..b08fa6e018dd 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 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 1afabc591c23..43f0340dc9ec 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 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 de96620dd781..2efc5dc57f2c 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 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 010749167511..0d9390748c41 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 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 53fa6f72cbac..16cba1e8f3f1 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 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 b13a9b1b8daa..29f0ed2d9db4 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 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 9f4cedb385c5..2f11b3f31e9e 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 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 cf0814ba6888..02d9dd8ea598 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 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 486f5dec934e..b9576742598a 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 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 743ece5ae39b..7d45857f3a95 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 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 ea5cafa061c4..e0eb070d952f 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 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 69c7ab7ea939..3705f3032e10 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 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 dc39529e068a..f6cf832ffad4 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 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 7046a2ce644b..6be069e65635 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 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 781c47de93a4..04efa88e6866 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 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