From 063865973df48aa13da473b359faf8ed5c5d2434 Mon Sep 17 00:00:00 2001 From: Jonathan Ballet Date: Wed, 3 Jan 2024 14:22:53 +0100 Subject: [PATCH] python: simplify module imports (#17507) In #16624, I introduced a new mechanism to record imports to other modules, instead of having specialized datetime/typing/pydantic objects to manage imports for these modules. This change reuses the mechanism from #16624 and replace the specialized import managers by the generic one. Unused imports from various .mustache templates are also cleaned up. --- .../languages/AbstractPythonCodegen.java | 217 +++++++----------- .../src/main/resources/python/api.mustache | 7 +- .../main/resources/python/api_client.mustache | 1 - .../resources/python/api_doc_example.mustache | 2 - .../resources/python/api_response.mustache | 2 +- .../resources/python/common_README.mustache | 1 - .../resources/python/model_anyof.mustache | 10 +- .../main/resources/python/model_enum.mustache | 13 +- .../resources/python/model_generic.mustache | 3 - .../resources/python/model_oneof.mustache | 13 +- .../main/resources/python/model_test.mustache | 1 - .../main/resources/python/signing.mustache | 1 - .../README.md | 1 - .../docs/AuthApi.md | 4 - .../docs/BodyApi.md | 18 -- .../docs/FormApi.md | 4 - .../docs/HeaderApi.md | 2 - .../docs/PathApi.md | 2 - .../docs/QueryApi.md | 16 -- .../openapi_client/api/auth_api.py | 5 +- .../openapi_client/api/body_api.py | 14 +- .../openapi_client/api/form_api.py | 7 +- .../openapi_client/api/header_api.py | 7 +- .../openapi_client/api/path_api.py | 6 +- .../openapi_client/api/query_api.py | 8 +- .../openapi_client/api_client.py | 1 - .../openapi_client/api_response.py | 2 +- .../openapi_client/models/bird.py | 3 +- .../openapi_client/models/category.py | 3 +- .../openapi_client/models/data_query.py | 3 +- .../openapi_client/models/default_value.py | 3 +- .../models/number_properties_only.py | 4 +- .../openapi_client/models/pet.py | 4 +- .../openapi_client/models/query.py | 4 +- .../openapi_client/models/string_enum_ref.py | 10 +- .../openapi_client/models/tag.py | 3 +- ...ue_object_all_of_query_object_parameter.py | 3 +- ...rue_array_string_query_object_parameter.py | 3 +- samples/client/echo_api/python/README.md | 1 - .../client/echo_api/python/docs/AuthApi.md | 4 - .../client/echo_api/python/docs/BodyApi.md | 18 -- .../client/echo_api/python/docs/FormApi.md | 4 - .../client/echo_api/python/docs/HeaderApi.md | 2 - .../client/echo_api/python/docs/PathApi.md | 2 - .../client/echo_api/python/docs/QueryApi.md | 16 -- .../python/openapi_client/api/auth_api.py | 5 +- .../python/openapi_client/api/body_api.py | 14 +- .../python/openapi_client/api/form_api.py | 7 +- .../python/openapi_client/api/header_api.py | 7 +- .../python/openapi_client/api/path_api.py | 6 +- .../python/openapi_client/api/query_api.py | 8 +- .../python/openapi_client/api_client.py | 1 - .../python/openapi_client/api_response.py | 2 +- .../python/openapi_client/models/bird.py | 3 +- .../python/openapi_client/models/category.py | 3 +- .../openapi_client/models/data_query.py | 3 +- .../openapi_client/models/default_value.py | 3 +- .../models/number_properties_only.py | 4 +- .../python/openapi_client/models/pet.py | 4 +- .../python/openapi_client/models/query.py | 4 +- .../openapi_client/models/string_enum_ref.py | 10 +- .../python/openapi_client/models/tag.py | 3 +- ...ue_object_all_of_query_object_parameter.py | 3 +- ...rue_array_string_query_object_parameter.py | 3 +- .../client/petstore/python-aiohttp/README.md | 1 - .../python-aiohttp/docs/AnotherFakeApi.md | 2 - .../python-aiohttp/docs/DefaultApi.md | 2 - .../petstore/python-aiohttp/docs/FakeApi.md | 50 ---- .../docs/FakeClassnameTags123Api.md | 2 - .../petstore/python-aiohttp/docs/PetApi.md | 18 -- .../petstore/python-aiohttp/docs/StoreApi.md | 8 - .../petstore/python-aiohttp/docs/UserApi.md | 16 -- .../petstore_api/api/another_fake_api.py | 5 +- .../petstore_api/api/default_api.py | 5 +- .../petstore_api/api/fake_api.py | 15 +- .../api/fake_classname_tags123_api.py | 5 +- .../petstore_api/api/pet_api.py | 12 +- .../petstore_api/api/store_api.py | 11 +- .../petstore_api/api/user_api.py | 12 +- .../python-aiohttp/petstore_api/api_client.py | 1 - .../petstore_api/api_response.py | 2 +- .../models/additional_properties_any_type.py | 3 +- .../models/additional_properties_class.py | 3 +- .../models/additional_properties_object.py | 3 +- ...tional_properties_with_description_only.py | 3 +- .../models/all_of_with_single_ref.py | 4 +- .../petstore_api/models/animal.py | 4 +- .../petstore_api/models/any_of_color.py | 11 +- .../petstore_api/models/any_of_pig.py | 10 +- .../petstore_api/models/api_response.py | 3 +- .../models/array_of_array_of_model.py | 3 +- .../models/array_of_array_of_number_only.py | 4 +- .../models/array_of_number_only.py | 4 +- .../petstore_api/models/array_test.py | 4 +- .../petstore_api/models/basque_pig.py | 4 +- .../petstore_api/models/capitalization.py | 4 +- .../python-aiohttp/petstore_api/models/cat.py | 3 +- .../petstore_api/models/category.py | 3 +- .../models/circular_reference_model.py | 3 +- .../petstore_api/models/class_model.py | 4 +- .../petstore_api/models/client.py | 3 +- .../petstore_api/models/color.py | 14 +- .../petstore_api/models/creature.py | 3 +- .../petstore_api/models/creature_info.py | 3 +- .../petstore_api/models/danish_pig.py | 4 +- .../petstore_api/models/deprecated_object.py | 3 +- .../python-aiohttp/petstore_api/models/dog.py | 3 +- .../petstore_api/models/dummy_model.py | 3 +- .../petstore_api/models/enum_arrays.py | 3 +- .../petstore_api/models/enum_class.py | 10 +- .../petstore_api/models/enum_string1.py | 10 +- .../petstore_api/models/enum_string2.py | 10 +- .../petstore_api/models/enum_test.py | 4 +- .../petstore_api/models/file.py | 4 +- .../models/file_schema_test_class.py | 3 +- .../petstore_api/models/first_ref.py | 3 +- .../python-aiohttp/petstore_api/models/foo.py | 3 +- .../models/foo_get_default_response.py | 3 +- .../petstore_api/models/format_test.py | 5 +- .../petstore_api/models/has_only_read_only.py | 3 +- .../models/health_check_result.py | 4 +- .../models/inner_dict_with_property.py | 4 +- .../petstore_api/models/int_or_string.py | 14 +- .../petstore_api/models/list_class.py | 4 +- .../models/map_of_array_of_model.py | 4 +- .../petstore_api/models/map_test.py | 3 +- ...perties_and_additional_properties_class.py | 3 +- .../petstore_api/models/model200_response.py | 4 +- .../petstore_api/models/model_return.py | 4 +- .../petstore_api/models/name.py | 4 +- .../petstore_api/models/nullable_class.py | 2 +- .../petstore_api/models/nullable_property.py | 4 +- .../petstore_api/models/number_only.py | 4 +- .../object_to_test_additional_properties.py | 4 +- .../models/object_with_deprecated_fields.py | 4 +- .../petstore_api/models/one_of_enum_string.py | 13 +- .../petstore_api/models/order.py | 3 +- .../petstore_api/models/outer_composite.py | 3 +- .../petstore_api/models/outer_enum.py | 10 +- .../models/outer_enum_default_value.py | 10 +- .../petstore_api/models/outer_enum_integer.py | 10 +- .../outer_enum_integer_default_value.py | 10 +- .../models/outer_object_with_enum_property.py | 3 +- .../petstore_api/models/parent.py | 4 +- .../models/parent_with_optional_dict.py | 4 +- .../python-aiohttp/petstore_api/models/pet.py | 4 +- .../python-aiohttp/petstore_api/models/pig.py | 13 +- .../models/property_name_collision.py | 4 +- .../petstore_api/models/read_only_first.py | 3 +- .../petstore_api/models/second_ref.py | 3 +- .../models/self_reference_model.py | 3 +- .../petstore_api/models/single_ref_type.py | 10 +- .../models/special_character_enum.py | 10 +- .../petstore_api/models/special_model_name.py | 4 +- .../petstore_api/models/special_name.py | 4 +- .../python-aiohttp/petstore_api/models/tag.py | 3 +- ..._error_responses_with_model400_response.py | 3 +- ..._error_responses_with_model404_response.py | 3 +- ..._freeform_additional_properties_request.py | 4 +- .../petstore_api/models/tiger.py | 3 +- ...t_with_additional_model_list_properties.py | 4 +- ..._with_additional_string_list_properties.py | 4 +- .../petstore_api/models/user.py | 4 +- .../petstore_api/models/with_nested_one_of.py | 3 +- .../python-aiohttp/petstore_api/signing.py | 1 - .../openapi3/client/petstore/python/README.md | 1 - .../petstore/python/docs/AnotherFakeApi.md | 2 - .../client/petstore/python/docs/DefaultApi.md | 2 - .../client/petstore/python/docs/FakeApi.md | 50 ---- .../python/docs/FakeClassnameTags123Api.md | 2 - .../client/petstore/python/docs/PetApi.md | 18 -- .../client/petstore/python/docs/StoreApi.md | 8 - .../client/petstore/python/docs/UserApi.md | 16 -- .../petstore_api/api/another_fake_api.py | 5 +- .../python/petstore_api/api/default_api.py | 5 +- .../python/petstore_api/api/fake_api.py | 15 +- .../api/fake_classname_tags123_api.py | 5 +- .../python/petstore_api/api/pet_api.py | 12 +- .../python/petstore_api/api/store_api.py | 11 +- .../python/petstore_api/api/user_api.py | 12 +- .../python/petstore_api/api_client.py | 1 - .../python/petstore_api/api_response.py | 2 +- .../models/additional_properties_any_type.py | 3 +- .../models/additional_properties_class.py | 3 +- .../models/additional_properties_object.py | 3 +- ...tional_properties_with_description_only.py | 3 +- .../models/all_of_with_single_ref.py | 4 +- .../python/petstore_api/models/animal.py | 4 +- .../petstore_api/models/any_of_color.py | 11 +- .../python/petstore_api/models/any_of_pig.py | 10 +- .../petstore_api/models/api_response.py | 3 +- .../models/array_of_array_of_model.py | 3 +- .../models/array_of_array_of_number_only.py | 4 +- .../models/array_of_number_only.py | 4 +- .../python/petstore_api/models/array_test.py | 4 +- .../python/petstore_api/models/basque_pig.py | 4 +- .../petstore_api/models/capitalization.py | 4 +- .../python/petstore_api/models/cat.py | 3 +- .../python/petstore_api/models/category.py | 3 +- .../models/circular_reference_model.py | 3 +- .../python/petstore_api/models/class_model.py | 4 +- .../python/petstore_api/models/client.py | 3 +- .../python/petstore_api/models/color.py | 14 +- .../python/petstore_api/models/creature.py | 3 +- .../petstore_api/models/creature_info.py | 3 +- .../python/petstore_api/models/danish_pig.py | 4 +- .../petstore_api/models/deprecated_object.py | 3 +- .../python/petstore_api/models/dog.py | 3 +- .../python/petstore_api/models/dummy_model.py | 3 +- .../python/petstore_api/models/enum_arrays.py | 3 +- .../python/petstore_api/models/enum_class.py | 10 +- .../petstore_api/models/enum_string1.py | 10 +- .../petstore_api/models/enum_string2.py | 10 +- .../python/petstore_api/models/enum_test.py | 4 +- .../python/petstore_api/models/file.py | 4 +- .../models/file_schema_test_class.py | 3 +- .../python/petstore_api/models/first_ref.py | 3 +- .../python/petstore_api/models/foo.py | 3 +- .../models/foo_get_default_response.py | 3 +- .../python/petstore_api/models/format_test.py | 5 +- .../petstore_api/models/has_only_read_only.py | 3 +- .../models/health_check_result.py | 4 +- .../models/inner_dict_with_property.py | 4 +- .../petstore_api/models/int_or_string.py | 14 +- .../python/petstore_api/models/list_class.py | 4 +- .../models/map_of_array_of_model.py | 4 +- .../python/petstore_api/models/map_test.py | 3 +- ...perties_and_additional_properties_class.py | 3 +- .../petstore_api/models/model200_response.py | 4 +- .../petstore_api/models/model_return.py | 4 +- .../python/petstore_api/models/name.py | 4 +- .../petstore_api/models/nullable_class.py | 2 +- .../petstore_api/models/nullable_property.py | 4 +- .../python/petstore_api/models/number_only.py | 4 +- .../object_to_test_additional_properties.py | 4 +- .../models/object_with_deprecated_fields.py | 4 +- .../petstore_api/models/one_of_enum_string.py | 13 +- .../python/petstore_api/models/order.py | 3 +- .../petstore_api/models/outer_composite.py | 3 +- .../python/petstore_api/models/outer_enum.py | 10 +- .../models/outer_enum_default_value.py | 10 +- .../petstore_api/models/outer_enum_integer.py | 10 +- .../outer_enum_integer_default_value.py | 10 +- .../models/outer_object_with_enum_property.py | 3 +- .../python/petstore_api/models/parent.py | 4 +- .../models/parent_with_optional_dict.py | 4 +- .../python/petstore_api/models/pet.py | 4 +- .../python/petstore_api/models/pig.py | 13 +- .../models/property_name_collision.py | 4 +- .../petstore_api/models/read_only_first.py | 3 +- .../python/petstore_api/models/second_ref.py | 3 +- .../models/self_reference_model.py | 3 +- .../petstore_api/models/single_ref_type.py | 10 +- .../models/special_character_enum.py | 10 +- .../petstore_api/models/special_model_name.py | 4 +- .../petstore_api/models/special_name.py | 4 +- .../python/petstore_api/models/tag.py | 3 +- ..._error_responses_with_model400_response.py | 3 +- ..._error_responses_with_model404_response.py | 3 +- ..._freeform_additional_properties_request.py | 4 +- .../python/petstore_api/models/tiger.py | 3 +- ...t_with_additional_model_list_properties.py | 4 +- ..._with_additional_string_list_properties.py | 4 +- .../python/petstore_api/models/user.py | 4 +- .../petstore_api/models/with_nested_one_of.py | 3 +- .../petstore/python/petstore_api/signing.py | 1 - 266 files changed, 356 insertions(+), 1335 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java index e847d37af73..63dcef5d867 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java @@ -861,10 +861,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co // process enum in models objs = postProcessModelsEnum(objs); - // TODO: migrate almost (all?) everything to the `Imports` class. - TreeSet typingImports = new TreeSet<>(); - TreeSet pydanticImports = new TreeSet<>(); - TreeSet datetimeImports = new TreeSet<>(); + // TODO: migrate almost (all?) everything to the `PythonImports` class. TreeSet modelImports = new TreeSet<>(); TreeSet postponedModelImports = new TreeSet<>(); @@ -874,21 +871,16 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co List readOnlyFields = new ArrayList<>(); hasModelsToImport = false; int property_count = 1; - typingImports.clear(); - pydanticImports.clear(); - datetimeImports.clear(); - Imports otherImports = new Imports(); + PythonImports moduleImports = new PythonImports(); CodegenModel model = m.getModel(); + PydanticType pydantic = new PydanticType( - typingImports, - pydanticImports, - datetimeImports, modelImports, exampleImports, postponedModelImports, postponedExampleImports, - otherImports, + moduleImports, model.classname ); @@ -909,24 +901,24 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co List codegenProperties = null; if (!model.oneOf.isEmpty()) { // oneOfValidationError codegenProperties = model.getComposedSchemas().getOneOf(); - typingImports.add("Any"); - typingImports.add("List"); - pydanticImports.add("Field"); - pydanticImports.add("StrictStr"); - pydanticImports.add("ValidationError"); - pydanticImports.add("field_validator"); + moduleImports.add("typing", "Any"); + moduleImports.add("typing", "List"); + moduleImports.add("pydantic", "Field"); + moduleImports.add("pydantic", "StrictStr"); + moduleImports.add("pydantic", "ValidationError"); + moduleImports.add("pydantic", "field_validator"); } else if (!model.anyOf.isEmpty()) { // anyOF codegenProperties = model.getComposedSchemas().getAnyOf(); - pydanticImports.add("Field"); - pydanticImports.add("StrictStr"); - pydanticImports.add("ValidationError"); - pydanticImports.add("field_validator"); + moduleImports.add("pydantic", "Field"); + moduleImports.add("pydantic", "StrictStr"); + moduleImports.add("pydantic", "ValidationError"); + moduleImports.add("pydantic", "field_validator"); } else { // typical model codegenProperties = model.vars; // if super class if (model.getDiscriminator() != null && model.getDiscriminator().getMappedModels() != null) { - typingImports.add("Union"); + moduleImports.add("typing", "Union"); Set discriminator = model.getDiscriminator().getMappedModels(); for (CodegenDiscriminator.MappedModel mappedModel : discriminator) { postponedModelImports.add(mappedModel.getModelName()); @@ -948,11 +940,11 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co // if model_generic.mustache is used if (model.oneOf.isEmpty() && model.anyOf.isEmpty() && !model.isEnum) { - typingImports.add("ClassVar"); - typingImports.add("Dict"); - typingImports.add("Any"); + moduleImports.add("typing", "ClassVar"); + moduleImports.add("typing", "Dict"); + moduleImports.add("typing", "Any"); if(this.disallowAdditionalPropertiesIfNotPresent || model.isAdditionalPropertiesTrue) { - typingImports.add("List"); + moduleImports.add("typing", "List"); } } @@ -979,7 +971,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co if (!StringUtils.isEmpty(model.parent)) { modelImports.add(model.parent); } else if (!model.isEnum) { - pydanticImports.add("BaseModel"); + moduleImports.add("pydantic", "BaseModel"); } // set enum type in extensions and update `name` in enumVars @@ -997,9 +989,6 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co } // set the extensions if the key is absent - model.getVendorExtensions().putIfAbsent("x-py-typing-imports", typingImports); - model.getVendorExtensions().putIfAbsent("x-py-pydantic-imports", pydanticImports); - model.getVendorExtensions().putIfAbsent("x-py-datetime-imports", datetimeImports); model.getVendorExtensions().putIfAbsent("x-py-readonly", readOnlyFields); // import models one by one @@ -1011,7 +1000,6 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co continue; } modelsToImport.add("from " + packageName + ".models." + underscore(modelImport) + " import " + modelImport); - } if (!modelsToImport.isEmpty()) { @@ -1019,8 +1007,8 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co } } - if (!otherImports.isEmpty()) { - model.getVendorExtensions().putIfAbsent("x-py-other-imports", otherImports.exports()); + if (!moduleImports.isEmpty()) { + model.getVendorExtensions().putIfAbsent("x-py-other-imports", moduleImports.exports()); } @@ -1046,9 +1034,6 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co * Gets the pydantic type given a Codegen Property * * @param cp codegen property - * @param typingImports typing imports - * @param pydantic pydantic imports - * @param datetimeImports datetime imports * @param modelImports model imports * @param exampleImports example imports * @param postponedModelImports postponed model imports @@ -1058,24 +1043,18 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co * */ private PythonType getPydanticType(CodegenProperty cp, - Set typingImports, - Set pydanticImports, - Set datetimeImports, Set modelImports, Set exampleImports, Set postponedModelImports, Set postponedExampleImports, String classname) { - Imports otherImports = new Imports(); + PythonImports moduleImports = new PythonImports(); PydanticType pt = new PydanticType( - typingImports, - pydanticImports, - datetimeImports, modelImports, exampleImports, postponedModelImports, postponedExampleImports, - otherImports, + moduleImports, classname ); @@ -1228,31 +1207,27 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { hasModelsToImport = false; - // TODO: migrate almost (all?) everything to the `Imports` class. - TreeSet typingImports = new TreeSet<>(); - TreeSet pydanticImports = new TreeSet<>(); - TreeSet datetimeImports = new TreeSet<>(); TreeSet modelImports = new TreeSet<>(); TreeSet postponedModelImports = new TreeSet<>(); + PythonImports moduleImports = new PythonImports(); OperationMap objectMap = objs.getOperations(); List operations = objectMap.getOperation(); - Imports otherImports = new Imports(); - for (CodegenOperation operation : operations) { TreeSet exampleImports = new TreeSet<>(); // import for each operation to be show in sample code TreeSet postponedExampleImports = new TreeSet<>(); // import for each operation to be show in sample code List params = operation.allParams; - for (CodegenParameter cp : params) { PydanticType pydantic = new PydanticType( - typingImports, pydanticImports, datetimeImports, - modelImports, exampleImports, - postponedModelImports, postponedExampleImports, - otherImports, - null); + modelImports, + exampleImports, + postponedModelImports, + postponedExampleImports, + moduleImports, + null + ); String typing = pydantic.generatePythonType(cp); cp.vendorExtensions.put("x-py-typing", typing); } @@ -1260,8 +1235,14 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co // update typing import for operation return type if (!StringUtils.isEmpty(operation.returnType)) { // Not interested in the result, only in the update of the imports - getPydanticType(operation.returnProperty, typingImports, - new TreeSet<>() /* skip pydantic import for return type */, datetimeImports, modelImports, exampleImports, postponedModelImports, postponedExampleImports, null); + getPydanticType( + operation.returnProperty, + modelImports, + exampleImports, + postponedModelImports, + postponedExampleImports, + null + ); } // add import for code samples @@ -1289,33 +1270,12 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co List> newImports = new ArrayList<>(); - for (String importLine : otherImports.exports()) { + for (String importLine : moduleImports.exports()) { Map item = new HashMap<>(); item.put("import", importLine); newImports.add(item); } - // need datetime import - if (!datetimeImports.isEmpty()) { - Map item = new HashMap<>(); - item.put("import", String.format(Locale.ROOT, "from datetime import %s\n", StringUtils.join(datetimeImports, ", "))); - newImports.add(item); - } - - // need pydantic imports - if (!pydanticImports.isEmpty()) { - Map item = new HashMap<>(); - item.put("import", String.format(Locale.ROOT, "from pydantic import %s\n", StringUtils.join(pydanticImports, ", "))); - newImports.add(item); - } - - // need typing imports - if (!typingImports.isEmpty()) { - Map item = new HashMap<>(); - item.put("import", String.format(Locale.ROOT, "from typing import %s\n", StringUtils.join(typingImports, ", "))); - newImports.add(item); - } - // import models one by one if (!modelImports.isEmpty()) { for (String modelImport : modelImports) { @@ -1584,7 +1544,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co * the field / variable being defined are *not* part of the * constraints but part of the "type value". */ - public String asTypeConstraint(Imports imports) { + public String asTypeConstraint(PythonImports imports) { return asTypeConstraint(imports, false); } @@ -1599,11 +1559,11 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co * Note that the default value is not managed here, but directly in * the Mustache template. */ - public String asTypeConstraintWithAnnotations(Imports imports) { + public String asTypeConstraintWithAnnotations(PythonImports imports) { return asTypeConstraint(imports, true); } - private String asTypeConstraint(Imports imports, boolean withAnnotations) { + private String asTypeConstraint(PythonImports imports, boolean withAnnotations) { String typeParam = ""; if (this.typeParams.size() > 0) { List types = new ArrayList<>(); @@ -1657,7 +1617,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co * Constraints on the type are *not* part of the "type value", but are part of the "type constraints". */ @Nullable - public String asTypeValue(Imports imports) { + public String asTypeValue(PythonImports imports) { String defaultValue = this.defaultValue; if (this.annotations.size() > 0) { @@ -1687,7 +1647,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co /* Track the list of resources to imports from where. * - * Imports are tracked as a set of modules to import from, and actual + * PythonImports are tracked as a set of modules to import from, and actual * resources (classes, functions, etc.) to import. * * The same resource can be safely "imported" many times from the same @@ -1695,10 +1655,10 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co * entries will be automatically removed. * * */ - class Imports { + class PythonImports { private Map> imports; - public Imports() { + public PythonImports() { imports = new HashMap<>(); } @@ -1742,35 +1702,26 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co } class PydanticType { - private Set typingImports; - private Set pydanticImports; - private Set datetimeImports; private Set modelImports; private Set exampleImports; private Set postponedModelImports; private Set postponedExampleImports; - private Imports otherImports; + private PythonImports moduleImports; private String classname; public PydanticType( - Set typingImports, - Set pydanticImports, - Set datetimeImports, Set modelImports, Set exampleImports, Set postponedModelImports, Set postponedExampleImports, - Imports otherImports, + PythonImports moduleImports, String classname ) { - this.typingImports = typingImports; - this.pydanticImports = pydanticImports; - this.datetimeImports = datetimeImports; this.modelImports = modelImports; this.exampleImports = exampleImports; this.postponedModelImports = postponedModelImports; this.postponedExampleImports = postponedExampleImports; - this.otherImports = otherImports; + this.moduleImports = moduleImports; this.classname = classname; } @@ -1790,12 +1741,12 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co // random JSON serialization order, unable to easily serialize // to JSON, etc. //pt.setType("Set"); - //typingImports.add("Set"); + //moduleImports.add("typing", "Set"); pt.setType("List"); - typingImports.add("List"); + moduleImports.add("typing", "List"); } else { pt.setType("List"); - typingImports.add("List"); + moduleImports.add("typing", "List"); } pt.addTypeParam(getType(cp.getItems())); return pt; @@ -1816,24 +1767,24 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co } if (cp.getPattern() != null) { - pydanticImports.add("field_validator"); + moduleImports.add("pydantic", "field_validator"); // use validator instead as regex doesn't support flags, e.g. IGNORECASE //fieldCustomization.add(Locale.ROOT, String.format(Locale.ROOT, "regex=r'%s'", cp.getPattern())); } return pt; } else { if ("password".equals(cp.getFormat())) { // TDOO avoid using format, use `is` boolean flag instead - pydanticImports.add("SecretStr"); + moduleImports.add("pydantic", "SecretStr"); return new PythonType("SecretStr"); } else { - pydanticImports.add("StrictStr"); + moduleImports.add("pydantic", "StrictStr"); return new PythonType("StrictStr"); } } } private PythonType mapType(IJsonSchemaValidationProperties cp) { - typingImports.add("Dict"); + moduleImports.add("typing", "Dict"); PythonType pt = new PythonType("Dict"); pt.addTypeParam(new PythonType("str")); pt.addTypeParam(getType(cp.getItems())); @@ -1872,7 +1823,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co floatt.constrain("strict", true); intt.constrain("strict", true); - typingImports.add("Union"); + moduleImports.add("typing", "Union"); PythonType pt = new PythonType("Union"); pt.addTypeParam(floatt); pt.addTypeParam(intt); @@ -1885,15 +1836,15 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co } } else { if ("Union[StrictFloat, StrictInt]".equals(mapNumberTo)) { - typingImports.add("Union"); - pydanticImports.add("StrictFloat"); - pydanticImports.add("StrictInt"); + moduleImports.add("typing", "Union"); + moduleImports.add("pydantic", "StrictFloat"); + moduleImports.add("pydantic", "StrictInt"); PythonType pt = new PythonType("Union"); pt.addTypeParam(new PythonType("StrictFloat")); pt.addTypeParam(new PythonType("StrictInt")); return pt; } else if ("StrictFloat".equals(mapNumberTo)) { - pydanticImports.add("StrictFloat"); + moduleImports.add("pydantic", "StrictFloat"); return new PythonType("StrictFloat"); } else { return new PythonType("float"); @@ -1925,7 +1876,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co } return pt; } else { - pydanticImports.add("StrictInt"); + moduleImports.add("pydantic", "StrictInt"); return new PythonType("StrictInt"); } } @@ -1947,21 +1898,21 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co strt.constrain("min_length", cp.getMinLength()); } if (cp.getPattern() != null) { - pydanticImports.add("field_validator"); + moduleImports.add("pydantic", "field_validator"); // use validator instead as regex doesn't support flags, e.g. IGNORECASE //fieldCustomization.add(Locale.ROOT, String.format(Locale.ROOT, "regex=r'%s'", cp.getPattern())); } - typingImports.add("Union"); + moduleImports.add("typing", "Union"); PythonType pt = new PythonType("Union"); pt.addTypeParam(bytest); pt.addTypeParam(strt); return pt; } else { // same as above which has validation - pydanticImports.add("StrictBytes"); - pydanticImports.add("StrictStr"); - typingImports.add("Union"); + moduleImports.add("pydantic", "StrictBytes"); + moduleImports.add("pydantic", "StrictStr"); + moduleImports.add("typing", "Union"); PythonType pt = new PythonType("Union"); pt.addTypeParam(new PythonType("StrictBytes")); @@ -1971,13 +1922,13 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co } private PythonType boolType(IJsonSchemaValidationProperties cp) { - pydanticImports.add("StrictBool"); + moduleImports.add("pydantic", "StrictBool"); return new PythonType("StrictBool"); } private PythonType decimalType(IJsonSchemaValidationProperties cp) { PythonType pt = new PythonType("Decimal"); - otherImports.add("decimal", "Decimal"); + moduleImports.add("decimal", "Decimal"); if (cp.getHasValidation()) { // e.g. condecimal(ge=10, le=100, strict=True) @@ -2005,16 +1956,16 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co } private PythonType anyType(IJsonSchemaValidationProperties cp) { - typingImports.add("Any"); + moduleImports.add("typing", "Any"); return new PythonType("Any"); } private PythonType dateType(IJsonSchemaValidationProperties cp) { if (cp.getIsDate()) { - datetimeImports.add("date"); + moduleImports.add("datetime", "date"); } if (cp.getIsDateTime()) { - datetimeImports.add("datetime"); + moduleImports.add("datetime", "datetime"); } return new PythonType(cp.getDataType()); @@ -2036,12 +1987,12 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co if (cp == null) { // if codegen property (e.g. map/dict of undefined type) is null, default to string LOGGER.warn("Codegen property is null (e.g. map/dict of undefined type). Default to typing.Any."); - typingImports.add("Any"); + moduleImports.add("typing", "Any"); return new PythonType("Any"); } if (cp.getIsEnum()) { - pydanticImports.add("field_validator"); + moduleImports.add("pydantic", "field_validator"); } if (cp.getIsArray()) { @@ -2083,7 +2034,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co also need to put cp.isEnum check after isArray, isMap check if (cp.isEnum) { // use Literal for inline enum - typingImports.add("Literal"); + moduleImports.add("typing", "Literal"); List values = new ArrayList<>(); List> enumVars = (List>) cp.allowableValues.get("enumVars"); if (enumVars != null) { @@ -2132,7 +2083,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co private String finalizeType(CodegenProperty cp, PythonType pt) { if (!cp.required || cp.isNullable) { - typingImports.add("Optional"); + moduleImports.add("typing", "Optional"); PythonType opt = new PythonType("Optional"); opt.addTypeParam(pt); pt = opt; @@ -2167,8 +2118,8 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co } } - String typeConstraint = pt.asTypeConstraint(otherImports); - String typeValue = pt.asTypeValue(otherImports); + String typeConstraint = pt.asTypeConstraint(moduleImports); + String typeValue = pt.asTypeValue(moduleImports); if (typeValue == null) { return typeConstraint; @@ -2200,7 +2151,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co // TODO process the first one only at the moment if (cmt != null) // TODO: don't loop back to the deprecated getPydanticType method - return getPydanticType(cmt.getSchema(), typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, postponedModelImports, postponedExampleImports, classname); + return getPydanticType(cmt.getSchema(), modelImports, exampleImports, postponedModelImports, postponedExampleImports, classname); } throw new RuntimeException("Error! Failed to process getPydanticType when getting the content: " + cp); } else { @@ -2213,7 +2164,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co private String finalizeType(CodegenParameter cp, PythonType pt) { if (!cp.required || cp.isNullable) { - typingImports.add("Optional"); + moduleImports.add("typing", "Optional"); PythonType opt = new PythonType("Optional"); opt.addTypeParam(pt); pt = opt; @@ -2228,8 +2179,8 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co fields.add(String.format(Locale.ROOT, "example=%s", cp.getExample())); }*/ - //return pt.asTypeConstraint(otherImports); - return pt.asTypeConstraintWithAnnotations(otherImports); + //return pt.asTypeConstraint(moduleImports); + return pt.asTypeConstraintWithAnnotations(moduleImports); } } } diff --git a/modules/openapi-generator/src/main/resources/python/api.mustache b/modules/openapi-generator/src/main/resources/python/api.mustache index fdfbfbb872e..e7019bca899 100644 --- a/modules/openapi-generator/src/main/resources/python/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/api.mustache @@ -1,12 +1,9 @@ # coding: utf-8 {{>partial_header}} - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated @@ -170,7 +167,7 @@ class {{classname}}: {{#isBinary}} # convert to byte array if the input is a file name (str) if isinstance({{paramName}}, str): - with io.open({{paramName}}, "rb") as _fp: + with open({{paramName}}, "rb") as _fp: _body_params = _fp.read() else: _body_params = {{paramName}} diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 6744afb40c0..65637dd9786 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -2,7 +2,6 @@ {{>partial_header}} -import atexit import datetime from dateutil.parser import parse import json diff --git a/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache b/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache index ad276db2815..f5d7eef120b 100644 --- a/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache @@ -1,7 +1,5 @@ ```python -import time -import os import {{{packageName}}} {{#vendorExtensions.x-py-example-import}} {{{.}}} diff --git a/modules/openapi-generator/src/main/resources/python/api_response.mustache b/modules/openapi-generator/src/main/resources/python/api_response.mustache index 2ac1ada6e9b..288b2e9a254 100644 --- a/modules/openapi-generator/src/main/resources/python/api_response.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_response.mustache @@ -1,7 +1,7 @@ """API response object.""" from __future__ import annotations -from typing import Any, Dict, Optional, Generic, TypeVar +from typing import Dict, Optional, Generic, TypeVar from pydantic import Field, StrictInt, StrictStr, StrictBytes, BaseModel T = TypeVar("T") diff --git a/modules/openapi-generator/src/main/resources/python/common_README.mustache b/modules/openapi-generator/src/main/resources/python/common_README.mustache index 706d9b344b8..b7ce4615dfd 100644 --- a/modules/openapi-generator/src/main/resources/python/common_README.mustache +++ b/modules/openapi-generator/src/main/resources/python/common_README.mustache @@ -1,6 +1,5 @@ ```python {{#apiInfo}}{{#apis}}{{#-last}}{{#hasHttpSignatureMethods}}import datetime{{/hasHttpSignatureMethods}}{{/-last}}{{/apis}}{{/apiInfo}} -import time import {{{packageName}}} from {{{packageName}}}.rest import ApiException from pprint import pprint diff --git a/modules/openapi-generator/src/main/resources/python/model_anyof.mustache b/modules/openapi-generator/src/main/resources/python/model_anyof.mustache index 0d575011b26..9a22937cd2c 100644 --- a/modules/openapi-generator/src/main/resources/python/model_anyof.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_anyof.mustache @@ -3,9 +3,6 @@ from inspect import getfullargspec import json import pprint import re # noqa: F401 -{{#vendorExtensions.x-py-datetime-imports}}{{#-first}}from datetime import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-datetime-imports}} -{{#vendorExtensions.x-py-typing-imports}}{{#-first}}from typing import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-typing-imports}} -{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}} {{#vendorExtensions.x-py-other-imports}} {{{.}}} {{/vendorExtensions.x-py-other-imports}} @@ -13,12 +10,7 @@ import re # noqa: F401 {{{.}}} {{/vendorExtensions.x-py-model-imports}} from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict -from typing_extensions import Literal -from pydantic import StrictStr, Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Literal, Self {{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ANY_OF_SCHEMAS = [{{#anyOf}}"{{.}}"{{^-last}}, {{/-last}}{{/anyOf}}] diff --git a/modules/openapi-generator/src/main/resources/python/model_enum.mustache b/modules/openapi-generator/src/main/resources/python/model_enum.mustache index 0bd7dafbeef..3f449b121a3 100644 --- a/modules/openapi-generator/src/main/resources/python/model_enum.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_enum.mustache @@ -1,15 +1,10 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum -{{#vendorExtensions.x-py-datetime-imports}}{{#-first}}from datetime import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-datetime-imports}} -{{#vendorExtensions.x-py-typing-imports}}{{#-first}}from typing import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-typing-imports}} -{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}} -try: - from typing import Self -except ImportError: - from typing_extensions import Self +{{#vendorExtensions.x-py-other-imports}} +{{{.}}} +{{/vendorExtensions.x-py-other-imports}} +from typing_extensions import Self class {{classname}}({{vendorExtensions.x-py-enum-type}}, Enum): diff --git a/modules/openapi-generator/src/main/resources/python/model_generic.mustache b/modules/openapi-generator/src/main/resources/python/model_generic.mustache index 1b676e46955..7d300a1d392 100644 --- a/modules/openapi-generator/src/main/resources/python/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_generic.mustache @@ -3,9 +3,6 @@ import pprint import re # noqa: F401 import json -{{#vendorExtensions.x-py-datetime-imports}}{{#-first}}from datetime import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-datetime-imports}} -{{#vendorExtensions.x-py-typing-imports}}{{#-first}}from typing import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-typing-imports}} -{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}} {{#vendorExtensions.x-py-other-imports}} {{{.}}} {{/vendorExtensions.x-py-other-imports}} diff --git a/modules/openapi-generator/src/main/resources/python/model_oneof.mustache b/modules/openapi-generator/src/main/resources/python/model_oneof.mustache index b87c42cf2b9..0bd12fb44b5 100644 --- a/modules/openapi-generator/src/main/resources/python/model_oneof.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_oneof.mustache @@ -1,24 +1,15 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 -{{#vendorExtensions.x-py-datetime-imports}}{{#-first}}from datetime import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-datetime-imports}} -{{#vendorExtensions.x-py-typing-imports}}{{#-first}}from typing import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-typing-imports}} -{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}} {{#vendorExtensions.x-py-other-imports}} {{{.}}} {{/vendorExtensions.x-py-other-imports}} {{#vendorExtensions.x-py-model-imports}} {{{.}}} {{/vendorExtensions.x-py-model-imports}} -from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict -from typing_extensions import Literal from pydantic import StrictStr, Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self {{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ONE_OF_SCHEMAS = [{{#oneOf}}"{{.}}"{{^-last}}, {{/-last}}{{/oneOf}}] diff --git a/modules/openapi-generator/src/main/resources/python/model_test.mustache b/modules/openapi-generator/src/main/resources/python/model_test.mustache index 9919e3d7a40..e0364ce8c16 100644 --- a/modules/openapi-generator/src/main/resources/python/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_test.mustache @@ -3,7 +3,6 @@ {{>partial_header}} import unittest -import datetime {{#models}} {{#model}} diff --git a/modules/openapi-generator/src/main/resources/python/signing.mustache b/modules/openapi-generator/src/main/resources/python/signing.mustache index bb2850fdcc0..e22cabb209c 100644 --- a/modules/openapi-generator/src/main/resources/python/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/signing.mustache @@ -6,7 +6,6 @@ from Crypto.Hash import SHA256, SHA512 from Crypto.PublicKey import RSA, ECC from Crypto.Signature import PKCS1_v1_5, pss, DSS from email.utils import formatdate -import json import os import re from time import time diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/README.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/README.md index 628ec87c9a0..f44bd12c67c 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/README.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/README.md @@ -50,7 +50,6 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python -import time import openapi_client from openapi_client.rest import ApiException from pprint import pprint diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/AuthApi.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/AuthApi.md index cacdad3a561..507592b4811 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/AuthApi.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/AuthApi.md @@ -20,8 +20,6 @@ To test HTTP basic authentication * Basic Authentication (http_auth): ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -96,8 +94,6 @@ To test HTTP bearer authentication * Bearer Authentication (http_bearer_auth): ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/BodyApi.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/BodyApi.md index a0f96e88f98..acfbe28268d 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/BodyApi.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/BodyApi.md @@ -26,8 +26,6 @@ Test binary (gif) response body ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -91,8 +89,6 @@ Test body parameter(s) ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -160,8 +156,6 @@ Test array of binary in multipart mime ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -229,8 +223,6 @@ Test single binary in multipart mime ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -298,8 +290,6 @@ Test body parameter(s) ```python -import time -import os import openapi_client from openapi_client.models.pet import Pet from openapi_client.rest import ApiException @@ -368,8 +358,6 @@ Test free form object ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -437,8 +425,6 @@ Test body parameter(s) ```python -import time -import os import openapi_client from openapi_client.models.pet import Pet from openapi_client.rest import ApiException @@ -507,8 +493,6 @@ Test empty response body ```python -import time -import os import openapi_client from openapi_client.models.pet import Pet from openapi_client.rest import ApiException @@ -577,8 +561,6 @@ Test empty json (request body) ```python -import time -import os import openapi_client from openapi_client.models.tag import Tag from openapi_client.rest import ApiException diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/FormApi.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/FormApi.md index 711b2607502..94205cd60e4 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/FormApi.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/FormApi.md @@ -19,8 +19,6 @@ Test form parameter(s) ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -92,8 +90,6 @@ Test form parameter(s) for oneOf schema ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/HeaderApi.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/HeaderApi.md index 415ae68d518..137b5c00d10 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/HeaderApi.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/HeaderApi.md @@ -18,8 +18,6 @@ Test header parameter(s) ```python -import time -import os import openapi_client from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.rest import ApiException diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/PathApi.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/PathApi.md index f168f8a2182..dd9362bb746 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/PathApi.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/PathApi.md @@ -18,8 +18,6 @@ Test path parameter(s) ```python -import time -import os import openapi_client from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.rest import ApiException diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/QueryApi.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/QueryApi.md index a493b319696..e84a872066f 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/QueryApi.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/docs/QueryApi.md @@ -25,8 +25,6 @@ Test query parameter(s) ```python -import time -import os import openapi_client from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.rest import ApiException @@ -97,8 +95,6 @@ Test query parameter(s) ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -170,8 +166,6 @@ Test query parameter(s) ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -243,8 +237,6 @@ Test query parameter(s) ```python -import time -import os import openapi_client from openapi_client.models.pet import Pet from openapi_client.rest import ApiException @@ -313,8 +305,6 @@ Test query parameter(s) ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -382,8 +372,6 @@ Test query parameter(s) ```python -import time -import os import openapi_client from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter from openapi_client.rest import ApiException @@ -452,8 +440,6 @@ Test query parameter(s) ```python -import time -import os import openapi_client from openapi_client.models.pet import Pet from openapi_client.rest import ApiException @@ -522,8 +508,6 @@ Test query parameter(s) ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/auth_api.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/auth_api.py index 82740c98af8..6089159d9dc 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/auth_api.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/auth_api.py @@ -12,12 +12,9 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/body_api.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/body_api.py index 77bd5615092..0c3415d049e 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/body_api.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/body_api.py @@ -12,24 +12,18 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated except ImportError: from typing_extensions import Annotated -from pydantic import Field -from typing_extensions import Annotated -from pydantic import StrictBytes, StrictStr - +from pydantic import Field, StrictBytes, StrictStr from typing import Any, Dict, List, Optional, Union - +from typing_extensions import Annotated from openapi_client.models.pet import Pet from openapi_client.models.tag import Tag @@ -519,7 +513,7 @@ class BodyApi: if body is not None: # convert to byte array if the input is a file name (str) if isinstance(body, str): - with io.open(body, "rb") as _fp: + with open(body, "rb") as _fp: _body_params = _fp.read() else: _body_params = body diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/form_api.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/form_api.py index d3cc6a2f35b..55cbc8227e9 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/form_api.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/form_api.py @@ -12,12 +12,9 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated @@ -25,10 +22,8 @@ except ImportError: from typing_extensions import Annotated from pydantic import StrictBool, StrictInt, StrictStr - from typing import Optional - from openapi_client.api_client import ApiClient from openapi_client.api_response import ApiResponse from openapi_client.rest import RESTResponseType diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/header_api.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/header_api.py index 0303dd3710b..e69c8814384 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/header_api.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/header_api.py @@ -12,12 +12,9 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated @@ -25,9 +22,7 @@ except ImportError: from typing_extensions import Annotated from pydantic import StrictBool, StrictInt, StrictStr, field_validator - from typing import Optional - from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.api_client import ApiClient diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/path_api.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/path_api.py index f7e4a3e2003..d5ce7455048 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/path_api.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/path_api.py @@ -12,12 +12,9 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated @@ -25,7 +22,6 @@ except ImportError: from typing_extensions import Annotated from pydantic import StrictInt, StrictStr, field_validator - from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.api_client import ApiClient diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/query_api.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/query_api.py index 8b37ac7bbe6..c0554ab3121 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/query_api.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api/query_api.py @@ -12,12 +12,9 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated @@ -25,11 +22,8 @@ except ImportError: from typing_extensions import Annotated from datetime import date, datetime - from pydantic import StrictBool, StrictInt, StrictStr, field_validator - from typing import Any, Optional - from openapi_client.models.pet import Pet from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api_client.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api_client.py index bdf8ec05b2d..1c13bc4fbb5 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api_client.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api_client.py @@ -13,7 +13,6 @@ """ # noqa: E501 -import atexit import datetime from dateutil.parser import parse import json diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api_response.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api_response.py index 2ac1ada6e9b..288b2e9a254 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api_response.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api_response.py @@ -1,7 +1,7 @@ """API response object.""" from __future__ import annotations -from typing import Any, Dict, Optional, Generic, TypeVar +from typing import Dict, Optional, Generic, TypeVar from pydantic import Field, StrictInt, StrictStr, StrictBytes, BaseModel T = TypeVar("T") diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/bird.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/bird.py index 37b2425aa6f..ff916fdb09d 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/bird.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/bird.py @@ -18,9 +18,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/category.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/category.py index 078fb655719..49090ded8f0 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/category.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/category.py @@ -18,9 +18,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/data_query.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/data_query.py index 49d1c4ec4eb..ca54503ddfb 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/data_query.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/data_query.py @@ -19,9 +19,8 @@ import re # noqa: F401 import json from datetime import datetime +from pydantic import Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import StrictStr -from pydantic import Field from openapi_client.models.query import Query try: from typing import Self diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/default_value.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/default_value.py index 809cb22027f..64335035f5e 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/default_value.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/default_value.py @@ -18,9 +18,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional from openapi_client.models.string_enum_ref import StringEnumRef try: from typing import Self diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/number_properties_only.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/number_properties_only.py index e5e6acc13b6..f45cf040f63 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/number_properties_only.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/number_properties_only.py @@ -18,10 +18,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictFloat, StrictInt from typing import Any, ClassVar, Dict, List, Optional, Union -from pydantic import BaseModel, StrictFloat, StrictInt -from pydantic import Field from typing_extensions import Annotated try: from typing import Self diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/pet.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/pet.py index 21276281a22..84b464d88e8 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/pet.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/pet.py @@ -18,10 +18,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr, field_validator -from pydantic import Field from openapi_client.models.category import Category from openapi_client.models.tag import Tag try: diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/query.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/query.py index 863b9e47782..7f3ba023a0e 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/query.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/query.py @@ -18,10 +18,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr, field_validator -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/string_enum_ref.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/string_enum_ref.py index cedd6194f98..90328aea76d 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/string_enum_ref.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/string_enum_ref.py @@ -15,16 +15,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class StringEnumRef(str, Enum): diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/tag.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/tag.py index de29129b4a6..62bdca91656 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/tag.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/tag.py @@ -18,9 +18,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py index 683221d51dc..6b8491fe9a3 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py @@ -18,9 +18,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py index 4e3509e9c6e..7a31be0d568 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py @@ -18,9 +18,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/client/echo_api/python/README.md b/samples/client/echo_api/python/README.md index 628ec87c9a0..f44bd12c67c 100644 --- a/samples/client/echo_api/python/README.md +++ b/samples/client/echo_api/python/README.md @@ -50,7 +50,6 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python -import time import openapi_client from openapi_client.rest import ApiException from pprint import pprint diff --git a/samples/client/echo_api/python/docs/AuthApi.md b/samples/client/echo_api/python/docs/AuthApi.md index cacdad3a561..507592b4811 100644 --- a/samples/client/echo_api/python/docs/AuthApi.md +++ b/samples/client/echo_api/python/docs/AuthApi.md @@ -20,8 +20,6 @@ To test HTTP basic authentication * Basic Authentication (http_auth): ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -96,8 +94,6 @@ To test HTTP bearer authentication * Bearer Authentication (http_bearer_auth): ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint diff --git a/samples/client/echo_api/python/docs/BodyApi.md b/samples/client/echo_api/python/docs/BodyApi.md index a0f96e88f98..acfbe28268d 100644 --- a/samples/client/echo_api/python/docs/BodyApi.md +++ b/samples/client/echo_api/python/docs/BodyApi.md @@ -26,8 +26,6 @@ Test binary (gif) response body ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -91,8 +89,6 @@ Test body parameter(s) ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -160,8 +156,6 @@ Test array of binary in multipart mime ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -229,8 +223,6 @@ Test single binary in multipart mime ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -298,8 +290,6 @@ Test body parameter(s) ```python -import time -import os import openapi_client from openapi_client.models.pet import Pet from openapi_client.rest import ApiException @@ -368,8 +358,6 @@ Test free form object ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -437,8 +425,6 @@ Test body parameter(s) ```python -import time -import os import openapi_client from openapi_client.models.pet import Pet from openapi_client.rest import ApiException @@ -507,8 +493,6 @@ Test empty response body ```python -import time -import os import openapi_client from openapi_client.models.pet import Pet from openapi_client.rest import ApiException @@ -577,8 +561,6 @@ Test empty json (request body) ```python -import time -import os import openapi_client from openapi_client.models.tag import Tag from openapi_client.rest import ApiException diff --git a/samples/client/echo_api/python/docs/FormApi.md b/samples/client/echo_api/python/docs/FormApi.md index 711b2607502..94205cd60e4 100644 --- a/samples/client/echo_api/python/docs/FormApi.md +++ b/samples/client/echo_api/python/docs/FormApi.md @@ -19,8 +19,6 @@ Test form parameter(s) ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -92,8 +90,6 @@ Test form parameter(s) for oneOf schema ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint diff --git a/samples/client/echo_api/python/docs/HeaderApi.md b/samples/client/echo_api/python/docs/HeaderApi.md index 415ae68d518..137b5c00d10 100644 --- a/samples/client/echo_api/python/docs/HeaderApi.md +++ b/samples/client/echo_api/python/docs/HeaderApi.md @@ -18,8 +18,6 @@ Test header parameter(s) ```python -import time -import os import openapi_client from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.rest import ApiException diff --git a/samples/client/echo_api/python/docs/PathApi.md b/samples/client/echo_api/python/docs/PathApi.md index f168f8a2182..dd9362bb746 100644 --- a/samples/client/echo_api/python/docs/PathApi.md +++ b/samples/client/echo_api/python/docs/PathApi.md @@ -18,8 +18,6 @@ Test path parameter(s) ```python -import time -import os import openapi_client from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.rest import ApiException diff --git a/samples/client/echo_api/python/docs/QueryApi.md b/samples/client/echo_api/python/docs/QueryApi.md index a493b319696..e84a872066f 100644 --- a/samples/client/echo_api/python/docs/QueryApi.md +++ b/samples/client/echo_api/python/docs/QueryApi.md @@ -25,8 +25,6 @@ Test query parameter(s) ```python -import time -import os import openapi_client from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.rest import ApiException @@ -97,8 +95,6 @@ Test query parameter(s) ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -170,8 +166,6 @@ Test query parameter(s) ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -243,8 +237,6 @@ Test query parameter(s) ```python -import time -import os import openapi_client from openapi_client.models.pet import Pet from openapi_client.rest import ApiException @@ -313,8 +305,6 @@ Test query parameter(s) ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -382,8 +372,6 @@ Test query parameter(s) ```python -import time -import os import openapi_client from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter from openapi_client.rest import ApiException @@ -452,8 +440,6 @@ Test query parameter(s) ```python -import time -import os import openapi_client from openapi_client.models.pet import Pet from openapi_client.rest import ApiException @@ -522,8 +508,6 @@ Test query parameter(s) ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint diff --git a/samples/client/echo_api/python/openapi_client/api/auth_api.py b/samples/client/echo_api/python/openapi_client/api/auth_api.py index 82740c98af8..6089159d9dc 100644 --- a/samples/client/echo_api/python/openapi_client/api/auth_api.py +++ b/samples/client/echo_api/python/openapi_client/api/auth_api.py @@ -12,12 +12,9 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated diff --git a/samples/client/echo_api/python/openapi_client/api/body_api.py b/samples/client/echo_api/python/openapi_client/api/body_api.py index 77bd5615092..0c3415d049e 100644 --- a/samples/client/echo_api/python/openapi_client/api/body_api.py +++ b/samples/client/echo_api/python/openapi_client/api/body_api.py @@ -12,24 +12,18 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated except ImportError: from typing_extensions import Annotated -from pydantic import Field -from typing_extensions import Annotated -from pydantic import StrictBytes, StrictStr - +from pydantic import Field, StrictBytes, StrictStr from typing import Any, Dict, List, Optional, Union - +from typing_extensions import Annotated from openapi_client.models.pet import Pet from openapi_client.models.tag import Tag @@ -519,7 +513,7 @@ class BodyApi: if body is not None: # convert to byte array if the input is a file name (str) if isinstance(body, str): - with io.open(body, "rb") as _fp: + with open(body, "rb") as _fp: _body_params = _fp.read() else: _body_params = body diff --git a/samples/client/echo_api/python/openapi_client/api/form_api.py b/samples/client/echo_api/python/openapi_client/api/form_api.py index d3cc6a2f35b..55cbc8227e9 100644 --- a/samples/client/echo_api/python/openapi_client/api/form_api.py +++ b/samples/client/echo_api/python/openapi_client/api/form_api.py @@ -12,12 +12,9 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated @@ -25,10 +22,8 @@ except ImportError: from typing_extensions import Annotated from pydantic import StrictBool, StrictInt, StrictStr - from typing import Optional - from openapi_client.api_client import ApiClient from openapi_client.api_response import ApiResponse from openapi_client.rest import RESTResponseType diff --git a/samples/client/echo_api/python/openapi_client/api/header_api.py b/samples/client/echo_api/python/openapi_client/api/header_api.py index 0303dd3710b..e69c8814384 100644 --- a/samples/client/echo_api/python/openapi_client/api/header_api.py +++ b/samples/client/echo_api/python/openapi_client/api/header_api.py @@ -12,12 +12,9 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated @@ -25,9 +22,7 @@ except ImportError: from typing_extensions import Annotated from pydantic import StrictBool, StrictInt, StrictStr, field_validator - from typing import Optional - from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.api_client import ApiClient diff --git a/samples/client/echo_api/python/openapi_client/api/path_api.py b/samples/client/echo_api/python/openapi_client/api/path_api.py index f7e4a3e2003..d5ce7455048 100644 --- a/samples/client/echo_api/python/openapi_client/api/path_api.py +++ b/samples/client/echo_api/python/openapi_client/api/path_api.py @@ -12,12 +12,9 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated @@ -25,7 +22,6 @@ except ImportError: from typing_extensions import Annotated from pydantic import StrictInt, StrictStr, field_validator - from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.api_client import ApiClient diff --git a/samples/client/echo_api/python/openapi_client/api/query_api.py b/samples/client/echo_api/python/openapi_client/api/query_api.py index 8b37ac7bbe6..c0554ab3121 100644 --- a/samples/client/echo_api/python/openapi_client/api/query_api.py +++ b/samples/client/echo_api/python/openapi_client/api/query_api.py @@ -12,12 +12,9 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated @@ -25,11 +22,8 @@ except ImportError: from typing_extensions import Annotated from datetime import date, datetime - from pydantic import StrictBool, StrictInt, StrictStr, field_validator - from typing import Any, Optional - from openapi_client.models.pet import Pet from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter diff --git a/samples/client/echo_api/python/openapi_client/api_client.py b/samples/client/echo_api/python/openapi_client/api_client.py index bdf8ec05b2d..1c13bc4fbb5 100644 --- a/samples/client/echo_api/python/openapi_client/api_client.py +++ b/samples/client/echo_api/python/openapi_client/api_client.py @@ -13,7 +13,6 @@ """ # noqa: E501 -import atexit import datetime from dateutil.parser import parse import json diff --git a/samples/client/echo_api/python/openapi_client/api_response.py b/samples/client/echo_api/python/openapi_client/api_response.py index 2ac1ada6e9b..288b2e9a254 100644 --- a/samples/client/echo_api/python/openapi_client/api_response.py +++ b/samples/client/echo_api/python/openapi_client/api_response.py @@ -1,7 +1,7 @@ """API response object.""" from __future__ import annotations -from typing import Any, Dict, Optional, Generic, TypeVar +from typing import Dict, Optional, Generic, TypeVar from pydantic import Field, StrictInt, StrictStr, StrictBytes, BaseModel T = TypeVar("T") diff --git a/samples/client/echo_api/python/openapi_client/models/bird.py b/samples/client/echo_api/python/openapi_client/models/bird.py index 912e333dfcf..35d5ad08d8b 100644 --- a/samples/client/echo_api/python/openapi_client/models/bird.py +++ b/samples/client/echo_api/python/openapi_client/models/bird.py @@ -18,9 +18,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/client/echo_api/python/openapi_client/models/category.py b/samples/client/echo_api/python/openapi_client/models/category.py index ce51a55a27e..9c93ae9497e 100644 --- a/samples/client/echo_api/python/openapi_client/models/category.py +++ b/samples/client/echo_api/python/openapi_client/models/category.py @@ -18,9 +18,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/client/echo_api/python/openapi_client/models/data_query.py b/samples/client/echo_api/python/openapi_client/models/data_query.py index 03d979ce5f3..187cdbb3f11 100644 --- a/samples/client/echo_api/python/openapi_client/models/data_query.py +++ b/samples/client/echo_api/python/openapi_client/models/data_query.py @@ -19,9 +19,8 @@ import re # noqa: F401 import json from datetime import datetime +from pydantic import Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import StrictStr -from pydantic import Field from openapi_client.models.query import Query try: from typing import Self diff --git a/samples/client/echo_api/python/openapi_client/models/default_value.py b/samples/client/echo_api/python/openapi_client/models/default_value.py index fac957f7aaa..736af463f95 100644 --- a/samples/client/echo_api/python/openapi_client/models/default_value.py +++ b/samples/client/echo_api/python/openapi_client/models/default_value.py @@ -18,9 +18,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional from openapi_client.models.string_enum_ref import StringEnumRef try: from typing import Self diff --git a/samples/client/echo_api/python/openapi_client/models/number_properties_only.py b/samples/client/echo_api/python/openapi_client/models/number_properties_only.py index b149da3a87d..3fff7137780 100644 --- a/samples/client/echo_api/python/openapi_client/models/number_properties_only.py +++ b/samples/client/echo_api/python/openapi_client/models/number_properties_only.py @@ -18,10 +18,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictFloat, StrictInt from typing import Any, ClassVar, Dict, List, Optional, Union -from pydantic import BaseModel, StrictFloat, StrictInt -from pydantic import Field from typing_extensions import Annotated try: from typing import Self diff --git a/samples/client/echo_api/python/openapi_client/models/pet.py b/samples/client/echo_api/python/openapi_client/models/pet.py index 08269b0eabf..89c54fb4155 100644 --- a/samples/client/echo_api/python/openapi_client/models/pet.py +++ b/samples/client/echo_api/python/openapi_client/models/pet.py @@ -18,10 +18,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr, field_validator -from pydantic import Field from openapi_client.models.category import Category from openapi_client.models.tag import Tag try: diff --git a/samples/client/echo_api/python/openapi_client/models/query.py b/samples/client/echo_api/python/openapi_client/models/query.py index 863b9e47782..7f3ba023a0e 100644 --- a/samples/client/echo_api/python/openapi_client/models/query.py +++ b/samples/client/echo_api/python/openapi_client/models/query.py @@ -18,10 +18,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr, field_validator -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/client/echo_api/python/openapi_client/models/string_enum_ref.py b/samples/client/echo_api/python/openapi_client/models/string_enum_ref.py index cedd6194f98..90328aea76d 100644 --- a/samples/client/echo_api/python/openapi_client/models/string_enum_ref.py +++ b/samples/client/echo_api/python/openapi_client/models/string_enum_ref.py @@ -15,16 +15,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class StringEnumRef(str, Enum): diff --git a/samples/client/echo_api/python/openapi_client/models/tag.py b/samples/client/echo_api/python/openapi_client/models/tag.py index fa3745c26a6..eff52563d28 100644 --- a/samples/client/echo_api/python/openapi_client/models/tag.py +++ b/samples/client/echo_api/python/openapi_client/models/tag.py @@ -18,9 +18,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/client/echo_api/python/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py b/samples/client/echo_api/python/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py index 1929f6cf546..47377d11bc9 100644 --- a/samples/client/echo_api/python/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py +++ b/samples/client/echo_api/python/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py @@ -18,9 +18,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/client/echo_api/python/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py b/samples/client/echo_api/python/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py index d1d85efa1d5..326531ab6f7 100644 --- a/samples/client/echo_api/python/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py +++ b/samples/client/echo_api/python/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py @@ -18,9 +18,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/README.md b/samples/openapi3/client/petstore/python-aiohttp/README.md index 3506f64f00c..66dc3dd4d2b 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/README.md +++ b/samples/openapi3/client/petstore/python-aiohttp/README.md @@ -50,7 +50,6 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python import datetime -import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-aiohttp/docs/AnotherFakeApi.md index 4a21357b454..59bc936ed5e 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/AnotherFakeApi.md @@ -18,8 +18,6 @@ To test special tags and operation ID starting with number ```python -import time -import os import petstore_api from petstore_api.models.client import Client from petstore_api.rest import ApiException diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-aiohttp/docs/DefaultApi.md index 29da00aa707..d1ffeafbca3 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/DefaultApi.md @@ -16,8 +16,6 @@ Method | HTTP request | Description ```python -import time -import os import petstore_api from petstore_api.models.foo_get_default_response import FooGetDefaultResponse from petstore_api.rest import ApiException diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md b/samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md index 8fc15e4dba8..8a41aed5f77 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md @@ -40,8 +40,6 @@ test any type request body ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -105,8 +103,6 @@ test enum reference query parameter ```python -import time -import os import petstore_api from petstore_api.models.enum_class import EnumClass from petstore_api.rest import ApiException @@ -171,8 +167,6 @@ Health check endpoint ```python -import time -import os import petstore_api from petstore_api.models.health_check_result import HealthCheckResult from petstore_api.rest import ApiException @@ -235,8 +229,6 @@ test http signature authentication ```python -import time -import os import petstore_api from petstore_api.models.pet import Pet from petstore_api.rest import ApiException @@ -374,8 +366,6 @@ Test serialization of outer boolean types ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -442,8 +432,6 @@ Test serialization of object with outer number type ```python -import time -import os import petstore_api from petstore_api.models.outer_composite import OuterComposite from petstore_api.rest import ApiException @@ -511,8 +499,6 @@ Test serialization of outer number types ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -579,8 +565,6 @@ Test serialization of outer string types ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -647,8 +631,6 @@ Test serialization of enum (int) properties with examples ```python -import time -import os import petstore_api from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty from petstore_api.rest import ApiException @@ -714,8 +696,6 @@ test ref to enum string ```python -import time -import os import petstore_api from petstore_api.models.enum_class import EnumClass from petstore_api.rest import ApiException @@ -778,8 +758,6 @@ test returning list of objects ```python -import time -import os import petstore_api from petstore_api.models.tag import Tag from petstore_api.rest import ApiException @@ -842,8 +820,6 @@ test uuid example ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -909,8 +885,6 @@ For this test, the body has to be a binary file. ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -975,8 +949,6 @@ For this test, the body for this request must reference a schema named `File`. ```python -import time -import os import petstore_api from petstore_api.models.file_schema_test_class import FileSchemaTestClass from petstore_api.rest import ApiException @@ -1040,8 +1012,6 @@ No authorization required ```python -import time -import os import petstore_api from petstore_api.models.user import User from petstore_api.rest import ApiException @@ -1109,8 +1079,6 @@ To test \"client\" model ```python -import time -import os import petstore_api from petstore_api.models.client import Client from petstore_api.rest import ApiException @@ -1177,8 +1145,6 @@ No authorization required ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -1245,8 +1211,6 @@ test empty and non-empty responses ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -1310,8 +1274,6 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン * Basic Authentication (http_basic_test): ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -1414,8 +1376,6 @@ test error responses with model ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -1480,8 +1440,6 @@ Fake endpoint to test group parameters (optional) * Bearer (JWT) Authentication (bearer_test): ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -1566,8 +1524,6 @@ test inline additionalProperties ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -1633,8 +1589,6 @@ test inline free-form additionalProperties ```python -import time -import os import petstore_api from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest from petstore_api.rest import ApiException @@ -1701,8 +1655,6 @@ test json serialization of form data ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -1770,8 +1722,6 @@ To test the collection format in query parameters ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-aiohttp/docs/FakeClassnameTags123Api.md index 3ad81d2673b..d0d98577a5a 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/FakeClassnameTags123Api.md @@ -19,8 +19,6 @@ To test class name in snake case * Api Key Authentication (api_key_query): ```python -import time -import os import petstore_api from petstore_api.models.client import Client from petstore_api.rest import ApiException diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/PetApi.md b/samples/openapi3/client/petstore/python-aiohttp/docs/PetApi.md index 2253bdbbfa9..a5a47569894 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/PetApi.md @@ -27,8 +27,6 @@ Add a new pet to the store * OAuth Authentication (petstore_auth): ```python -import time -import os import petstore_api from petstore_api.models.pet import Pet from petstore_api.rest import ApiException @@ -166,8 +164,6 @@ Deletes a pet * OAuth Authentication (petstore_auth): ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -243,8 +239,6 @@ Multiple status values can be provided with comma separated strings * OAuth Authentication (petstore_auth): ```python -import time -import os import petstore_api from petstore_api.models.pet import Pet from petstore_api.rest import ApiException @@ -384,8 +378,6 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 * OAuth Authentication (petstore_auth): ```python -import time -import os import petstore_api from petstore_api.models.pet import Pet from petstore_api.rest import ApiException @@ -525,8 +517,6 @@ Returns a single pet * Api Key Authentication (api_key): ```python -import time -import os import petstore_api from petstore_api.models.pet import Pet from petstore_api.rest import ApiException @@ -608,8 +598,6 @@ Update an existing pet * OAuth Authentication (petstore_auth): ```python -import time -import os import petstore_api from petstore_api.models.pet import Pet from petstore_api.rest import ApiException @@ -749,8 +737,6 @@ Updates a pet in the store with form data * OAuth Authentication (petstore_auth): ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -828,8 +814,6 @@ uploads an image * OAuth Authentication (petstore_auth): ```python -import time -import os import petstore_api from petstore_api.models.api_response import ApiResponse from petstore_api.rest import ApiException @@ -909,8 +893,6 @@ uploads an image (required) * OAuth Authentication (petstore_auth): ```python -import time -import os import petstore_api from petstore_api.models.api_response import ApiResponse from petstore_api.rest import ApiException diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/StoreApi.md b/samples/openapi3/client/petstore/python-aiohttp/docs/StoreApi.md index e6f5b2781ed..27f240911fc 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/StoreApi.md @@ -21,8 +21,6 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -90,8 +88,6 @@ Returns a map of status codes to quantities * Api Key Authentication (api_key): ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -165,8 +161,6 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ```python -import time -import os import petstore_api from petstore_api.models.order import Order from petstore_api.rest import ApiException @@ -237,8 +231,6 @@ Place an order for a pet ```python -import time -import os import petstore_api from petstore_api.models.order import Order from petstore_api.rest import ApiException diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/UserApi.md b/samples/openapi3/client/petstore/python-aiohttp/docs/UserApi.md index e064c2b6a5e..5bb4ccfdf22 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/UserApi.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/UserApi.md @@ -25,8 +25,6 @@ This can only be done by the logged in user. ```python -import time -import os import petstore_api from petstore_api.models.user import User from petstore_api.rest import ApiException @@ -93,8 +91,6 @@ Creates list of users with given input array ```python -import time -import os import petstore_api from petstore_api.models.user import User from petstore_api.rest import ApiException @@ -161,8 +157,6 @@ Creates list of users with given input array ```python -import time -import os import petstore_api from petstore_api.models.user import User from petstore_api.rest import ApiException @@ -229,8 +223,6 @@ This can only be done by the logged in user. ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -297,8 +289,6 @@ Get user by user name ```python -import time -import os import petstore_api from petstore_api.models.user import User from petstore_api.rest import ApiException @@ -369,8 +359,6 @@ Logs user into the system ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -441,8 +429,6 @@ Logs out current logged in user session ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -504,8 +490,6 @@ This can only be done by the logged in user. ```python -import time -import os import petstore_api from petstore_api.models.user import User from petstore_api.rest import ApiException diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/another_fake_api.py index 1ee8d84e833..2f279b0c965 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/another_fake_api.py @@ -11,12 +11,9 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/default_api.py index 3693f1c58e8..eb0fcccdc9c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/default_api.py @@ -11,12 +11,9 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py index f996f412563..1ab7a9407e1 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py @@ -11,26 +11,19 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated except ImportError: from typing_extensions import Annotated -from pydantic import Field -from typing_extensions import Annotated from datetime import date, datetime - -from pydantic import StrictBool, StrictBytes, StrictInt, StrictStr, field_validator - +from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr, field_validator from typing import Any, Dict, List, Optional, Union - +from typing_extensions import Annotated from petstore_api.models.client import Client from petstore_api.models.enum_class import EnumClass from petstore_api.models.file_schema_test_class import FileSchemaTestClass @@ -3409,7 +3402,7 @@ class FakeApi: if body is not None: # convert to byte array if the input is a file name (str) if isinstance(body, str): - with io.open(body, "rb") as _fp: + with open(body, "rb") as _fp: _body_params = _fp.read() else: _body_params = body diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_classname_tags123_api.py index a7c2ebcc402..00fe4e2e189 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_classname_tags123_api.py @@ -11,12 +11,9 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/pet_api.py index d9d939b6bab..8def4b1717a 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/pet_api.py @@ -11,24 +11,18 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated except ImportError: from typing_extensions import Annotated -from pydantic import Field -from typing_extensions import Annotated -from pydantic import StrictBytes, StrictInt, StrictStr, field_validator - +from pydantic import Field, StrictBytes, StrictInt, StrictStr, field_validator from typing import List, Optional, Union - +from typing_extensions import Annotated from petstore_api.models.api_response import ApiResponse from petstore_api.models.pet import Pet diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/store_api.py index 90066b44b28..f5db4f53a99 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/store_api.py @@ -11,24 +11,17 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated except ImportError: from typing_extensions import Annotated -from pydantic import Field +from pydantic import Field, StrictStr from typing_extensions import Annotated -from pydantic import StrictStr - -from typing import Dict - from petstore_api.models.order import Order from petstore_api.api_client import ApiClient diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/user_api.py index beaf3bbaca4..9666e87c922 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/user_api.py @@ -11,24 +11,18 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated except ImportError: from typing_extensions import Annotated -from pydantic import Field -from typing_extensions import Annotated -from pydantic import StrictStr - +from pydantic import Field, StrictStr from typing import List - +from typing_extensions import Annotated from petstore_api.models.user import User from petstore_api.api_client import ApiClient diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py index fe0b6e141bf..e554eaf3da3 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py @@ -12,7 +12,6 @@ """ # noqa: E501 -import atexit import datetime from dateutil.parser import parse import json diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_response.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_response.py index 2ac1ada6e9b..288b2e9a254 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_response.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_response.py @@ -1,7 +1,7 @@ """API response object.""" from __future__ import annotations -from typing import Any, Dict, Optional, Generic, TypeVar +from typing import Dict, Optional, Generic, TypeVar from pydantic import Field, StrictInt, StrictStr, StrictBytes, BaseModel T = TypeVar("T") diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_any_type.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_any_type.py index 2ce4d17e957..ffa1d02e5ad 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_any_type.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_any_type.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_class.py index 89990769e8b..947382b4651 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_class.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_object.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_object.py index 6d6fd8daf5f..e0bb54ce6b2 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_object.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_object.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_with_description_only.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_with_description_only.py index 9a41a8257f1..3b9878cd05f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_with_description_only.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/additional_properties_with_description_only.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/all_of_with_single_ref.py index 5113e44ff6b..b2f8e7135cd 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/all_of_with_single_ref.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/all_of_with_single_ref.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field from petstore_api.models.single_ref_type import SingleRefType try: from typing import Self diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py index 7fbe4d9e378..29e4eba868d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/animal.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_color.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_color.py index 7e8e6976ebc..18c98d1c1b8 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_color.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_color.py @@ -17,18 +17,11 @@ from inspect import getfullargspec import json import pprint import re # noqa: F401 - -from typing import List, Optional from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator -from pydantic import Field +from typing import List, Optional from typing_extensions import Annotated from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict -from typing_extensions import Literal -from pydantic import StrictStr, Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Literal, Self ANYOFCOLOR_ANY_OF_SCHEMAS = ["List[int]", "str"] diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_pig.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_pig.py index 4abe31fc06f..afe139277b8 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_pig.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_pig.py @@ -17,18 +17,12 @@ from inspect import getfullargspec import json import pprint import re # noqa: F401 - -from typing import Optional from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator +from typing import Optional from petstore_api.models.basque_pig import BasquePig from petstore_api.models.danish_pig import DanishPig from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict -from typing_extensions import Literal -from pydantic import StrictStr, Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Literal, Self ANYOFPIG_ANY_OF_SCHEMAS = ["BasquePig", "DanishPig"] diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/api_response.py index e358f2a5fdb..d25f6c2c006 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/api_response.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/api_response.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_array_of_model.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_array_of_model.py index de1c55eb1ac..96b3d6b87ae 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_array_of_model.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel +from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.tag import Tag try: from typing import Self diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_array_of_number_only.py index c1817cdf4f1..3ab36ec64f8 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_array_of_number_only.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_number_only.py index 653279be0ad..6c81d802aad 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_of_number_only.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_test.py index 51ea20fca90..3cd94fd9856 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_test.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/array_test.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr -from pydantic import Field from typing_extensions import Annotated from petstore_api.models.read_only_first import ReadOnlyFirst try: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/basque_pig.py index 9f53a04d9f1..7b308e9b94c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/basque_pig.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/basque_pig.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/capitalization.py index d5499384d47..9c5e93407ce 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/capitalization.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/cat.py index 01dcacf9ca4..41755e5ec78 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/cat.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import StrictBool +from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.animal import Animal try: from typing import Self diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/category.py index 5d7c648d5fb..6ad5af9fc3d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/category.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/circular_reference_model.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/circular_reference_model.py index 6ce8fec888c..ea651c4d8bf 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/circular_reference_model.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/circular_reference_model.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/class_model.py index 633147cd5bd..6d0ca1fe13b 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/class_model.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/class_model.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/client.py index 5f516b120ec..908a28e2902 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/client.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/color.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/color.py index 638d942a34e..09ef62c0d94 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/color.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/color.py @@ -13,22 +13,14 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - -from typing import Any, List, Optional from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator -from pydantic import Field +from typing import Any, List, Optional from typing_extensions import Annotated -from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict -from typing_extensions import Literal from pydantic import StrictStr, Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self COLOR_ONE_OF_SCHEMAS = ["List[int]", "str"] diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/creature.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/creature.py index 4c868095a25..1c025c06ebb 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/creature.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/creature.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List from petstore_api.models.creature_info import CreatureInfo try: from typing import Self diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/creature_info.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/creature_info.py index 3b80ab51ae8..4e95ba6fb53 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/creature_info.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/creature_info.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/danish_pig.py index 0dd8bfb9b0a..1310d5bc088 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/danish_pig.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/danish_pig.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictInt, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/deprecated_object.py index 6d0e0f1a892..5a34663af80 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/deprecated_object.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/deprecated_object.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/dog.py index 9c491abfe3c..04c77b83985 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/dog.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import StrictStr +from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.animal import Animal try: from typing import Self diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/dummy_model.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/dummy_model.py index ed7b3c13f9d..ac5d12ea578 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/dummy_model.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/dummy_model.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_arrays.py index b6e22b93932..acbe8dfa7a0 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_arrays.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_class.py index 11255f41897..1ba5af8036d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_class.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_class.py @@ -14,16 +14,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class EnumClass(str, Enum): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string1.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string1.py index efe9a605621..678b4e12661 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string1.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string1.py @@ -14,16 +14,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class EnumString1(str, Enum): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string2.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string2.py index 222c5dc6b82..a959f554e0a 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string2.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_string2.py @@ -14,16 +14,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class EnumString2(str, Enum): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_test.py index d6089937744..77c92d0c475 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_test.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr, field_validator -from pydantic import Field from petstore_api.models.outer_enum import OuterEnum from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue from petstore_api.models.outer_enum_integer import OuterEnumInteger diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/file.py index 418a72f7cb3..c8062e842dc 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/file.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/file_schema_test_class.py index 63ff3bcd8c8..ffd1c63ade4 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/file_schema_test_class.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel +from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.file import File try: from typing import Self diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/first_ref.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/first_ref.py index ca94567dafc..cbcfa274d84 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/first_ref.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/first_ref.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/foo.py index 134af2ba41b..c3d05d2f6dc 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/foo.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/foo_get_default_response.py index caa929d4ea8..6db91273b0b 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/foo_get_default_response.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/foo_get_default_response.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel +from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.foo import Foo try: from typing import Self diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/format_test.py index cf0d05f9e61..42cc4409b46 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/format_test.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/format_test.py @@ -18,10 +18,9 @@ import re # noqa: F401 import json from datetime import date, datetime -from typing import Any, ClassVar, Dict, List, Optional, Union -from pydantic import BaseModel, StrictBytes, StrictInt, StrictStr, field_validator from decimal import Decimal -from pydantic import Field +from pydantic import BaseModel, Field, StrictBytes, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union from typing_extensions import Annotated try: from typing import Self diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/has_only_read_only.py index 567237d61a8..d4a5717c168 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/has_only_read_only.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/health_check_result.py index 9b9ccf00c93..76ea4d60706 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/health_check_result.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/health_check_result.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/inner_dict_with_property.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/inner_dict_with_property.py index f93d19de93c..f0ca4b99a77 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/inner_dict_with_property.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/inner_dict_with_property.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/int_or_string.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/int_or_string.py index a7203af4ac5..b4309c79111 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/int_or_string.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/int_or_string.py @@ -13,22 +13,14 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - -from typing import Any, List, Optional from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator -from pydantic import Field +from typing import Any, List, Optional from typing_extensions import Annotated -from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict -from typing_extensions import Literal from pydantic import StrictStr, Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self INTORSTRING_ONE_OF_SCHEMAS = ["int", "str"] diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/list_class.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/list_class.py index bc8c47906e5..62c2568653c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/list_class.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/list_class.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/map_of_array_of_model.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/map_of_array_of_model.py index 62760259975..90fe15449cb 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/map_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/map_of_array_of_model.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel -from pydantic import Field from petstore_api.models.tag import Tag try: from typing import Self diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/map_test.py index c8f5ab91468..226dc899718 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/map_test.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/map_test.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py index f920ef230f7..154480cc710 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -18,9 +18,8 @@ import re # noqa: F401 import json from datetime import datetime +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field from petstore_api.models.animal import Animal try: from typing import Self diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model200_response.py index 1603076483e..c11b1397998 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model200_response.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model200_response.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_return.py index 87f9968d6a1..eb5f36ac7bd 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_return.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/model_return.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/name.py index 23e0d049281..b9d2532d45f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/name.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/nullable_class.py index d30916976ba..ffa309c4191 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/nullable_class.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/nullable_class.py @@ -18,8 +18,8 @@ import re # noqa: F401 import json from datetime import date, datetime -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/nullable_property.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/nullable_property.py index 14b8d854023..54793a3e9a8 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/nullable_property.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/nullable_property.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, field_validator from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, field_validator -from pydantic import Field from typing_extensions import Annotated try: from typing import Self diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/number_only.py index cf9be7a51a6..04d87e99525 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/number_only.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/number_only.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/object_to_test_additional_properties.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/object_to_test_additional_properties.py index e036dbf5a2e..765586ddcd5 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/object_to_test_additional_properties.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/object_to_test_additional_properties.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictBool from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictBool -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/object_with_deprecated_fields.py index 9acbb113b6c..c40a4e6de9c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/object_with_deprecated_fields.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/object_with_deprecated_fields.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field from petstore_api.models.deprecated_object import DeprecatedObject try: from typing import Self diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/one_of_enum_string.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/one_of_enum_string.py index b099c7bab57..0937e695ba8 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/one_of_enum_string.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/one_of_enum_string.py @@ -13,22 +13,15 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - -from typing import Any, List, Optional from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional from petstore_api.models.enum_string1 import EnumString1 from petstore_api.models.enum_string2 import EnumString2 -from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict -from typing_extensions import Literal from pydantic import StrictStr, Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self ONEOFENUMSTRING_ONE_OF_SCHEMAS = ["EnumString1", "EnumString2"] diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/order.py index a28b93ab9ae..77ac9a9231d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/order.py @@ -18,9 +18,8 @@ import re # noqa: F401 import json from datetime import datetime +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr, field_validator -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_composite.py index 1fae7664463..eb722068e29 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_composite.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_composite.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum.py index 89b19cbcf66..ac48cc0dc4d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum.py @@ -14,16 +14,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class OuterEnum(str, Enum): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_default_value.py index 51ca91443e2..99d6fd5fc04 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_default_value.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_default_value.py @@ -14,16 +14,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class OuterEnumDefaultValue(str, Enum): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_integer.py index 8947df65046..b771b7a61f5 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_integer.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_integer.py @@ -14,16 +14,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class OuterEnumInteger(int, Enum): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_integer_default_value.py index 970487bb0c4..8df41b2bd32 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_integer_default_value.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_enum_integer_default_value.py @@ -14,16 +14,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class OuterEnumIntegerDefaultValue(int, Enum): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_object_with_enum_property.py index a9771c1d8a1..7792ac50284 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_object_with_enum_property.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/outer_object_with_enum_property.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel +from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.outer_enum import OuterEnum from petstore_api.models.outer_enum_integer import OuterEnumInteger try: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/parent.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/parent.py index a7ea11a992b..84142593774 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/parent.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/parent.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel -from pydantic import Field from petstore_api.models.inner_dict_with_property import InnerDictWithProperty try: from typing import Self diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/parent_with_optional_dict.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/parent_with_optional_dict.py index a8753b9dc07..bb99cb9dc3b 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/parent_with_optional_dict.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/parent_with_optional_dict.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel -from pydantic import Field from petstore_api.models.inner_dict_with_property import InnerDictWithProperty try: from typing import Self diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pet.py index 92b9f77bc62..e03fa14d257 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pet.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr, field_validator -from pydantic import Field from typing_extensions import Annotated from petstore_api.models.category import Category from petstore_api.models.tag import Tag diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pig.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pig.py index f63458cd46e..d6a46cb9ed8 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pig.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pig.py @@ -13,22 +13,15 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - -from typing import Any, List, Optional from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional from petstore_api.models.basque_pig import BasquePig from petstore_api.models.danish_pig import DanishPig -from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict -from typing_extensions import Literal from pydantic import StrictStr, Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self PIG_ONE_OF_SCHEMAS = ["BasquePig", "DanishPig"] diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/property_name_collision.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/property_name_collision.py index 0db7bfbc310..75f8e2b37d9 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/property_name_collision.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/property_name_collision.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/read_only_first.py index 3e19a45c3d2..49ead921315 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/read_only_first.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/read_only_first.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/second_ref.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/second_ref.py index b62a2b70f8a..af988a86fc2 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/second_ref.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/second_ref.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/self_reference_model.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/self_reference_model.py index eb6f112f572..e11d1fb4ab9 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/self_reference_model.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/self_reference_model.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/single_ref_type.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/single_ref_type.py index 3c41c411865..91ab07e2535 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/single_ref_type.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/single_ref_type.py @@ -14,16 +14,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class SingleRefType(str, Enum): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_character_enum.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_character_enum.py index 77ed288a94b..1d85fd148d4 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_character_enum.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_character_enum.py @@ -14,16 +14,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class SpecialCharacterEnum(str, Enum): diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_model_name.py index 582effc78e1..46156ace002 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_model_name.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_model_name.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_name.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_name.py index ac035dded90..bfa50c24c61 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_name.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/special_name.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr, field_validator -from pydantic import Field from petstore_api.models.category import Category try: from typing import Self diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/tag.py index cbbc6c635d5..f4b1f4d65ad 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/tag.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py index bc6b9ea992f..5e2e6abdc1e 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model400_response.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py index 14afd3b169f..10549a0dd99 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_error_responses_with_model404_response.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py index c8d66e9d638..69897688097 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_inline_freeform_additional_properties_request.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/tiger.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/tiger.py index a84c0101129..6c58d853c62 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/tiger.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/tiger.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py index af26ad30973..94a232efd67 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel -from pydantic import Field from petstore_api.models.creature_info import CreatureInfo try: from typing import Self diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py index aee8e999daf..f8f0519a502 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/user.py index e2f5bb9c489..1607b7778d8 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/user.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/with_nested_one_of.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/with_nested_one_of.py index ccafcd94afa..18fa88ffc92 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/with_nested_one_of.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/with_nested_one_of.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt +from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.one_of_enum_string import OneOfEnumString from petstore_api.models.pig import Pig try: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/signing.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/signing.py index ec4d7d2a67f..1f15504ed66 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/signing.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/signing.py @@ -16,7 +16,6 @@ from Crypto.Hash import SHA256, SHA512 from Crypto.PublicKey import RSA, ECC from Crypto.Signature import PKCS1_v1_5, pss, DSS from email.utils import formatdate -import json import os import re from time import time diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index 2b705d722f3..fa96a49cf95 100755 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -50,7 +50,6 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python import datetime -import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint diff --git a/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md index 0871f368167..3ec02d261ee 100644 --- a/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md @@ -18,8 +18,6 @@ To test special tags and operation ID starting with number ```python -import time -import os import petstore_api from petstore_api.models.client import Client from petstore_api.rest import ApiException diff --git a/samples/openapi3/client/petstore/python/docs/DefaultApi.md b/samples/openapi3/client/petstore/python/docs/DefaultApi.md index 679fe7f48c4..634dc968842 100644 --- a/samples/openapi3/client/petstore/python/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/python/docs/DefaultApi.md @@ -16,8 +16,6 @@ Method | HTTP request | Description ```python -import time -import os import petstore_api from petstore_api.models.foo_get_default_response import FooGetDefaultResponse from petstore_api.rest import ApiException diff --git a/samples/openapi3/client/petstore/python/docs/FakeApi.md b/samples/openapi3/client/petstore/python/docs/FakeApi.md index 056e39cbbce..25167ead18e 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/FakeApi.md @@ -40,8 +40,6 @@ test any type request body ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -105,8 +103,6 @@ test enum reference query parameter ```python -import time -import os import petstore_api from petstore_api.models.enum_class import EnumClass from petstore_api.rest import ApiException @@ -171,8 +167,6 @@ Health check endpoint ```python -import time -import os import petstore_api from petstore_api.models.health_check_result import HealthCheckResult from petstore_api.rest import ApiException @@ -235,8 +229,6 @@ test http signature authentication ```python -import time -import os import petstore_api from petstore_api.models.pet import Pet from petstore_api.rest import ApiException @@ -374,8 +366,6 @@ Test serialization of outer boolean types ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -442,8 +432,6 @@ Test serialization of object with outer number type ```python -import time -import os import petstore_api from petstore_api.models.outer_composite import OuterComposite from petstore_api.rest import ApiException @@ -511,8 +499,6 @@ Test serialization of outer number types ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -579,8 +565,6 @@ Test serialization of outer string types ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -647,8 +631,6 @@ Test serialization of enum (int) properties with examples ```python -import time -import os import petstore_api from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty from petstore_api.rest import ApiException @@ -714,8 +696,6 @@ test ref to enum string ```python -import time -import os import petstore_api from petstore_api.models.enum_class import EnumClass from petstore_api.rest import ApiException @@ -778,8 +758,6 @@ test returning list of objects ```python -import time -import os import petstore_api from petstore_api.models.tag import Tag from petstore_api.rest import ApiException @@ -842,8 +820,6 @@ test uuid example ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -909,8 +885,6 @@ For this test, the body has to be a binary file. ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -975,8 +949,6 @@ For this test, the body for this request must reference a schema named `File`. ```python -import time -import os import petstore_api from petstore_api.models.file_schema_test_class import FileSchemaTestClass from petstore_api.rest import ApiException @@ -1040,8 +1012,6 @@ No authorization required ```python -import time -import os import petstore_api from petstore_api.models.user import User from petstore_api.rest import ApiException @@ -1109,8 +1079,6 @@ To test \"client\" model ```python -import time -import os import petstore_api from petstore_api.models.client import Client from petstore_api.rest import ApiException @@ -1177,8 +1145,6 @@ No authorization required ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -1245,8 +1211,6 @@ test empty and non-empty responses ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -1310,8 +1274,6 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン * Basic Authentication (http_basic_test): ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -1414,8 +1376,6 @@ test error responses with model ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -1480,8 +1440,6 @@ Fake endpoint to test group parameters (optional) * Bearer (JWT) Authentication (bearer_test): ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -1566,8 +1524,6 @@ test inline additionalProperties ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -1633,8 +1589,6 @@ test inline free-form additionalProperties ```python -import time -import os import petstore_api from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest from petstore_api.rest import ApiException @@ -1701,8 +1655,6 @@ test json serialization of form data ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -1770,8 +1722,6 @@ To test the collection format in query parameters ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint diff --git a/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md index ddbedb48c3e..5194f5a2eef 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md @@ -19,8 +19,6 @@ To test class name in snake case * Api Key Authentication (api_key_query): ```python -import time -import os import petstore_api from petstore_api.models.client import Client from petstore_api.rest import ApiException diff --git a/samples/openapi3/client/petstore/python/docs/PetApi.md b/samples/openapi3/client/petstore/python/docs/PetApi.md index 40f84eb3bd2..b618dddb62c 100644 --- a/samples/openapi3/client/petstore/python/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python/docs/PetApi.md @@ -27,8 +27,6 @@ Add a new pet to the store * OAuth Authentication (petstore_auth): ```python -import time -import os import petstore_api from petstore_api.models.pet import Pet from petstore_api.rest import ApiException @@ -166,8 +164,6 @@ Deletes a pet * OAuth Authentication (petstore_auth): ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -243,8 +239,6 @@ Multiple status values can be provided with comma separated strings * OAuth Authentication (petstore_auth): ```python -import time -import os import petstore_api from petstore_api.models.pet import Pet from petstore_api.rest import ApiException @@ -384,8 +378,6 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 * OAuth Authentication (petstore_auth): ```python -import time -import os import petstore_api from petstore_api.models.pet import Pet from petstore_api.rest import ApiException @@ -525,8 +517,6 @@ Returns a single pet * Api Key Authentication (api_key): ```python -import time -import os import petstore_api from petstore_api.models.pet import Pet from petstore_api.rest import ApiException @@ -608,8 +598,6 @@ Update an existing pet * OAuth Authentication (petstore_auth): ```python -import time -import os import petstore_api from petstore_api.models.pet import Pet from petstore_api.rest import ApiException @@ -749,8 +737,6 @@ Updates a pet in the store with form data * OAuth Authentication (petstore_auth): ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -828,8 +814,6 @@ uploads an image * OAuth Authentication (petstore_auth): ```python -import time -import os import petstore_api from petstore_api.models.api_response import ApiResponse from petstore_api.rest import ApiException @@ -909,8 +893,6 @@ uploads an image (required) * OAuth Authentication (petstore_auth): ```python -import time -import os import petstore_api from petstore_api.models.api_response import ApiResponse from petstore_api.rest import ApiException diff --git a/samples/openapi3/client/petstore/python/docs/StoreApi.md b/samples/openapi3/client/petstore/python/docs/StoreApi.md index e6328b984bd..19d6a89e5b9 100644 --- a/samples/openapi3/client/petstore/python/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/python/docs/StoreApi.md @@ -21,8 +21,6 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -90,8 +88,6 @@ Returns a map of status codes to quantities * Api Key Authentication (api_key): ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -165,8 +161,6 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ```python -import time -import os import petstore_api from petstore_api.models.order import Order from petstore_api.rest import ApiException @@ -237,8 +231,6 @@ Place an order for a pet ```python -import time -import os import petstore_api from petstore_api.models.order import Order from petstore_api.rest import ApiException diff --git a/samples/openapi3/client/petstore/python/docs/UserApi.md b/samples/openapi3/client/petstore/python/docs/UserApi.md index dcdfbf5c81d..a1e152924c0 100644 --- a/samples/openapi3/client/petstore/python/docs/UserApi.md +++ b/samples/openapi3/client/petstore/python/docs/UserApi.md @@ -25,8 +25,6 @@ This can only be done by the logged in user. ```python -import time -import os import petstore_api from petstore_api.models.user import User from petstore_api.rest import ApiException @@ -93,8 +91,6 @@ Creates list of users with given input array ```python -import time -import os import petstore_api from petstore_api.models.user import User from petstore_api.rest import ApiException @@ -161,8 +157,6 @@ Creates list of users with given input array ```python -import time -import os import petstore_api from petstore_api.models.user import User from petstore_api.rest import ApiException @@ -229,8 +223,6 @@ This can only be done by the logged in user. ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -297,8 +289,6 @@ Get user by user name ```python -import time -import os import petstore_api from petstore_api.models.user import User from petstore_api.rest import ApiException @@ -369,8 +359,6 @@ Logs user into the system ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -441,8 +429,6 @@ Logs out current logged in user session ```python -import time -import os import petstore_api from petstore_api.rest import ApiException from pprint import pprint @@ -504,8 +490,6 @@ This can only be done by the logged in user. ```python -import time -import os import petstore_api from petstore_api.models.user import User from petstore_api.rest import ApiException diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py index 6e02e2089eb..6d3a726ace5 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py @@ -11,12 +11,9 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py index 3f662edd5c8..b6c6ae525d9 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py @@ -11,12 +11,9 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py index 20e85ac2ac9..e58fc71034b 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py @@ -11,26 +11,19 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated except ImportError: from typing_extensions import Annotated -from pydantic import Field -from typing_extensions import Annotated from datetime import date, datetime - -from pydantic import StrictBool, StrictBytes, StrictFloat, StrictInt, StrictStr, field_validator - +from pydantic import Field, StrictBool, StrictBytes, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, Dict, List, Optional, Union - +from typing_extensions import Annotated from petstore_api.models.client import Client from petstore_api.models.enum_class import EnumClass from petstore_api.models.file_schema_test_class import FileSchemaTestClass @@ -3409,7 +3402,7 @@ class FakeApi: if body is not None: # convert to byte array if the input is a file name (str) if isinstance(body, str): - with io.open(body, "rb") as _fp: + with open(body, "rb") as _fp: _body_params = _fp.read() else: _body_params = body diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py index 04cc040e6fa..e4136cae176 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py @@ -11,12 +11,9 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py index fba079f8bce..695306c3e65 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py @@ -11,24 +11,18 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated except ImportError: from typing_extensions import Annotated -from pydantic import Field -from typing_extensions import Annotated -from pydantic import StrictBytes, StrictInt, StrictStr, field_validator - +from pydantic import Field, StrictBytes, StrictInt, StrictStr, field_validator from typing import List, Optional, Union - +from typing_extensions import Annotated from petstore_api.models.api_response import ApiResponse from petstore_api.models.pet import Pet diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py index 81b53840a27..4af3f6323fd 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py @@ -11,24 +11,17 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated except ImportError: from typing_extensions import Annotated -from pydantic import Field +from pydantic import Field, StrictStr from typing_extensions import Annotated -from pydantic import StrictStr - -from typing import Dict - from petstore_api.models.order import Order from petstore_api.api_client import ApiClient diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py index 2331c7fb56d..72d1293f0cb 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py @@ -11,24 +11,18 @@ Do not edit the class manually. """ # noqa: E501 - -import io import warnings - from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any +from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Annotated except ImportError: from typing_extensions import Annotated -from pydantic import Field -from typing_extensions import Annotated -from pydantic import StrictStr - +from pydantic import Field, StrictStr from typing import List - +from typing_extensions import Annotated from petstore_api.models.user import User from petstore_api.api_client import ApiClient diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index f0b4714a03c..5e02dbf90a2 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -12,7 +12,6 @@ """ # noqa: E501 -import atexit import datetime from dateutil.parser import parse import json diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_response.py b/samples/openapi3/client/petstore/python/petstore_api/api_response.py index 2ac1ada6e9b..288b2e9a254 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_response.py @@ -1,7 +1,7 @@ """API response object.""" from __future__ import annotations -from typing import Any, Dict, Optional, Generic, TypeVar +from typing import Dict, Optional, Generic, TypeVar from pydantic import Field, StrictInt, StrictStr, StrictBytes, BaseModel T = TypeVar("T") diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_any_type.py b/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_any_type.py index 2ce4d17e957..ffa1d02e5ad 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_any_type.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_any_type.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_class.py index 4704d56b5d1..62040a12d38 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_class.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_object.py b/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_object.py index 6d6fd8daf5f..e0bb54ce6b2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_object.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_object.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_with_description_only.py b/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_with_description_only.py index 9a41a8257f1..3b9878cd05f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_with_description_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_with_description_only.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python/petstore_api/models/all_of_with_single_ref.py index 7a7e76b88df..00bdb6db046 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/all_of_with_single_ref.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/all_of_with_single_ref.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field from petstore_api.models.single_ref_type import SingleRefType try: from typing import Self diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py index 0851ecd1423..3705b2ea706 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/any_of_color.py b/samples/openapi3/client/petstore/python/petstore_api/models/any_of_color.py index 7e8e6976ebc..18c98d1c1b8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/any_of_color.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/any_of_color.py @@ -17,18 +17,11 @@ from inspect import getfullargspec import json import pprint import re # noqa: F401 - -from typing import List, Optional from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator -from pydantic import Field +from typing import List, Optional from typing_extensions import Annotated from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict -from typing_extensions import Literal -from pydantic import StrictStr, Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Literal, Self ANYOFCOLOR_ANY_OF_SCHEMAS = ["List[int]", "str"] diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/any_of_pig.py b/samples/openapi3/client/petstore/python/petstore_api/models/any_of_pig.py index 4abe31fc06f..afe139277b8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/any_of_pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/any_of_pig.py @@ -17,18 +17,12 @@ from inspect import getfullargspec import json import pprint import re # noqa: F401 - -from typing import Optional from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator +from typing import Optional from petstore_api.models.basque_pig import BasquePig from petstore_api.models.danish_pig import DanishPig from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict -from typing_extensions import Literal -from pydantic import StrictStr, Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Literal, Self ANYOFPIG_ANY_OF_SCHEMAS = ["BasquePig", "DanishPig"] diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python/petstore_api/models/api_response.py index eac66acfb57..97cadc01d54 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/api_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/api_response.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_model.py b/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_model.py index 772e428b282..57e21deaa88 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_model.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel +from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.tag import Tag try: from typing import Self diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py index d801b0cda6b..6aa14d6b0c9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictFloat from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictFloat -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python/petstore_api/models/array_of_number_only.py index 96ce0f69f2f..7c1eff55816 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/array_of_number_only.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictFloat from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictFloat -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python/petstore_api/models/array_test.py index cbb543e5cfe..a41c7db4045 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/array_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/array_test.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr -from pydantic import Field from typing_extensions import Annotated from petstore_api.models.read_only_first import ReadOnlyFirst try: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python/petstore_api/models/basque_pig.py index 6d03a549ec0..a2252acdb08 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/basque_pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/basque_pig.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py index 9f0eaab95ac..368474763c5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python/petstore_api/models/cat.py index 931554c725a..f8a2abe2b16 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/cat.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import StrictBool +from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.animal import Animal try: from typing import Self diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/category.py b/samples/openapi3/client/petstore/python/petstore_api/models/category.py index 38daeb84aa3..611e76ac69d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/category.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/circular_reference_model.py b/samples/openapi3/client/petstore/python/petstore_api/models/circular_reference_model.py index d4171cbe4d2..d4f772f3945 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/circular_reference_model.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/circular_reference_model.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python/petstore_api/models/class_model.py index 601e5353de6..25def7ccdc3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/class_model.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/class_model.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/client.py b/samples/openapi3/client/petstore/python/petstore_api/models/client.py index 7dd00901d94..b56b1e5db45 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/client.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/color.py b/samples/openapi3/client/petstore/python/petstore_api/models/color.py index 638d942a34e..09ef62c0d94 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/color.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/color.py @@ -13,22 +13,14 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - -from typing import Any, List, Optional from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator -from pydantic import Field +from typing import Any, List, Optional from typing_extensions import Annotated -from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict -from typing_extensions import Literal from pydantic import StrictStr, Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self COLOR_ONE_OF_SCHEMAS = ["List[int]", "str"] diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/creature.py b/samples/openapi3/client/petstore/python/petstore_api/models/creature.py index 60421bb1ae6..4378deaf99a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/creature.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/creature.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List from petstore_api.models.creature_info import CreatureInfo try: from typing import Self diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/creature_info.py b/samples/openapi3/client/petstore/python/petstore_api/models/creature_info.py index 33841c6305e..8b1aec3a9ae 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/creature_info.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/creature_info.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python/petstore_api/models/danish_pig.py index a89183607b3..0f00519f93e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/danish_pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/danish_pig.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List -from pydantic import BaseModel, StrictInt, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python/petstore_api/models/deprecated_object.py index f75a9da4490..74f788ee31a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/deprecated_object.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/deprecated_object.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python/petstore_api/models/dog.py index 1b7b61dd178..b0947a28e00 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/dog.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import StrictStr +from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.animal import Animal try: from typing import Self diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/dummy_model.py b/samples/openapi3/client/petstore/python/petstore_api/models/dummy_model.py index 321eef90ce6..9a5b6ab9300 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/dummy_model.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/dummy_model.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python/petstore_api/models/enum_arrays.py index 5ed06a50d00..f513c2afb7f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/enum_arrays.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/enum_arrays.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python/petstore_api/models/enum_class.py index 11255f41897..1ba5af8036d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/enum_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/enum_class.py @@ -14,16 +14,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class EnumClass(str, Enum): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_string1.py b/samples/openapi3/client/petstore/python/petstore_api/models/enum_string1.py index efe9a605621..678b4e12661 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/enum_string1.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/enum_string1.py @@ -14,16 +14,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class EnumString1(str, Enum): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_string2.py b/samples/openapi3/client/petstore/python/petstore_api/models/enum_string2.py index 222c5dc6b82..a959f554e0a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/enum_string2.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/enum_string2.py @@ -14,16 +14,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class EnumString2(str, Enum): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py index 71bf3c4413e..74b8370d532 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr, field_validator -from pydantic import Field from petstore_api.models.outer_enum import OuterEnum from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue from petstore_api.models.outer_enum_integer import OuterEnumInteger diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/file.py b/samples/openapi3/client/petstore/python/petstore_api/models/file.py index 7d84e519006..6e468e461fc 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/file.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python/petstore_api/models/file_schema_test_class.py index d52e09861a6..99ea21868b6 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/file_schema_test_class.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel +from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.file import File try: from typing import Self diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/first_ref.py b/samples/openapi3/client/petstore/python/petstore_api/models/first_ref.py index 5542541c95f..22efcd446c9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/first_ref.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/first_ref.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python/petstore_api/models/foo.py index 9d8160318a0..8eaf65ef738 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/foo.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python/petstore_api/models/foo_get_default_response.py index b242b602212..882912570dc 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/foo_get_default_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/foo_get_default_response.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel +from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.foo import Foo try: from typing import Self diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python/petstore_api/models/format_test.py index 12f3f5885d4..9e8aa92a329 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/format_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/format_test.py @@ -18,10 +18,9 @@ import re # noqa: F401 import json from datetime import date, datetime -from typing import Any, ClassVar, Dict, List, Optional, Union -from pydantic import BaseModel, StrictBytes, StrictInt, StrictStr, field_validator from decimal import Decimal -from pydantic import Field +from pydantic import BaseModel, Field, StrictBytes, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union from typing_extensions import Annotated try: from typing import Self diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python/petstore_api/models/has_only_read_only.py index d422c8a1733..50aace1dbea 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/has_only_read_only.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python/petstore_api/models/health_check_result.py index 4b5c69f5f8a..386db83a29f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/health_check_result.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/health_check_result.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/inner_dict_with_property.py b/samples/openapi3/client/petstore/python/petstore_api/models/inner_dict_with_property.py index c4e52c32e4d..ff301e4a774 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/inner_dict_with_property.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/inner_dict_with_property.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/int_or_string.py b/samples/openapi3/client/petstore/python/petstore_api/models/int_or_string.py index a7203af4ac5..b4309c79111 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/int_or_string.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/int_or_string.py @@ -13,22 +13,14 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - -from typing import Any, List, Optional from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator -from pydantic import Field +from typing import Any, List, Optional from typing_extensions import Annotated -from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict -from typing_extensions import Literal from pydantic import StrictStr, Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self INTORSTRING_ONE_OF_SCHEMAS = ["int", "str"] diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/list_class.py b/samples/openapi3/client/petstore/python/petstore_api/models/list_class.py index cb9f9cbd54d..714f17b9f60 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/list_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/list_class.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/map_of_array_of_model.py b/samples/openapi3/client/petstore/python/petstore_api/models/map_of_array_of_model.py index 4d5d5a875c2..9885de54a89 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/map_of_array_of_model.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/map_of_array_of_model.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel -from pydantic import Field from petstore_api.models.tag import Tag try: from typing import Self diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python/petstore_api/models/map_test.py index 562647339a3..89d4c7d8345 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/map_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/map_test.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py index 138501aef5f..6126316a91f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -18,9 +18,8 @@ import re # noqa: F401 import json from datetime import datetime +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field from petstore_api.models.animal import Animal try: from typing import Self diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python/petstore_api/models/model200_response.py index db0d6c82d6e..dff34e31f31 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/model200_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/model200_response.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python/petstore_api/models/model_return.py index e5dda193334..9f639fa1a3e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/model_return.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/model_return.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/name.py b/samples/openapi3/client/petstore/python/petstore_api/models/name.py index 84340c8acd4..1db30455de6 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/name.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python/petstore_api/models/nullable_class.py index 88c5ee21998..5c3c0e6597d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/nullable_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/nullable_class.py @@ -18,8 +18,8 @@ import re # noqa: F401 import json from datetime import date, datetime -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/nullable_property.py b/samples/openapi3/client/petstore/python/petstore_api/models/nullable_property.py index f44ae9253bb..3da13a5751f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/nullable_property.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/nullable_property.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, field_validator from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, field_validator -from pydantic import Field from typing_extensions import Annotated try: from typing import Self diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python/petstore_api/models/number_only.py index bf460b8efc5..bbe39b678e3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/number_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/number_only.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictFloat from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictFloat -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/object_to_test_additional_properties.py b/samples/openapi3/client/petstore/python/petstore_api/models/object_to_test_additional_properties.py index 69efac6a9d6..4f7c9bbec66 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/object_to_test_additional_properties.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/object_to_test_additional_properties.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictBool from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictBool -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python/petstore_api/models/object_with_deprecated_fields.py index 6200d54f77f..7c03af763da 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/object_with_deprecated_fields.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/object_with_deprecated_fields.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictFloat, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictFloat, StrictStr -from pydantic import Field from petstore_api.models.deprecated_object import DeprecatedObject try: from typing import Self diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/one_of_enum_string.py b/samples/openapi3/client/petstore/python/petstore_api/models/one_of_enum_string.py index b099c7bab57..0937e695ba8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/one_of_enum_string.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/one_of_enum_string.py @@ -13,22 +13,15 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - -from typing import Any, List, Optional from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional from petstore_api.models.enum_string1 import EnumString1 from petstore_api.models.enum_string2 import EnumString2 -from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict -from typing_extensions import Literal from pydantic import StrictStr, Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self ONEOFENUMSTRING_ONE_OF_SCHEMAS = ["EnumString1", "EnumString2"] diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/order.py b/samples/openapi3/client/petstore/python/petstore_api/models/order.py index 2543b6c79e7..82682c94bb5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/order.py @@ -18,9 +18,8 @@ import re # noqa: F401 import json from datetime import datetime +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr, field_validator -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python/petstore_api/models/outer_composite.py index 452462bc9ca..7862a53b315 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/outer_composite.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/outer_composite.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictBool, StrictFloat, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum.py index 89b19cbcf66..ac48cc0dc4d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum.py @@ -14,16 +14,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class OuterEnum(str, Enum): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_default_value.py index 51ca91443e2..99d6fd5fc04 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_default_value.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_default_value.py @@ -14,16 +14,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class OuterEnumDefaultValue(str, Enum): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer.py index 8947df65046..b771b7a61f5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer.py @@ -14,16 +14,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class OuterEnumInteger(int, Enum): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer_default_value.py index 970487bb0c4..8df41b2bd32 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer_default_value.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer_default_value.py @@ -14,16 +14,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class OuterEnumIntegerDefaultValue(int, Enum): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python/petstore_api/models/outer_object_with_enum_property.py index f3aeef5e06c..2294c351852 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/outer_object_with_enum_property.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/outer_object_with_enum_property.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel +from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.outer_enum import OuterEnum from petstore_api.models.outer_enum_integer import OuterEnumInteger try: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/parent.py b/samples/openapi3/client/petstore/python/petstore_api/models/parent.py index 8409e17062d..53c13813a54 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/parent.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/parent.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel -from pydantic import Field from petstore_api.models.inner_dict_with_property import InnerDictWithProperty try: from typing import Self diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/parent_with_optional_dict.py b/samples/openapi3/client/petstore/python/petstore_api/models/parent_with_optional_dict.py index f02d65b5044..5f5ca1b49d8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/parent_with_optional_dict.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/parent_with_optional_dict.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel -from pydantic import Field from petstore_api.models.inner_dict_with_property import InnerDictWithProperty try: from typing import Self diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python/petstore_api/models/pet.py index a8da57a3527..164ca8d6d30 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/pet.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr, field_validator -from pydantic import Field from typing_extensions import Annotated from petstore_api.models.category import Category from petstore_api.models.tag import Tag diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/pig.py b/samples/openapi3/client/petstore/python/petstore_api/models/pig.py index 31a6571cbeb..4918fd68534 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/pig.py @@ -13,22 +13,15 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - -from typing import Any, List, Optional from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional from petstore_api.models.basque_pig import BasquePig from petstore_api.models.danish_pig import DanishPig -from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict -from typing_extensions import Literal from pydantic import StrictStr, Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self PIG_ONE_OF_SCHEMAS = ["BasquePig", "DanishPig"] diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/property_name_collision.py b/samples/openapi3/client/petstore/python/petstore_api/models/property_name_collision.py index f3869d330ab..f46aabd06b6 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/property_name_collision.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/property_name_collision.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python/petstore_api/models/read_only_first.py index 76329755f6d..01648d4b72f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/read_only_first.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/read_only_first.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/second_ref.py b/samples/openapi3/client/petstore/python/petstore_api/models/second_ref.py index e16421deca5..212ac8e1709 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/second_ref.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/second_ref.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/self_reference_model.py b/samples/openapi3/client/petstore/python/petstore_api/models/self_reference_model.py index 9508408b5d3..3e4c11e183a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/self_reference_model.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/self_reference_model.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/single_ref_type.py b/samples/openapi3/client/petstore/python/petstore_api/models/single_ref_type.py index 3c41c411865..91ab07e2535 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/single_ref_type.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/single_ref_type.py @@ -14,16 +14,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class SingleRefType(str, Enum): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/special_character_enum.py b/samples/openapi3/client/petstore/python/petstore_api/models/special_character_enum.py index 77ed288a94b..1d85fd148d4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/special_character_enum.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/special_character_enum.py @@ -14,16 +14,8 @@ from __future__ import annotations import json -import pprint -import re # noqa: F401 from enum import Enum - - - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing_extensions import Self class SpecialCharacterEnum(str, Enum): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python/petstore_api/models/special_model_name.py index ac2256a2543..ae89384c05f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/special_model_name.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/special_model_name.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/special_name.py b/samples/openapi3/client/petstore/python/petstore_api/models/special_name.py index 540f75c8059..76ddb42ad22 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/special_name.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/special_name.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr, field_validator -from pydantic import Field from petstore_api.models.category import Category try: from typing import Self diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python/petstore_api/models/tag.py index d53d642ef7f..6af90ba1f40 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/tag.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model400_response.py b/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model400_response.py index cf0098df56c..83f78d2c72d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model400_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model400_response.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model404_response.py b/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model404_response.py index aa8d6232def..f8f3cb0ed42 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model404_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/test_error_responses_with_model404_response.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/test_inline_freeform_additional_properties_request.py b/samples/openapi3/client/petstore/python/petstore_api/models/test_inline_freeform_additional_properties_request.py index c8d66e9d638..69897688097 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/test_inline_freeform_additional_properties_request.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/test_inline_freeform_additional_properties_request.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/tiger.py b/samples/openapi3/client/petstore/python/petstore_api/models/tiger.py index 1bd884664e0..d9cfc98ad51 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/tiger.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/tiger.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List, Optional try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py b/samples/openapi3/client/petstore/python/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py index 9c840503bca..cfb0a080ec7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel -from pydantic import Field from petstore_api.models.creature_info import CreatureInfo try: from typing import Self diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py b/samples/openapi3/client/petstore/python/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py index 469f2e4b2ce..63379e11eb5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/user.py b/samples/openapi3/client/petstore/python/petstore_api/models/user.py index f5ad26584e9..13b2422bba7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/user.py @@ -17,10 +17,8 @@ import pprint import re # noqa: F401 import json - +from pydantic import BaseModel, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr -from pydantic import Field try: from typing import Self except ImportError: diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/with_nested_one_of.py b/samples/openapi3/client/petstore/python/petstore_api/models/with_nested_one_of.py index a1401068f56..cce8a4460d0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/with_nested_one_of.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/with_nested_one_of.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 import json - -from typing import Any, ClassVar, Dict, List, Optional from pydantic import BaseModel, StrictInt +from typing import Any, ClassVar, Dict, List, Optional from petstore_api.models.one_of_enum_string import OneOfEnumString from petstore_api.models.pig import Pig try: diff --git a/samples/openapi3/client/petstore/python/petstore_api/signing.py b/samples/openapi3/client/petstore/python/petstore_api/signing.py index ec4d7d2a67f..1f15504ed66 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/signing.py +++ b/samples/openapi3/client/petstore/python/petstore_api/signing.py @@ -16,7 +16,6 @@ from Crypto.Hash import SHA256, SHA512 from Crypto.PublicKey import RSA, ECC from Crypto.Signature import PKCS1_v1_5, pss, DSS from email.utils import formatdate -import json import os import re from time import time