diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/model_anyof.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/model_anyof.mustache index f4687163d2..d0dbb52f33 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/model_anyof.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/model_anyof.mustache @@ -64,7 +64,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} error_messages.append(str(e)) {{/isPrimitiveType}} {{^isPrimitiveType}} - if type(v) is not {{{dataType}}}: + if not isinstance(v, {{{dataType}}}): error_messages.append(f"Error! Input type `{type(v)}` is not `{{{dataType}}}`") else: return v diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/model_generic.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/model_generic.mustache index 6402a352c8..6b3ca7a5c5 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/model_generic.mustache @@ -1,5 +1,4 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,53 +30,56 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} {{#vendorExtensions.x-regex}} @validator('{{{name}}}') - def {{{name}}}_validate_regular_expression(cls, v): + def {{{name}}}_validate_regular_expression(cls, value): + """Validates the regular expression""" {{^required}} - if v is None: - return v + if value is None: + return value {{/required}} {{#required}} {{#isNullable}} - if v is None: + if value is None: return v {{/isNullable}} {{/required}} - if not re.match(r"{{{.}}}", v{{#vendorExtensions.x-modifiers}} ,re.{{{.}}}{{/vendorExtensions.x-modifiers}}): + if not re.match(r"{{{.}}}", value{{#vendorExtensions.x-modifiers}} ,re.{{{.}}}{{/vendorExtensions.x-modifiers}}): raise ValueError(r"must validate the regular expression {{{vendorExtensions.x-pattern}}}") - return v + return value {{/vendorExtensions.x-regex}} {{#isEnum}} @validator('{{{name}}}') - def {{{name}}}_validate_enum(cls, v): + def {{{name}}}_validate_enum(cls, value): + """Validates the enum""" {{^required}} - if v is None: - return v + if value is None: + return value {{/required}} {{#required}} {{#isNullable}} - if v is None: - return v + if value is None: + return value {{/isNullable}} {{/required}} {{#isArray}} - for i in v: + for i in value: if i not in ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}): raise ValueError("each list item must be one of ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}})") {{/isArray}} {{^isArray}} - if v not in ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}): + if value not in ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}): raise ValueError("must be one of enum values ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}})") {{/isArray}} - return v + return value {{/isEnum}} {{/vars}} class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -210,7 +212,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return {{{classname}}}.parse_obj(obj) {{#disallowAdditionalPropertiesIfNotPresent}} diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/model_oneof.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/model_oneof.mustache index b65f784d1c..d0a2fc6b6c 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/model_oneof.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/model_oneof.mustache @@ -64,7 +64,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} error_messages.append(str(e)) {{/isPrimitiveType}} {{^isPrimitiveType}} - if type(v) is not {{{dataType}}}: + if not isinstance(v, {{{dataType}}}): error_messages.append(f"Error! Input type `{type(v)}` is not `{{{dataType}}}`") else: match += 1 diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/pyproject.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/pyproject.mustache index 1ab024d87f..af3b379c62 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/pyproject.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/pyproject.mustache @@ -23,7 +23,7 @@ tornado = ">=4.2,<5" pem = ">= 19.3.0" pycryptodome = ">= 3.9.0" {{/hasHttpSignatureMethods}} -pydantic = "^1.10.5" +pydantic = "^1.10.5, <2" aenum = ">=3.1.11" [tool.poetry.dev-dependencies] @@ -35,3 +35,5 @@ flake8 = ">=4.0.0" requires = ["setuptools"] build-backend = "setuptools.build_meta" +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/bird.py b/samples/client/echo_api/python-nextgen/openapi_client/models/bird.py index 2f8814af62..1b44354439 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/bird.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/bird.py @@ -14,7 +14,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class Bird(BaseModel): __properties = ["size", "color"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -62,7 +62,7 @@ class Bird(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Bird.parse_obj(obj) _obj = Bird.parse_obj({ diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/category.py b/samples/client/echo_api/python-nextgen/openapi_client/models/category.py index 20e8ef180c..5d5c520504 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/category.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/category.py @@ -14,7 +14,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class Category(BaseModel): __properties = ["id", "name"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -62,7 +62,7 @@ class Category(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Category.parse_obj(obj) _obj = Category.parse_obj({ diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/data_query.py b/samples/client/echo_api/python-nextgen/openapi_client/models/data_query.py index 500a087fe7..7d491a7aab 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/data_query.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/data_query.py @@ -14,7 +14,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -34,6 +33,7 @@ class DataQuery(Query): __properties = ["suffix", "text", "date", "id", "outcomes"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -64,7 +64,7 @@ class DataQuery(Query): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DataQuery.parse_obj(obj) _obj = DataQuery.parse_obj({ diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/data_query_all_of.py b/samples/client/echo_api/python-nextgen/openapi_client/models/data_query_all_of.py index b0fcf04d3f..9e0080d219 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/data_query_all_of.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/data_query_all_of.py @@ -14,7 +14,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -33,6 +32,7 @@ class DataQueryAllOf(BaseModel): __properties = ["suffix", "text", "date"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,7 +63,7 @@ class DataQueryAllOf(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DataQueryAllOf.parse_obj(obj) _obj = DataQueryAllOf.parse_obj({ diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/default_value.py b/samples/client/echo_api/python-nextgen/openapi_client/models/default_value.py index 5fa33c19ab..9039bbbc68 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/default_value.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/default_value.py @@ -14,7 +14,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -39,16 +38,18 @@ class DefaultValue(BaseModel): __properties = ["array_string_enum_ref_default", "array_string_enum_default", "array_string_default", "array_integer_default", "array_string", "array_string_nullable", "array_string_extension_nullable", "string_nullable"] @validator('array_string_enum_default') - def array_string_enum_default_validate_enum(cls, v): - if v is None: - return v + def array_string_enum_default_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - for i in v: + for i in value: if i not in ('success', 'failure', 'unclassified'): raise ValueError("each list item must be one of ('success', 'failure', 'unclassified')") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -94,7 +95,7 @@ class DefaultValue(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DefaultValue.parse_obj(obj) _obj = DefaultValue.parse_obj({ diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/number_properties_only.py b/samples/client/echo_api/python-nextgen/openapi_client/models/number_properties_only.py index cd83777015..4a7a717f63 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/number_properties_only.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/number_properties_only.py @@ -14,7 +14,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -33,6 +32,7 @@ class NumberPropertiesOnly(BaseModel): __properties = ["number", "float", "double"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,7 +63,7 @@ class NumberPropertiesOnly(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return NumberPropertiesOnly.parse_obj(obj) _obj = NumberPropertiesOnly.parse_obj({ diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/pet.py b/samples/client/echo_api/python-nextgen/openapi_client/models/pet.py index 1d41038d83..905002e6a1 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/pet.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/pet.py @@ -14,7 +14,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -38,15 +37,17 @@ class Pet(BaseModel): __properties = ["id", "name", "category", "photoUrls", "tags", "status"] @validator('status') - def status_validate_enum(cls, v): - if v is None: - return v + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in ('available', 'pending', 'sold'): + if value not in ('available', 'pending', 'sold'): raise ValueError("must be one of enum values ('available', 'pending', 'sold')") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -87,7 +88,7 @@ class Pet(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Pet.parse_obj(obj) _obj = Pet.parse_obj({ diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/query.py b/samples/client/echo_api/python-nextgen/openapi_client/models/query.py index 4f932a13a8..f24cd4b2af 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/query.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/query.py @@ -14,7 +14,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,16 +31,18 @@ class Query(BaseModel): __properties = ["id", "outcomes"] @validator('outcomes') - def outcomes_validate_enum(cls, v): - if v is None: - return v + def outcomes_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - for i in v: + for i in value: if i not in ('SUCCESS', 'FAILURE', 'SKIPPED'): raise ValueError("each list item must be one of ('SUCCESS', 'FAILURE', 'SKIPPED')") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/tag.py b/samples/client/echo_api/python-nextgen/openapi_client/models/tag.py index 430b70f451..b0a4598e06 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/tag.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/tag.py @@ -14,7 +14,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class Tag(BaseModel): __properties = ["id", "name"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -62,7 +62,7 @@ class Tag(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Tag.parse_obj(obj) _obj = Tag.parse_obj({ diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py b/samples/client/echo_api/python-nextgen/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py index e43c6fc5a8..11113ca0d7 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py @@ -14,7 +14,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -34,6 +33,7 @@ class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(BaseMod __properties = ["size", "color", "id", "name"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -64,7 +64,7 @@ class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(BaseMod if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.parse_obj(obj) _obj = TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.parse_obj({ diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py b/samples/client/echo_api/python-nextgen/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py index f39267b5ac..f9d2a601f2 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py @@ -14,7 +14,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(BaseModel): __properties = ["values"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.parse_obj(obj) _obj = TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.parse_obj({ diff --git a/samples/client/echo_api/python-nextgen/pyproject.toml b/samples/client/echo_api/python-nextgen/pyproject.toml index 0a22d86748..2be7cdbbec 100644 --- a/samples/client/echo_api/python-nextgen/pyproject.toml +++ b/samples/client/echo_api/python-nextgen/pyproject.toml @@ -13,7 +13,7 @@ python = "^3.7" urllib3 = ">= 1.25.3" python-dateutil = ">=2.8.2" -pydantic = "^1.10.5" +pydantic = "^1.10.5, <2" aenum = ">=3.1.11" [tool.poetry.dev-dependencies] @@ -25,3 +25,5 @@ flake8 = ">=4.0.0" requires = ["setuptools"] build-backend = "setuptools.build_meta" +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/additional_properties_class.py index 34cead3a8a..c2e07e7095 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/additional_properties_class.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class AdditionalPropertiesClass(BaseModel): __properties = ["map_property", "map_of_map_property"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ class AdditionalPropertiesClass(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return AdditionalPropertiesClass.parse_obj(obj) _obj = AdditionalPropertiesClass.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/all_of_with_single_ref.py index c6826c1a65..aeb365da90 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/all_of_with_single_ref.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/all_of_with_single_ref.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class AllOfWithSingleRef(BaseModel): __properties = ["username", "SingleRefType"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -62,7 +62,7 @@ class AllOfWithSingleRef(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return AllOfWithSingleRef.parse_obj(obj) _obj = AllOfWithSingleRef.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/animal.py index 5bdd2d9381..9279e03984 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/animal.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class Animal(BaseModel): __properties = ["className", "color"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/any_of_pig.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/any_of_pig.py index e9e97b7d40..d18b58876d 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/any_of_pig.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/any_of_pig.py @@ -47,13 +47,13 @@ class AnyOfPig(BaseModel): instance = cls() error_messages = [] # validate data type: BasquePig - if type(v) is not BasquePig: + if not isinstance(v, BasquePig): error_messages.append(f"Error! Input type `{type(v)}` is not `BasquePig`") else: return v # validate data type: DanishPig - if type(v) is not DanishPig: + if not isinstance(v, DanishPig): error_messages.append(f"Error! Input type `{type(v)}` is not `DanishPig`") else: return v diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/api_response.py index 26f3025fb3..d42d3d8657 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/api_response.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/api_response.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class ApiResponse(BaseModel): __properties = ["code", "type", "message"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -62,7 +62,7 @@ class ApiResponse(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ApiResponse.parse_obj(obj) _obj = ApiResponse.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_array_of_number_only.py index 4593b477f5..3a392f17c2 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_array_of_number_only.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -30,6 +29,7 @@ class ArrayOfArrayOfNumberOnly(BaseModel): __properties = ["ArrayArrayNumber"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -60,7 +60,7 @@ class ArrayOfArrayOfNumberOnly(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ArrayOfArrayOfNumberOnly.parse_obj(obj) _obj = ArrayOfArrayOfNumberOnly.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_number_only.py index 9a03e3150a..96fa5c93a0 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_number_only.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -30,6 +29,7 @@ class ArrayOfNumberOnly(BaseModel): __properties = ["ArrayNumber"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -60,7 +60,7 @@ class ArrayOfNumberOnly(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ArrayOfNumberOnly.parse_obj(obj) _obj = ArrayOfNumberOnly.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_test.py index 021c38893c..e6775be1c7 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_test.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_test.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -33,6 +32,7 @@ class ArrayTest(BaseModel): __properties = ["array_of_string", "array_array_of_integer", "array_array_of_model"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -70,7 +70,7 @@ class ArrayTest(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ArrayTest.parse_obj(obj) _obj = ArrayTest.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/basque_pig.py index 2c9210a9fa..9f2a647b3e 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/basque_pig.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/basque_pig.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class BasquePig(BaseModel): __properties = ["className", "color"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ class BasquePig(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return BasquePig.parse_obj(obj) _obj = BasquePig.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/capitalization.py index 64518b9944..d849bb224f 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/capitalization.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -35,6 +34,7 @@ class Capitalization(BaseModel): __properties = ["smallCamel", "CapitalCamel", "small_Snake", "Capital_Snake", "SCA_ETH_Flow_Points", "ATT_NAME"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -65,7 +65,7 @@ class Capitalization(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Capitalization.parse_obj(obj) _obj = Capitalization.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat.py index 0f1ece6854..b4bc6a226f 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class Cat(Animal): __properties = ["className", "color", "declawed"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ class Cat(Animal): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Cat.parse_obj(obj) _obj = Cat.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat_all_of.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat_all_of.py index 7fd50e5897..1d64673d4d 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat_all_of.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat_all_of.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -30,6 +29,7 @@ class CatAllOf(BaseModel): __properties = ["declawed"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -60,7 +60,7 @@ class CatAllOf(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CatAllOf.parse_obj(obj) _obj = CatAllOf.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/category.py index 311634b108..95eeff4eec 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/category.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class Category(BaseModel): __properties = ["id", "name"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ class Category(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Category.parse_obj(obj) _obj = Category.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/circular_reference_model.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/circular_reference_model.py index 3a03dad4dd..a2267f66d4 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/circular_reference_model.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/circular_reference_model.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class CircularReferenceModel(BaseModel): __properties = ["size", "nested"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -64,7 +64,7 @@ class CircularReferenceModel(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CircularReferenceModel.parse_obj(obj) _obj = CircularReferenceModel.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/class_model.py index 04cd03eb71..ed62d02c89 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/class_model.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/class_model.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -30,6 +29,7 @@ class ClassModel(BaseModel): __properties = ["_class"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -60,7 +60,7 @@ class ClassModel(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ClassModel.parse_obj(obj) _obj = ClassModel.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/client.py index 793b26fab9..25a00323c5 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/client.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -30,6 +29,7 @@ class Client(BaseModel): __properties = ["client"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -60,7 +60,7 @@ class Client(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Client.parse_obj(obj) _obj = Client.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/danish_pig.py index 9a45a77b60..0071d43781 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/danish_pig.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/danish_pig.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class DanishPig(BaseModel): __properties = ["className", "size"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ class DanishPig(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DanishPig.parse_obj(obj) _obj = DanishPig.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/deprecated_object.py index 1b17a9aec4..364d0b2fb2 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/deprecated_object.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/deprecated_object.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -30,6 +29,7 @@ class DeprecatedObject(BaseModel): __properties = ["name"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -60,7 +60,7 @@ class DeprecatedObject(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DeprecatedObject.parse_obj(obj) _obj = DeprecatedObject.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog.py index 03b803d878..52df38fcdd 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class Dog(Animal): __properties = ["className", "color", "breed"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ class Dog(Animal): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Dog.parse_obj(obj) _obj = Dog.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog_all_of.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog_all_of.py index 9fa8cea2d4..5caa2492ff 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog_all_of.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog_all_of.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -30,6 +29,7 @@ class DogAllOf(BaseModel): __properties = ["breed"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -60,7 +60,7 @@ class DogAllOf(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DogAllOf.parse_obj(obj) _obj = DogAllOf.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dummy_model.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dummy_model.py index 47cc18f1a1..806332316d 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dummy_model.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dummy_model.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class DummyModel(BaseModel): __properties = ["category", "self_ref"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -64,7 +64,7 @@ class DummyModel(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DummyModel.parse_obj(obj) _obj = DummyModel.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_arrays.py index c56f6e927c..73d6b81c17 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_arrays.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,25 +30,28 @@ class EnumArrays(BaseModel): __properties = ["just_symbol", "array_enum"] @validator('just_symbol') - def just_symbol_validate_enum(cls, v): - if v is None: - return v + def just_symbol_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in ('>=', '$'): + if value not in ('>=', '$'): raise ValueError("must be one of enum values ('>=', '$')") - return v + return value @validator('array_enum') - def array_enum_validate_enum(cls, v): - if v is None: - return v + def array_enum_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - for i in v: + for i in value: if i not in ('fish', 'crab'): raise ValueError("each list item must be one of ('fish', 'crab')") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -80,7 +82,7 @@ class EnumArrays(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return EnumArrays.parse_obj(obj) _obj = EnumArrays.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_test.py index 2f62f6d76e..f93051f436 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_test.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -42,48 +41,54 @@ class EnumTest(BaseModel): __properties = ["enum_string", "enum_string_required", "enum_integer_default", "enum_integer", "enum_number", "outerEnum", "outerEnumInteger", "outerEnumDefaultValue", "outerEnumIntegerDefaultValue"] @validator('enum_string') - def enum_string_validate_enum(cls, v): - if v is None: - return v + def enum_string_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in ('UPPER', 'lower', ''): + if value not in ('UPPER', 'lower', ''): raise ValueError("must be one of enum values ('UPPER', 'lower', '')") - return v + return value @validator('enum_string_required') - def enum_string_required_validate_enum(cls, v): - if v not in ('UPPER', 'lower', ''): + def enum_string_required_validate_enum(cls, value): + """Validates the enum""" + if value not in ('UPPER', 'lower', ''): raise ValueError("must be one of enum values ('UPPER', 'lower', '')") - return v + return value @validator('enum_integer_default') - def enum_integer_default_validate_enum(cls, v): - if v is None: - return v + def enum_integer_default_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in (1, 5, 14): + if value not in (1, 5, 14): raise ValueError("must be one of enum values (1, 5, 14)") - return v + return value @validator('enum_integer') - def enum_integer_validate_enum(cls, v): - if v is None: - return v + def enum_integer_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in (1, -1): + if value not in (1, -1): raise ValueError("must be one of enum values (1, -1)") - return v + return value @validator('enum_number') - def enum_number_validate_enum(cls, v): - if v is None: - return v + def enum_number_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in (1.1, -1.2): + if value not in (1.1, -1.2): raise ValueError("must be one of enum values (1.1, -1.2)") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -119,7 +124,7 @@ class EnumTest(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return EnumTest.parse_obj(obj) _obj = EnumTest.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file.py index aae806f951..fb0c1b0375 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -30,6 +29,7 @@ class File(BaseModel): __properties = ["sourceURI"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -60,7 +60,7 @@ class File(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return File.parse_obj(obj) _obj = File.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file_schema_test_class.py index 86c9b1bd46..80f8965a59 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file_schema_test_class.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class FileSchemaTestClass(BaseModel): __properties = ["file", "files"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -72,7 +72,7 @@ class FileSchemaTestClass(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return FileSchemaTestClass.parse_obj(obj) _obj = FileSchemaTestClass.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/first_ref.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/first_ref.py index 0856f9b0da..14a1cf6f4f 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/first_ref.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/first_ref.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class FirstRef(BaseModel): __properties = ["category", "self_ref"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -64,7 +64,7 @@ class FirstRef(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return FirstRef.parse_obj(obj) _obj = FirstRef.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo.py index c85ac8cec6..7f92613b7a 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -30,6 +29,7 @@ class Foo(BaseModel): __properties = ["bar"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -60,7 +60,7 @@ class Foo(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Foo.parse_obj(obj) _obj = Foo.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo_get_default_response.py index 1a8502a9eb..d51b918023 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo_get_default_response.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo_get_default_response.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class FooGetDefaultResponse(BaseModel): __properties = ["string"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -64,7 +64,7 @@ class FooGetDefaultResponse(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return FooGetDefaultResponse.parse_obj(obj) _obj = FooGetDefaultResponse.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/format_test.py index ce02674ff3..ccaf4712da 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/format_test.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/format_test.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -46,42 +45,47 @@ class FormatTest(BaseModel): __properties = ["integer", "int32", "int64", "number", "float", "double", "decimal", "string", "string_with_double_quote_pattern", "byte", "binary", "date", "dateTime", "uuid", "password", "pattern_with_digits", "pattern_with_digits_and_delimiter"] @validator('string') - def string_validate_regular_expression(cls, v): - if v is None: - return v + def string_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value - if not re.match(r"[a-z]", v ,re.IGNORECASE): + if not re.match(r"[a-z]", value ,re.IGNORECASE): raise ValueError(r"must validate the regular expression /[a-z]/i") - return v + return value @validator('string_with_double_quote_pattern') - def string_with_double_quote_pattern_validate_regular_expression(cls, v): - if v is None: - return v + def string_with_double_quote_pattern_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value - if not re.match(r"this is \"something\"", v): + if not re.match(r"this is \"something\"", value): raise ValueError(r"must validate the regular expression /this is \"something\"/") - return v + return value @validator('pattern_with_digits') - def pattern_with_digits_validate_regular_expression(cls, v): - if v is None: - return v + def pattern_with_digits_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value - if not re.match(r"^\d{10}$", v): + if not re.match(r"^\d{10}$", value): raise ValueError(r"must validate the regular expression /^\d{10}$/") - return v + return value @validator('pattern_with_digits_and_delimiter') - def pattern_with_digits_and_delimiter_validate_regular_expression(cls, v): - if v is None: - return v + def pattern_with_digits_and_delimiter_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value - if not re.match(r"^image_\d{1,3}$", v ,re.IGNORECASE): + if not re.match(r"^image_\d{1,3}$", value ,re.IGNORECASE): raise ValueError(r"must validate the regular expression /^image_\d{1,3}$/i") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -112,7 +116,7 @@ class FormatTest(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return FormatTest.parse_obj(obj) _obj = FormatTest.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/has_only_read_only.py index 47345cc0a8..d966338a75 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/has_only_read_only.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class HasOnlyReadOnly(BaseModel): __properties = ["bar", "foo"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -63,7 +63,7 @@ class HasOnlyReadOnly(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return HasOnlyReadOnly.parse_obj(obj) _obj = HasOnlyReadOnly.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/health_check_result.py index 8f674067ff..df22bd73b5 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/health_check_result.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/health_check_result.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -30,6 +29,7 @@ class HealthCheckResult(BaseModel): __properties = ["NullableMessage"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -65,7 +65,7 @@ class HealthCheckResult(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return HealthCheckResult.parse_obj(obj) _obj = HealthCheckResult.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/inner_dict_with_property.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/inner_dict_with_property.py index 8bce01a25b..bdafe05358 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/inner_dict_with_property.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/inner_dict_with_property.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -30,6 +29,7 @@ class InnerDictWithProperty(BaseModel): __properties = ["aProperty"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -60,7 +60,7 @@ class InnerDictWithProperty(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return InnerDictWithProperty.parse_obj(obj) _obj = InnerDictWithProperty.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/list.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/list.py index e0a3f4b55e..07630b0932 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/list.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/list.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -30,6 +29,7 @@ class List(BaseModel): __properties = ["123-list"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -60,7 +60,7 @@ class List(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return List.parse_obj(obj) _obj = List.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/map_test.py index 512f09d73e..8951300228 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/map_test.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/map_test.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -33,15 +32,17 @@ class MapTest(BaseModel): __properties = ["map_map_of_string", "map_of_enum_string", "direct_map", "indirect_map"] @validator('map_of_enum_string') - def map_of_enum_string_validate_enum(cls, v): - if v is None: - return v + def map_of_enum_string_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in ('UPPER', 'lower'): + if value not in ('UPPER', 'lower'): raise ValueError("must be one of enum values ('UPPER', 'lower')") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -72,7 +73,7 @@ class MapTest(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return MapTest.parse_obj(obj) _obj = MapTest.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py index 23b80efa20..c381b9ab52 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -33,6 +32,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): __properties = ["uuid", "dateTime", "map"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -70,7 +70,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return MixedPropertiesAndAdditionalPropertiesClass.parse_obj(obj) _obj = MixedPropertiesAndAdditionalPropertiesClass.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model200_response.py index 55ddbc2a05..d5443ea6a1 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model200_response.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model200_response.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class Model200Response(BaseModel): __properties = ["name", "class"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ class Model200Response(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Model200Response.parse_obj(obj) _obj = Model200Response.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model_return.py index 527a4f5b47..0f7e4bbe06 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model_return.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model_return.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -30,6 +29,7 @@ class ModelReturn(BaseModel): __properties = ["return"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -60,7 +60,7 @@ class ModelReturn(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ModelReturn.parse_obj(obj) _obj = ModelReturn.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/name.py index bf9ab74413..b13fdb2e50 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/name.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -33,6 +32,7 @@ class Name(BaseModel): __properties = ["name", "snake_case", "property", "123Number"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -65,7 +65,7 @@ class Name(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Name.parse_obj(obj) _obj = Name.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/nullable_class.py index 969acaeca0..0235d20c8e 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/nullable_class.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/nullable_class.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -42,6 +41,7 @@ class NullableClass(BaseModel): __properties = ["required_integer_prop", "integer_prop", "number_prop", "boolean_prop", "string_prop", "date_prop", "datetime_prop", "array_nullable_prop", "array_and_items_nullable_prop", "array_items_nullable", "object_nullable_prop", "object_and_items_nullable_prop", "object_items_nullable"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -127,7 +127,7 @@ class NullableClass(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return NullableClass.parse_obj(obj) _obj = NullableClass.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/number_only.py index c4a400a846..e7eaf5ef06 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/number_only.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/number_only.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -30,6 +29,7 @@ class NumberOnly(BaseModel): __properties = ["JustNumber"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -60,7 +60,7 @@ class NumberOnly(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return NumberOnly.parse_obj(obj) _obj = NumberOnly.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/object_with_deprecated_fields.py index d056ce8778..e2ae308b3e 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/object_with_deprecated_fields.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/object_with_deprecated_fields.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -34,6 +33,7 @@ class ObjectWithDeprecatedFields(BaseModel): __properties = ["uuid", "id", "deprecatedRef", "bars"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ class ObjectWithDeprecatedFields(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ObjectWithDeprecatedFields.parse_obj(obj) _obj = ObjectWithDeprecatedFields.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/order.py index 7a61819b8b..6b88135404 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/order.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -35,15 +34,17 @@ class Order(BaseModel): __properties = ["id", "petId", "quantity", "shipDate", "status", "complete"] @validator('status') - def status_validate_enum(cls, v): - if v is None: - return v + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in ('placed', 'approved', 'delivered'): + if value not in ('placed', 'approved', 'delivered'): raise ValueError("must be one of enum values ('placed', 'approved', 'delivered')") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -74,7 +75,7 @@ class Order(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Order.parse_obj(obj) _obj = Order.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_composite.py index 7fce7797fe..5846744e3b 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_composite.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_composite.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class OuterComposite(BaseModel): __properties = ["my_number", "my_string", "my_boolean"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -62,7 +62,7 @@ class OuterComposite(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OuterComposite.parse_obj(obj) _obj = OuterComposite.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_object_with_enum_property.py index 78ea1841d7..a08adf4f3a 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_object_with_enum_property.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_object_with_enum_property.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -33,6 +32,7 @@ class OuterObjectWithEnumProperty(BaseModel): __properties = ["str_value", "value"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ class OuterObjectWithEnumProperty(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OuterObjectWithEnumProperty.parse_obj(obj) _obj = OuterObjectWithEnumProperty.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/parent.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/parent.py index 8af68a0065..f8fff21bf2 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/parent.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/parent.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class Parent(BaseModel): __properties = ["optionalDict"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ class Parent(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Parent.parse_obj(obj) _obj = Parent.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/parent_with_optional_dict.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/parent_with_optional_dict.py index 0918d6e7e3..faf2217505 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/parent_with_optional_dict.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/parent_with_optional_dict.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class ParentWithOptionalDict(BaseModel): __properties = ["optionalDict"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ class ParentWithOptionalDict(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ParentWithOptionalDict.parse_obj(obj) _obj = ParentWithOptionalDict.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pet.py index af7b3e37fd..2861409982 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pet.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -37,15 +36,17 @@ class Pet(BaseModel): __properties = ["id", "category", "name", "photoUrls", "tags", "status"] @validator('status') - def status_validate_enum(cls, v): - if v is None: - return v + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in ('available', 'pending', 'sold'): + if value not in ('available', 'pending', 'sold'): raise ValueError("must be one of enum values ('available', 'pending', 'sold')") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -86,7 +87,7 @@ class Pet(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Pet.parse_obj(obj) _obj = Pet.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pig.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pig.py index baa32ba0c4..5f27432d24 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pig.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pig.py @@ -50,13 +50,13 @@ class Pig(BaseModel): error_messages = [] match = 0 # validate data type: BasquePig - if type(v) is not BasquePig: + if not isinstance(v, BasquePig): error_messages.append(f"Error! Input type `{type(v)}` is not `BasquePig`") else: match += 1 # validate data type: DanishPig - if type(v) is not DanishPig: + if not isinstance(v, DanishPig): error_messages.append(f"Error! Input type `{type(v)}` is not `DanishPig`") else: match += 1 diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/read_only_first.py index ac16280844..d6c71f77e8 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/read_only_first.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/read_only_first.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class ReadOnlyFirst(BaseModel): __properties = ["bar", "baz"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -62,7 +62,7 @@ class ReadOnlyFirst(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ReadOnlyFirst.parse_obj(obj) _obj = ReadOnlyFirst.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/second_ref.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/second_ref.py index f00e275692..2e5442dcc5 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/second_ref.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/second_ref.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class SecondRef(BaseModel): __properties = ["category", "circular_ref"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -64,7 +64,7 @@ class SecondRef(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return SecondRef.parse_obj(obj) _obj = SecondRef.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/self_reference_model.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/self_reference_model.py index b8fa0dd875..5e40902ead 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/self_reference_model.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/self_reference_model.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class SelfReferenceModel(BaseModel): __properties = ["size", "nested"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -64,7 +64,7 @@ class SelfReferenceModel(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return SelfReferenceModel.parse_obj(obj) _obj = SelfReferenceModel.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_model_name.py index bc9f7b4cda..5f7a78250b 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_model_name.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_model_name.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -30,6 +29,7 @@ class SpecialModelName(BaseModel): __properties = ["$special[property.name]"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -60,7 +60,7 @@ class SpecialModelName(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return SpecialModelName.parse_obj(obj) _obj = SpecialModelName.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_name.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_name.py index bdb0c8931b..a72b537dcd 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_name.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_name.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -33,15 +32,17 @@ class SpecialName(BaseModel): __properties = ["property", "async", "schema"] @validator('var_schema') - def var_schema_validate_enum(cls, v): - if v is None: - return v + def var_schema_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in ('available', 'pending', 'sold'): + if value not in ('available', 'pending', 'sold'): raise ValueError("must be one of enum values ('available', 'pending', 'sold')") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -75,7 +76,7 @@ class SpecialName(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return SpecialName.parse_obj(obj) _obj = SpecialName.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/tag.py index 80c683f5d9..8d53ed2096 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/tag.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class Tag(BaseModel): __properties = ["id", "name"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -61,7 +61,7 @@ class Tag(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Tag.parse_obj(obj) _obj = Tag.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/user.py index 77c6b277f0..8e58d9ae49 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/user.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -37,6 +36,7 @@ class User(BaseModel): __properties = ["id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ class User(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return User.parse_obj(obj) _obj = User.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/with_nested_one_of.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/with_nested_one_of.py index 6690f8dd73..519318efdb 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/with_nested_one_of.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/with_nested_one_of.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class WithNestedOneOf(BaseModel): __properties = ["size", "nested_pig"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -65,7 +65,7 @@ class WithNestedOneOf(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return WithNestedOneOf.parse_obj(obj) _obj = WithNestedOneOf.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/pyproject.toml b/samples/openapi3/client/petstore/python-nextgen-aiohttp/pyproject.toml index 6c4548406a..70ac4c1384 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/pyproject.toml +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/pyproject.toml @@ -16,7 +16,7 @@ python-dateutil = ">=2.8.2" aiohttp = ">= 3.8.4" pem = ">= 19.3.0" pycryptodome = ">= 3.9.0" -pydantic = "^1.10.5" +pydantic = "^1.10.5, <2" aenum = ">=3.1.11" [tool.poetry.dev-dependencies] @@ -28,3 +28,5 @@ flake8 = ">=4.0.0" requires = ["setuptools"] build-backend = "setuptools.build_meta" +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/additional_properties_class.py index e99d1d384d..82e55e0c62 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/additional_properties_class.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class AdditionalPropertiesClass(BaseModel): __properties = ["map_property", "map_of_map_property"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ class AdditionalPropertiesClass(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return AdditionalPropertiesClass.parse_obj(obj) _obj = AdditionalPropertiesClass.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/all_of_with_single_ref.py index 7480ccec36..4a364b413e 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/all_of_with_single_ref.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/all_of_with_single_ref.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -33,6 +32,7 @@ class AllOfWithSingleRef(BaseModel): __properties = ["username", "SingleRefType"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ class AllOfWithSingleRef(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return AllOfWithSingleRef.parse_obj(obj) _obj = AllOfWithSingleRef.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/animal.py index c37cccbf44..446dfeba43 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/animal.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -33,6 +32,7 @@ class Animal(BaseModel): __properties = ["className", "color"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/any_of_pig.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/any_of_pig.py index e9e97b7d40..d18b58876d 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/any_of_pig.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/any_of_pig.py @@ -47,13 +47,13 @@ class AnyOfPig(BaseModel): instance = cls() error_messages = [] # validate data type: BasquePig - if type(v) is not BasquePig: + if not isinstance(v, BasquePig): error_messages.append(f"Error! Input type `{type(v)}` is not `BasquePig`") else: return v # validate data type: DanishPig - if type(v) is not DanishPig: + if not isinstance(v, DanishPig): error_messages.append(f"Error! Input type `{type(v)}` is not `DanishPig`") else: return v diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/api_response.py index da810c9208..7c7ae29a6f 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/api_response.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/api_response.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -33,6 +32,7 @@ class ApiResponse(BaseModel): __properties = ["code", "type", "message"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ class ApiResponse(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ApiResponse.parse_obj(obj) _obj = ApiResponse.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_array_of_number_only.py index 981ec9cebd..78fcaaf5b5 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_array_of_number_only.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class ArrayOfArrayOfNumberOnly(BaseModel): __properties = ["ArrayArrayNumber"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ class ArrayOfArrayOfNumberOnly(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ArrayOfArrayOfNumberOnly.parse_obj(obj) _obj = ArrayOfArrayOfNumberOnly.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_number_only.py index 89a4169e08..f3968f5b0b 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_number_only.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class ArrayOfNumberOnly(BaseModel): __properties = ["ArrayNumber"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ class ArrayOfNumberOnly(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ArrayOfNumberOnly.parse_obj(obj) _obj = ArrayOfNumberOnly.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_test.py index 9fe1c047ec..afef8bee0f 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_test.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_test.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -34,6 +33,7 @@ class ArrayTest(BaseModel): __properties = ["array_of_string", "array_array_of_integer", "array_array_of_model"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -77,7 +77,7 @@ class ArrayTest(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ArrayTest.parse_obj(obj) _obj = ArrayTest.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/basque_pig.py index cc775a10e2..bdbd436295 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/basque_pig.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/basque_pig.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class BasquePig(BaseModel): __properties = ["className", "color"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ class BasquePig(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return BasquePig.parse_obj(obj) _obj = BasquePig.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/capitalization.py index 92695072b1..03532ccd4c 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/capitalization.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -36,6 +35,7 @@ class Capitalization(BaseModel): __properties = ["smallCamel", "CapitalCamel", "small_Snake", "Capital_Snake", "SCA_ETH_Flow_Points", "ATT_NAME"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -72,7 +72,7 @@ class Capitalization(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Capitalization.parse_obj(obj) _obj = Capitalization.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat.py index f2aca66851..ec62d7beff 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class Cat(Animal): __properties = ["className", "color", "declawed"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ class Cat(Animal): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Cat.parse_obj(obj) _obj = Cat.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat_all_of.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat_all_of.py index 349fcc17b5..38dfa14c5f 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat_all_of.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat_all_of.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class CatAllOf(BaseModel): __properties = ["declawed"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ class CatAllOf(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CatAllOf.parse_obj(obj) _obj = CatAllOf.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/category.py index d1cfde84d0..17edf3573c 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/category.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class Category(BaseModel): __properties = ["id", "name"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ class Category(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Category.parse_obj(obj) _obj = Category.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/circular_reference_model.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/circular_reference_model.py index eacb22736b..381caa6640 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/circular_reference_model.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/circular_reference_model.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class CircularReferenceModel(BaseModel): __properties = ["size", "nested"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -71,7 +71,7 @@ class CircularReferenceModel(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return CircularReferenceModel.parse_obj(obj) _obj = CircularReferenceModel.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/class_model.py index b20fe9ca21..7963b83145 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/class_model.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/class_model.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class ClassModel(BaseModel): __properties = ["_class"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ class ClassModel(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ClassModel.parse_obj(obj) _obj = ClassModel.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/client.py index a2d0856473..5b70640f00 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/client.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class Client(BaseModel): __properties = ["client"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ class Client(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Client.parse_obj(obj) _obj = Client.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/danish_pig.py index 88cf28e3b6..c4c92e4d29 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/danish_pig.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/danish_pig.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class DanishPig(BaseModel): __properties = ["className", "size"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ class DanishPig(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DanishPig.parse_obj(obj) _obj = DanishPig.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/deprecated_object.py index 870fec8e85..6277548838 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/deprecated_object.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/deprecated_object.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class DeprecatedObject(BaseModel): __properties = ["name"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ class DeprecatedObject(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DeprecatedObject.parse_obj(obj) _obj = DeprecatedObject.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog.py index eb6510a7a1..a3d3b96007 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class Dog(Animal): __properties = ["className", "color", "breed"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ class Dog(Animal): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Dog.parse_obj(obj) _obj = Dog.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog_all_of.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog_all_of.py index 50b2b59ac0..7e61359cdb 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog_all_of.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog_all_of.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class DogAllOf(BaseModel): __properties = ["breed"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ class DogAllOf(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DogAllOf.parse_obj(obj) _obj = DogAllOf.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dummy_model.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dummy_model.py index d0db2bdc18..31dcde4857 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dummy_model.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dummy_model.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class DummyModel(BaseModel): __properties = ["category", "self_ref"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -71,7 +71,7 @@ class DummyModel(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return DummyModel.parse_obj(obj) _obj = DummyModel.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_arrays.py index f270d1cd14..1e9f7e748a 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_arrays.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,25 +31,28 @@ class EnumArrays(BaseModel): __properties = ["just_symbol", "array_enum"] @validator('just_symbol') - def just_symbol_validate_enum(cls, v): - if v is None: - return v + def just_symbol_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in ('>=', '$'): + if value not in ('>=', '$'): raise ValueError("must be one of enum values ('>=', '$')") - return v + return value @validator('array_enum') - def array_enum_validate_enum(cls, v): - if v is None: - return v + def array_enum_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - for i in v: + for i in value: if i not in ('fish', 'crab'): raise ValueError("each list item must be one of ('fish', 'crab')") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -87,7 +89,7 @@ class EnumArrays(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return EnumArrays.parse_obj(obj) _obj = EnumArrays.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_test.py index 6da81fb921..49ab367188 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_test.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -43,48 +42,54 @@ class EnumTest(BaseModel): __properties = ["enum_string", "enum_string_required", "enum_integer_default", "enum_integer", "enum_number", "outerEnum", "outerEnumInteger", "outerEnumDefaultValue", "outerEnumIntegerDefaultValue"] @validator('enum_string') - def enum_string_validate_enum(cls, v): - if v is None: - return v + def enum_string_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in ('UPPER', 'lower', ''): + if value not in ('UPPER', 'lower', ''): raise ValueError("must be one of enum values ('UPPER', 'lower', '')") - return v + return value @validator('enum_string_required') - def enum_string_required_validate_enum(cls, v): - if v not in ('UPPER', 'lower', ''): + def enum_string_required_validate_enum(cls, value): + """Validates the enum""" + if value not in ('UPPER', 'lower', ''): raise ValueError("must be one of enum values ('UPPER', 'lower', '')") - return v + return value @validator('enum_integer_default') - def enum_integer_default_validate_enum(cls, v): - if v is None: - return v + def enum_integer_default_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in (1, 5, 14): + if value not in (1, 5, 14): raise ValueError("must be one of enum values (1, 5, 14)") - return v + return value @validator('enum_integer') - def enum_integer_validate_enum(cls, v): - if v is None: - return v + def enum_integer_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in (1, -1): + if value not in (1, -1): raise ValueError("must be one of enum values (1, -1)") - return v + return value @validator('enum_number') - def enum_number_validate_enum(cls, v): - if v is None: - return v + def enum_number_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in (1.1, -1.2): + if value not in (1.1, -1.2): raise ValueError("must be one of enum values (1.1, -1.2)") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -126,7 +131,7 @@ class EnumTest(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return EnumTest.parse_obj(obj) _obj = EnumTest.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file.py index 182d9cd0fc..f6c6932f00 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class File(BaseModel): __properties = ["sourceURI"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ class File(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return File.parse_obj(obj) _obj = File.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file_schema_test_class.py index f822f4599b..8915c11973 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file_schema_test_class.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -33,6 +32,7 @@ class FileSchemaTestClass(BaseModel): __properties = ["file", "files"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -79,7 +79,7 @@ class FileSchemaTestClass(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return FileSchemaTestClass.parse_obj(obj) _obj = FileSchemaTestClass.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/first_ref.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/first_ref.py index 31ac239067..2916d18a50 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/first_ref.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/first_ref.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class FirstRef(BaseModel): __properties = ["category", "self_ref"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -71,7 +71,7 @@ class FirstRef(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return FirstRef.parse_obj(obj) _obj = FirstRef.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo.py index 7a29b7f572..e97ebbda9b 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class Foo(BaseModel): __properties = ["bar"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ class Foo(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Foo.parse_obj(obj) _obj = Foo.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo_get_default_response.py index 99b2dca472..a140027340 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo_get_default_response.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo_get_default_response.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class FooGetDefaultResponse(BaseModel): __properties = ["string"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -71,7 +71,7 @@ class FooGetDefaultResponse(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return FooGetDefaultResponse.parse_obj(obj) _obj = FooGetDefaultResponse.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/format_test.py index f2718790a0..12f9555d7d 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/format_test.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/format_test.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -47,42 +46,47 @@ class FormatTest(BaseModel): __properties = ["integer", "int32", "int64", "number", "float", "double", "decimal", "string", "string_with_double_quote_pattern", "byte", "binary", "date", "dateTime", "uuid", "password", "pattern_with_digits", "pattern_with_digits_and_delimiter"] @validator('string') - def string_validate_regular_expression(cls, v): - if v is None: - return v + def string_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value - if not re.match(r"[a-z]", v ,re.IGNORECASE): + if not re.match(r"[a-z]", value ,re.IGNORECASE): raise ValueError(r"must validate the regular expression /[a-z]/i") - return v + return value @validator('string_with_double_quote_pattern') - def string_with_double_quote_pattern_validate_regular_expression(cls, v): - if v is None: - return v + def string_with_double_quote_pattern_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value - if not re.match(r"this is \"something\"", v): + if not re.match(r"this is \"something\"", value): raise ValueError(r"must validate the regular expression /this is \"something\"/") - return v + return value @validator('pattern_with_digits') - def pattern_with_digits_validate_regular_expression(cls, v): - if v is None: - return v + def pattern_with_digits_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value - if not re.match(r"^\d{10}$", v): + if not re.match(r"^\d{10}$", value): raise ValueError(r"must validate the regular expression /^\d{10}$/") - return v + return value @validator('pattern_with_digits_and_delimiter') - def pattern_with_digits_and_delimiter_validate_regular_expression(cls, v): - if v is None: - return v + def pattern_with_digits_and_delimiter_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value - if not re.match(r"^image_\d{1,3}$", v ,re.IGNORECASE): + if not re.match(r"^image_\d{1,3}$", value ,re.IGNORECASE): raise ValueError(r"must validate the regular expression /^image_\d{1,3}$/i") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -119,7 +123,7 @@ class FormatTest(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return FormatTest.parse_obj(obj) _obj = FormatTest.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/has_only_read_only.py index 6207f7f2ec..72c0784256 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/has_only_read_only.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class HasOnlyReadOnly(BaseModel): __properties = ["bar", "foo"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -70,7 +70,7 @@ class HasOnlyReadOnly(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return HasOnlyReadOnly.parse_obj(obj) _obj = HasOnlyReadOnly.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/health_check_result.py index 51dcd4cdcc..84caace756 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/health_check_result.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/health_check_result.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class HealthCheckResult(BaseModel): __properties = ["NullableMessage"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -72,7 +72,7 @@ class HealthCheckResult(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return HealthCheckResult.parse_obj(obj) _obj = HealthCheckResult.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/inner_dict_with_property.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/inner_dict_with_property.py index 23cc8e6a3a..a560f57f7c 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/inner_dict_with_property.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/inner_dict_with_property.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class InnerDictWithProperty(BaseModel): __properties = ["aProperty"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ class InnerDictWithProperty(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return InnerDictWithProperty.parse_obj(obj) _obj = InnerDictWithProperty.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/list.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/list.py index 27daff87ea..378f9a3f09 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/list.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/list.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class List(BaseModel): __properties = ["123-list"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ class List(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return List.parse_obj(obj) _obj = List.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/map_test.py index 30cc0146b0..c28cccb50b 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/map_test.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/map_test.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -34,15 +33,17 @@ class MapTest(BaseModel): __properties = ["map_map_of_string", "map_of_enum_string", "direct_map", "indirect_map"] @validator('map_of_enum_string') - def map_of_enum_string_validate_enum(cls, v): - if v is None: - return v + def map_of_enum_string_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in ('UPPER', 'lower'): + if value not in ('UPPER', 'lower'): raise ValueError("must be one of enum values ('UPPER', 'lower')") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -79,7 +80,7 @@ class MapTest(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return MapTest.parse_obj(obj) _obj = MapTest.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/mixed_properties_and_additional_properties_class.py index 0e9351ebf1..bbece70cf3 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -34,6 +33,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): __properties = ["uuid", "dateTime", "map"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -77,7 +77,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return MixedPropertiesAndAdditionalPropertiesClass.parse_obj(obj) _obj = MixedPropertiesAndAdditionalPropertiesClass.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model200_response.py index 30425febaf..0158f829fb 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model200_response.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model200_response.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class Model200Response(BaseModel): __properties = ["name", "class"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ class Model200Response(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Model200Response.parse_obj(obj) _obj = Model200Response.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model_return.py index e26375be4f..b4a4d3a6c6 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model_return.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model_return.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class ModelReturn(BaseModel): __properties = ["return"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ class ModelReturn(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ModelReturn.parse_obj(obj) _obj = ModelReturn.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/name.py index b17307dc3a..5ce9d8caf1 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/name.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -34,6 +33,7 @@ class Name(BaseModel): __properties = ["name", "snake_case", "property", "123Number"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -72,7 +72,7 @@ class Name(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Name.parse_obj(obj) _obj = Name.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/nullable_class.py index f29c76b594..5b4366c6ac 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/nullable_class.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/nullable_class.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -42,6 +41,7 @@ class NullableClass(BaseModel): __properties = ["required_integer_prop", "integer_prop", "number_prop", "boolean_prop", "string_prop", "date_prop", "datetime_prop", "array_nullable_prop", "array_and_items_nullable_prop", "array_items_nullable", "object_nullable_prop", "object_and_items_nullable_prop", "object_items_nullable"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -127,7 +127,7 @@ class NullableClass(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return NullableClass.parse_obj(obj) _obj = NullableClass.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/number_only.py index 65809405f1..16fa97f69e 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/number_only.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/number_only.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class NumberOnly(BaseModel): __properties = ["JustNumber"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ class NumberOnly(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return NumberOnly.parse_obj(obj) _obj = NumberOnly.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/object_with_deprecated_fields.py index 7904c25985..3987fcd787 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/object_with_deprecated_fields.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/object_with_deprecated_fields.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -35,6 +34,7 @@ class ObjectWithDeprecatedFields(BaseModel): __properties = ["uuid", "id", "deprecatedRef", "bars"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -74,7 +74,7 @@ class ObjectWithDeprecatedFields(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ObjectWithDeprecatedFields.parse_obj(obj) _obj = ObjectWithDeprecatedFields.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/order.py index babf76251b..27df77588b 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/order.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -36,15 +35,17 @@ class Order(BaseModel): __properties = ["id", "petId", "quantity", "shipDate", "status", "complete"] @validator('status') - def status_validate_enum(cls, v): - if v is None: - return v + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in ('placed', 'approved', 'delivered'): + if value not in ('placed', 'approved', 'delivered'): raise ValueError("must be one of enum values ('placed', 'approved', 'delivered')") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -81,7 +82,7 @@ class Order(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Order.parse_obj(obj) _obj = Order.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_composite.py index 855fb1a585..1afabc591c 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_composite.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_composite.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -33,6 +32,7 @@ class OuterComposite(BaseModel): __properties = ["my_number", "my_string", "my_boolean"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ class OuterComposite(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OuterComposite.parse_obj(obj) _obj = OuterComposite.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_object_with_enum_property.py index c29ef3b431..de96620dd7 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_object_with_enum_property.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_object_with_enum_property.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -34,6 +33,7 @@ class OuterObjectWithEnumProperty(BaseModel): __properties = ["str_value", "value"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -75,7 +75,7 @@ class OuterObjectWithEnumProperty(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return OuterObjectWithEnumProperty.parse_obj(obj) _obj = OuterObjectWithEnumProperty.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/parent.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/parent.py index 1ed518fabb..0107491675 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/parent.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/parent.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class Parent(BaseModel): __properties = ["optionalDict"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -75,7 +75,7 @@ class Parent(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Parent.parse_obj(obj) _obj = Parent.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/parent_with_optional_dict.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/parent_with_optional_dict.py index 0e7948d73b..53fa6f72cb 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/parent_with_optional_dict.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/parent_with_optional_dict.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class ParentWithOptionalDict(BaseModel): __properties = ["optionalDict"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -75,7 +75,7 @@ class ParentWithOptionalDict(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ParentWithOptionalDict.parse_obj(obj) _obj = ParentWithOptionalDict.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pet.py index 446e5de9c4..b13a9b1b8d 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pet.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -38,15 +37,17 @@ class Pet(BaseModel): __properties = ["id", "category", "name", "photoUrls", "tags", "status"] @validator('status') - def status_validate_enum(cls, v): - if v is None: - return v + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in ('available', 'pending', 'sold'): + if value not in ('available', 'pending', 'sold'): raise ValueError("must be one of enum values ('available', 'pending', 'sold')") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -93,7 +94,7 @@ class Pet(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Pet.parse_obj(obj) _obj = Pet.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pig.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pig.py index 66cebdd798..e39ad8ccea 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pig.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pig.py @@ -50,13 +50,13 @@ class Pig(BaseModel): error_messages = [] match = 0 # validate data type: BasquePig - if type(v) is not BasquePig: + if not isinstance(v, BasquePig): error_messages.append(f"Error! Input type `{type(v)}` is not `BasquePig`") else: match += 1 # validate data type: DanishPig - if type(v) is not DanishPig: + if not isinstance(v, DanishPig): error_messages.append(f"Error! Input type `{type(v)}` is not `DanishPig`") else: match += 1 diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/read_only_first.py index 73a9c98aec..cf0814ba68 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/read_only_first.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/read_only_first.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class ReadOnlyFirst(BaseModel): __properties = ["bar", "baz"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -69,7 +69,7 @@ class ReadOnlyFirst(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return ReadOnlyFirst.parse_obj(obj) _obj = ReadOnlyFirst.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/second_ref.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/second_ref.py index 228c8b24b9..486f5dec93 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/second_ref.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/second_ref.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class SecondRef(BaseModel): __properties = ["category", "circular_ref"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -71,7 +71,7 @@ class SecondRef(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return SecondRef.parse_obj(obj) _obj = SecondRef.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/self_reference_model.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/self_reference_model.py index faca1f2f56..743ece5ae3 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/self_reference_model.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/self_reference_model.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class SelfReferenceModel(BaseModel): __properties = ["size", "nested"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -71,7 +71,7 @@ class SelfReferenceModel(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return SelfReferenceModel.parse_obj(obj) _obj = SelfReferenceModel.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_model_name.py index 0f7f93facf..ea5cafa061 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_model_name.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_model_name.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -31,6 +30,7 @@ class SpecialModelName(BaseModel): __properties = ["$special[property.name]"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -67,7 +67,7 @@ class SpecialModelName(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return SpecialModelName.parse_obj(obj) _obj = SpecialModelName.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_name.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_name.py index 4715e8dac3..69c7ab7ea9 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_name.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_name.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -34,15 +33,17 @@ class SpecialName(BaseModel): __properties = ["property", "async", "schema"] @validator('var_schema') - def var_schema_validate_enum(cls, v): - if v is None: - return v + def var_schema_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value - if v not in ('available', 'pending', 'sold'): + if value not in ('available', 'pending', 'sold'): raise ValueError("must be one of enum values ('available', 'pending', 'sold')") - return v + return value class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -82,7 +83,7 @@ class SpecialName(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return SpecialName.parse_obj(obj) _obj = SpecialName.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/tag.py index 4b01f942e8..dc39529e06 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/tag.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -32,6 +31,7 @@ class Tag(BaseModel): __properties = ["id", "name"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -68,7 +68,7 @@ class Tag(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return Tag.parse_obj(obj) _obj = Tag.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/user.py index c52f49d337..7046a2ce64 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/user.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -38,6 +37,7 @@ class User(BaseModel): __properties = ["id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -74,7 +74,7 @@ class User(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return User.parse_obj(obj) _obj = User.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/with_nested_one_of.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/with_nested_one_of.py index 52a535dcef..4967259433 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/with_nested_one_of.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/with_nested_one_of.py @@ -13,7 +13,6 @@ from __future__ import annotations -from inspect import getfullargspec import pprint import re # noqa: F401 import json @@ -33,6 +32,7 @@ class WithNestedOneOf(BaseModel): __properties = ["size", "nested_pig"] class Config: + """Pydantic configuration""" allow_population_by_field_name = True validate_assignment = True @@ -72,7 +72,7 @@ class WithNestedOneOf(BaseModel): if obj is None: return None - if type(obj) is not dict: + if not isinstance(obj, dict): return WithNestedOneOf.parse_obj(obj) _obj = WithNestedOneOf.parse_obj({ diff --git a/samples/openapi3/client/petstore/python-nextgen/pyproject.toml b/samples/openapi3/client/petstore/python-nextgen/pyproject.toml index b31e894081..ed6bee8c6b 100644 --- a/samples/openapi3/client/petstore/python-nextgen/pyproject.toml +++ b/samples/openapi3/client/petstore/python-nextgen/pyproject.toml @@ -15,7 +15,7 @@ urllib3 = ">= 1.25.3" python-dateutil = ">=2.8.2" pem = ">= 19.3.0" pycryptodome = ">= 3.9.0" -pydantic = "^1.10.5" +pydantic = "^1.10.5, <2" aenum = ">=3.1.11" [tool.poetry.dev-dependencies] @@ -27,3 +27,5 @@ flake8 = ">=4.0.0" requires = ["setuptools"] build-backend = "setuptools.build_meta" +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic"