From d111476b349d8ae81d53a50495f1b99c4e8d941f Mon Sep 17 00:00:00 2001 From: Juanpe Araque Date: Tue, 29 Apr 2025 21:54:11 +0100 Subject: [PATCH 1/3] Add __all__ to the package __init__.py file for Python APIs --- .../__init__package.mustache | 17 +++ .../resources/python/__init__package.mustache | 17 +++ .../openapi_client/__init__.py | 32 +++++ .../openapi_client/__init__.py | 32 +++++ .../python/openapi_client/__init__.py | 32 +++++ .../python-aiohttp/petstore_api/__init__.py | 131 ++++++++++++++++++ .../petstore_api/__init__.py | 131 ++++++++++++++++++ .../petstore_api/__init__.py | 131 ++++++++++++++++++ .../petstore/python/petstore_api/__init__.py | 131 ++++++++++++++++++ 9 files changed, 654 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/python-pydantic-v1/__init__package.mustache b/modules/openapi-generator/src/main/resources/python-pydantic-v1/__init__package.mustache index 7985e6e46a4..78e8331a55c 100644 --- a/modules/openapi-generator/src/main/resources/python-pydantic-v1/__init__package.mustache +++ b/modules/openapi-generator/src/main/resources/python-pydantic-v1/__init__package.mustache @@ -6,6 +6,23 @@ __version__ = "{{packageVersion}}" +# Define package exports +__all__ = [ + {{#apiInfo}}{{#apis}}"{{classname}}", + {{/apis}}{{/apiInfo}}"ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + {{#hasHttpSignatureMethods}}"HttpSigningConfiguration", + {{/hasHttpSignatureMethods}}{{#models}}{{#model}}"{{classname}}", + {{/model}}{{/models}} +] + # import apis into sdk package {{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classFilename}} import {{classname}} {{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/python/__init__package.mustache b/modules/openapi-generator/src/main/resources/python/__init__package.mustache index 7985e6e46a4..78e8331a55c 100644 --- a/modules/openapi-generator/src/main/resources/python/__init__package.mustache +++ b/modules/openapi-generator/src/main/resources/python/__init__package.mustache @@ -6,6 +6,23 @@ __version__ = "{{packageVersion}}" +# Define package exports +__all__ = [ + {{#apiInfo}}{{#apis}}"{{classname}}", + {{/apis}}{{/apiInfo}}"ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + {{#hasHttpSignatureMethods}}"HttpSigningConfiguration", + {{/hasHttpSignatureMethods}}{{#models}}{{#model}}"{{classname}}", + {{/model}}{{/models}} +] + # import apis into sdk package {{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classFilename}} import {{classname}} {{/apis}}{{/apiInfo}} diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/__init__.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/__init__.py index 3f63fe12abd..f2f0fc3e57f 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/__init__.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/__init__.py @@ -17,6 +17,38 @@ __version__ = "1.0.0" +# Define package exports +__all__ = [ + "AuthApi", + "BodyApi", + "FormApi", + "HeaderApi", + "PathApi", + "QueryApi", + "ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "Bird", + "Category", + "DataQuery", + "DefaultValue", + "NumberPropertiesOnly", + "Pet", + "Query", + "StringEnumRef", + "Tag", + "TestFormObjectMultipartRequestMarker", + "TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter", + "TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter", + +] + # import apis into sdk package from openapi_client.api.auth_api import AuthApi from openapi_client.api.body_api import BodyApi diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/__init__.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/__init__.py index 3f63fe12abd..f2f0fc3e57f 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/__init__.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/__init__.py @@ -17,6 +17,38 @@ __version__ = "1.0.0" +# Define package exports +__all__ = [ + "AuthApi", + "BodyApi", + "FormApi", + "HeaderApi", + "PathApi", + "QueryApi", + "ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "Bird", + "Category", + "DataQuery", + "DefaultValue", + "NumberPropertiesOnly", + "Pet", + "Query", + "StringEnumRef", + "Tag", + "TestFormObjectMultipartRequestMarker", + "TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter", + "TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter", + +] + # import apis into sdk package from openapi_client.api.auth_api import AuthApi from openapi_client.api.body_api import BodyApi diff --git a/samples/client/echo_api/python/openapi_client/__init__.py b/samples/client/echo_api/python/openapi_client/__init__.py index 3f63fe12abd..f2f0fc3e57f 100644 --- a/samples/client/echo_api/python/openapi_client/__init__.py +++ b/samples/client/echo_api/python/openapi_client/__init__.py @@ -17,6 +17,38 @@ __version__ = "1.0.0" +# Define package exports +__all__ = [ + "AuthApi", + "BodyApi", + "FormApi", + "HeaderApi", + "PathApi", + "QueryApi", + "ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "Bird", + "Category", + "DataQuery", + "DefaultValue", + "NumberPropertiesOnly", + "Pet", + "Query", + "StringEnumRef", + "Tag", + "TestFormObjectMultipartRequestMarker", + "TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter", + "TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter", + +] + # import apis into sdk package from openapi_client.api.auth_api import AuthApi from openapi_client.api.body_api import BodyApi diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py index 9036b7a8742..84a3991e68a 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py @@ -16,6 +16,137 @@ __version__ = "1.0.0" +# Define package exports +__all__ = [ + "AnotherFakeApi", + "DefaultApi", + "FakeApi", + "FakeClassnameTags123Api", + "ImportTestDatetimeApi", + "PetApi", + "StoreApi", + "UserApi", + "ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "HttpSigningConfiguration", + "AdditionalPropertiesAnyType", + "AdditionalPropertiesClass", + "AdditionalPropertiesObject", + "AdditionalPropertiesWithDescriptionOnly", + "AllOfSuperModel", + "AllOfWithSingleRef", + "Animal", + "AnyOfColor", + "AnyOfPig", + "ArrayOfArrayOfModel", + "ArrayOfArrayOfNumberOnly", + "ArrayOfNumberOnly", + "ArrayTest", + "BaseDiscriminator", + "BasquePig", + "Bathing", + "Capitalization", + "Cat", + "Category", + "CircularAllOfRef", + "CircularReferenceModel", + "ClassModel", + "Client", + "Color", + "Creature", + "CreatureInfo", + "DanishPig", + "DeprecatedObject", + "DiscriminatorAllOfSub", + "DiscriminatorAllOfSuper", + "Dog", + "DummyModel", + "EnumArrays", + "EnumClass", + "EnumNumberVendorExt", + "EnumString1", + "EnumString2", + "EnumStringVendorExt", + "EnumTest", + "Feeding", + "File", + "FileSchemaTestClass", + "FirstRef", + "Foo", + "FooGetDefaultResponse", + "FormatTest", + "HasOnlyReadOnly", + "HealthCheckResult", + "HuntingDog", + "Info", + "InnerDictWithProperty", + "InputAllOf", + "IntOrString", + "ListClass", + "MapOfArrayOfModel", + "MapTest", + "MixedPropertiesAndAdditionalPropertiesClass", + "Model200Response", + "ModelApiResponse", + "ModelField", + "ModelReturn", + "MultiArrays", + "Name", + "NullableClass", + "NullableProperty", + "NumberOnly", + "ObjectToTestAdditionalProperties", + "ObjectWithDeprecatedFields", + "OneOfEnumString", + "Order", + "OuterComposite", + "OuterEnum", + "OuterEnumDefaultValue", + "OuterEnumInteger", + "OuterEnumIntegerDefaultValue", + "OuterObjectWithEnumProperty", + "Parent", + "ParentWithOptionalDict", + "Pet", + "Pig", + "PoopCleaning", + "PrimitiveString", + "PropertyMap", + "PropertyNameCollision", + "ReadOnlyFirst", + "SecondCircularAllOfRef", + "SecondRef", + "SelfReferenceModel", + "SingleRefType", + "SpecialCharacterEnum", + "SpecialModelName", + "SpecialName", + "Tag", + "Task", + "TaskActivity", + "TestEnum", + "TestEnumWithDefault", + "TestErrorResponsesWithModel400Response", + "TestErrorResponsesWithModel404Response", + "TestInlineFreeformAdditionalPropertiesRequest", + "TestModelWithEnumDefault", + "TestObjectForMultipartRequestsRequestMarker", + "Tiger", + "UnnamedDictWithAdditionalModelListProperties", + "UnnamedDictWithAdditionalStringListProperties", + "UploadFileWithAdditionalPropertiesRequestObject", + "User", + "WithNestedOneOf", + +] + # import apis into sdk package from petstore_api.api.another_fake_api import AnotherFakeApi from petstore_api.api.default_api import DefaultApi diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/__init__.py index 0a4eca2f3b0..fec6084e06e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/__init__.py @@ -16,6 +16,137 @@ __version__ = "1.0.0" +# Define package exports +__all__ = [ + "AnotherFakeApi", + "DefaultApi", + "FakeApi", + "FakeClassnameTags123Api", + "ImportTestDatetimeApi", + "PetApi", + "StoreApi", + "UserApi", + "ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "HttpSigningConfiguration", + "AdditionalPropertiesAnyType", + "AdditionalPropertiesClass", + "AdditionalPropertiesObject", + "AdditionalPropertiesWithDescriptionOnly", + "AllOfSuperModel", + "AllOfWithSingleRef", + "Animal", + "AnyOfColor", + "AnyOfPig", + "ApiResponse", + "ArrayOfArrayOfModel", + "ArrayOfArrayOfNumberOnly", + "ArrayOfNumberOnly", + "ArrayTest", + "BaseDiscriminator", + "BasquePig", + "Bathing", + "Capitalization", + "Cat", + "Category", + "CircularAllOfRef", + "CircularReferenceModel", + "ClassModel", + "Client", + "Color", + "Creature", + "CreatureInfo", + "DanishPig", + "DeprecatedObject", + "DiscriminatorAllOfSub", + "DiscriminatorAllOfSuper", + "Dog", + "DummyModel", + "EnumArrays", + "EnumClass", + "EnumNumberVendorExt", + "EnumString1", + "EnumString2", + "EnumStringVendorExt", + "EnumTest", + "Feeding", + "Field", + "File", + "FileSchemaTestClass", + "FirstRef", + "Foo", + "FooGetDefaultResponse", + "FormatTest", + "HasOnlyReadOnly", + "HealthCheckResult", + "HuntingDog", + "Info", + "InnerDictWithProperty", + "InputAllOf", + "IntOrString", + "ListClass", + "MapOfArrayOfModel", + "MapTest", + "MixedPropertiesAndAdditionalPropertiesClass", + "Model200Response", + "ModelReturn", + "MultiArrays", + "Name", + "NullableClass", + "NullableProperty", + "NumberOnly", + "ObjectToTestAdditionalProperties", + "ObjectWithDeprecatedFields", + "OneOfEnumString", + "Order", + "OuterComposite", + "OuterEnum", + "OuterEnumDefaultValue", + "OuterEnumInteger", + "OuterEnumIntegerDefaultValue", + "OuterObjectWithEnumProperty", + "Parent", + "ParentWithOptionalDict", + "Pet", + "Pig", + "PoopCleaning", + "PrimitiveString", + "PropertyMap", + "PropertyNameCollision", + "ReadOnlyFirst", + "SecondCircularAllOfRef", + "SecondRef", + "SelfReferenceModel", + "SingleRefType", + "SpecialCharacterEnum", + "SpecialModelName", + "SpecialName", + "Tag", + "Task", + "TaskActivity", + "TestEnum", + "TestEnumWithDefault", + "TestErrorResponsesWithModel400Response", + "TestErrorResponsesWithModel404Response", + "TestInlineFreeformAdditionalPropertiesRequest", + "TestModelWithEnumDefault", + "TestObjectForMultipartRequestsRequestMarker", + "Tiger", + "UnnamedDictWithAdditionalModelListProperties", + "UnnamedDictWithAdditionalStringListProperties", + "UploadFileWithAdditionalPropertiesRequestObject", + "User", + "WithNestedOneOf", + +] + # import apis into sdk package from petstore_api.api.another_fake_api import AnotherFakeApi from petstore_api.api.default_api import DefaultApi diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/__init__.py index 0a4eca2f3b0..fec6084e06e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/__init__.py @@ -16,6 +16,137 @@ __version__ = "1.0.0" +# Define package exports +__all__ = [ + "AnotherFakeApi", + "DefaultApi", + "FakeApi", + "FakeClassnameTags123Api", + "ImportTestDatetimeApi", + "PetApi", + "StoreApi", + "UserApi", + "ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "HttpSigningConfiguration", + "AdditionalPropertiesAnyType", + "AdditionalPropertiesClass", + "AdditionalPropertiesObject", + "AdditionalPropertiesWithDescriptionOnly", + "AllOfSuperModel", + "AllOfWithSingleRef", + "Animal", + "AnyOfColor", + "AnyOfPig", + "ApiResponse", + "ArrayOfArrayOfModel", + "ArrayOfArrayOfNumberOnly", + "ArrayOfNumberOnly", + "ArrayTest", + "BaseDiscriminator", + "BasquePig", + "Bathing", + "Capitalization", + "Cat", + "Category", + "CircularAllOfRef", + "CircularReferenceModel", + "ClassModel", + "Client", + "Color", + "Creature", + "CreatureInfo", + "DanishPig", + "DeprecatedObject", + "DiscriminatorAllOfSub", + "DiscriminatorAllOfSuper", + "Dog", + "DummyModel", + "EnumArrays", + "EnumClass", + "EnumNumberVendorExt", + "EnumString1", + "EnumString2", + "EnumStringVendorExt", + "EnumTest", + "Feeding", + "Field", + "File", + "FileSchemaTestClass", + "FirstRef", + "Foo", + "FooGetDefaultResponse", + "FormatTest", + "HasOnlyReadOnly", + "HealthCheckResult", + "HuntingDog", + "Info", + "InnerDictWithProperty", + "InputAllOf", + "IntOrString", + "ListClass", + "MapOfArrayOfModel", + "MapTest", + "MixedPropertiesAndAdditionalPropertiesClass", + "Model200Response", + "ModelReturn", + "MultiArrays", + "Name", + "NullableClass", + "NullableProperty", + "NumberOnly", + "ObjectToTestAdditionalProperties", + "ObjectWithDeprecatedFields", + "OneOfEnumString", + "Order", + "OuterComposite", + "OuterEnum", + "OuterEnumDefaultValue", + "OuterEnumInteger", + "OuterEnumIntegerDefaultValue", + "OuterObjectWithEnumProperty", + "Parent", + "ParentWithOptionalDict", + "Pet", + "Pig", + "PoopCleaning", + "PrimitiveString", + "PropertyMap", + "PropertyNameCollision", + "ReadOnlyFirst", + "SecondCircularAllOfRef", + "SecondRef", + "SelfReferenceModel", + "SingleRefType", + "SpecialCharacterEnum", + "SpecialModelName", + "SpecialName", + "Tag", + "Task", + "TaskActivity", + "TestEnum", + "TestEnumWithDefault", + "TestErrorResponsesWithModel400Response", + "TestErrorResponsesWithModel404Response", + "TestInlineFreeformAdditionalPropertiesRequest", + "TestModelWithEnumDefault", + "TestObjectForMultipartRequestsRequestMarker", + "Tiger", + "UnnamedDictWithAdditionalModelListProperties", + "UnnamedDictWithAdditionalStringListProperties", + "UploadFileWithAdditionalPropertiesRequestObject", + "User", + "WithNestedOneOf", + +] + # import apis into sdk package from petstore_api.api.another_fake_api import AnotherFakeApi from petstore_api.api.default_api import DefaultApi diff --git a/samples/openapi3/client/petstore/python/petstore_api/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/__init__.py index 9036b7a8742..84a3991e68a 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/__init__.py @@ -16,6 +16,137 @@ __version__ = "1.0.0" +# Define package exports +__all__ = [ + "AnotherFakeApi", + "DefaultApi", + "FakeApi", + "FakeClassnameTags123Api", + "ImportTestDatetimeApi", + "PetApi", + "StoreApi", + "UserApi", + "ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "HttpSigningConfiguration", + "AdditionalPropertiesAnyType", + "AdditionalPropertiesClass", + "AdditionalPropertiesObject", + "AdditionalPropertiesWithDescriptionOnly", + "AllOfSuperModel", + "AllOfWithSingleRef", + "Animal", + "AnyOfColor", + "AnyOfPig", + "ArrayOfArrayOfModel", + "ArrayOfArrayOfNumberOnly", + "ArrayOfNumberOnly", + "ArrayTest", + "BaseDiscriminator", + "BasquePig", + "Bathing", + "Capitalization", + "Cat", + "Category", + "CircularAllOfRef", + "CircularReferenceModel", + "ClassModel", + "Client", + "Color", + "Creature", + "CreatureInfo", + "DanishPig", + "DeprecatedObject", + "DiscriminatorAllOfSub", + "DiscriminatorAllOfSuper", + "Dog", + "DummyModel", + "EnumArrays", + "EnumClass", + "EnumNumberVendorExt", + "EnumString1", + "EnumString2", + "EnumStringVendorExt", + "EnumTest", + "Feeding", + "File", + "FileSchemaTestClass", + "FirstRef", + "Foo", + "FooGetDefaultResponse", + "FormatTest", + "HasOnlyReadOnly", + "HealthCheckResult", + "HuntingDog", + "Info", + "InnerDictWithProperty", + "InputAllOf", + "IntOrString", + "ListClass", + "MapOfArrayOfModel", + "MapTest", + "MixedPropertiesAndAdditionalPropertiesClass", + "Model200Response", + "ModelApiResponse", + "ModelField", + "ModelReturn", + "MultiArrays", + "Name", + "NullableClass", + "NullableProperty", + "NumberOnly", + "ObjectToTestAdditionalProperties", + "ObjectWithDeprecatedFields", + "OneOfEnumString", + "Order", + "OuterComposite", + "OuterEnum", + "OuterEnumDefaultValue", + "OuterEnumInteger", + "OuterEnumIntegerDefaultValue", + "OuterObjectWithEnumProperty", + "Parent", + "ParentWithOptionalDict", + "Pet", + "Pig", + "PoopCleaning", + "PrimitiveString", + "PropertyMap", + "PropertyNameCollision", + "ReadOnlyFirst", + "SecondCircularAllOfRef", + "SecondRef", + "SelfReferenceModel", + "SingleRefType", + "SpecialCharacterEnum", + "SpecialModelName", + "SpecialName", + "Tag", + "Task", + "TaskActivity", + "TestEnum", + "TestEnumWithDefault", + "TestErrorResponsesWithModel400Response", + "TestErrorResponsesWithModel404Response", + "TestInlineFreeformAdditionalPropertiesRequest", + "TestModelWithEnumDefault", + "TestObjectForMultipartRequestsRequestMarker", + "Tiger", + "UnnamedDictWithAdditionalModelListProperties", + "UnnamedDictWithAdditionalStringListProperties", + "UploadFileWithAdditionalPropertiesRequestObject", + "User", + "WithNestedOneOf", + +] + # import apis into sdk package from petstore_api.api.another_fake_api import AnotherFakeApi from petstore_api.api.default_api import DefaultApi From b2c9e9a7177a86014ce0ee2057f1c0ac19cce4f0 Mon Sep 17 00:00:00 2001 From: Juanpe Araque Date: Tue, 29 Apr 2025 23:19:39 +0200 Subject: [PATCH 2/3] Remove empty line before closing bracket --- .../resources/python-pydantic-v1/__init__package.mustache | 4 ++-- .../src/main/resources/python/__init__package.mustache | 4 ++-- .../openapi_client/__init__.py | 1 - .../echo_api/python-pydantic-v1/openapi_client/__init__.py | 1 - samples/client/echo_api/python/openapi_client/__init__.py | 1 - 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python-pydantic-v1/__init__package.mustache b/modules/openapi-generator/src/main/resources/python-pydantic-v1/__init__package.mustache index 78e8331a55c..b6105807797 100644 --- a/modules/openapi-generator/src/main/resources/python-pydantic-v1/__init__package.mustache +++ b/modules/openapi-generator/src/main/resources/python-pydantic-v1/__init__package.mustache @@ -19,8 +19,8 @@ __all__ = [ "ApiAttributeError", "ApiException", {{#hasHttpSignatureMethods}}"HttpSigningConfiguration", - {{/hasHttpSignatureMethods}}{{#models}}{{#model}}"{{classname}}", - {{/model}}{{/models}} + {{/hasHttpSignatureMethods}}{{#models}}{{#model}}"{{classname}}"{{^-last}}, + {{/-last}}{{#-last}},{{/-last}}{{/model}}{{/models}} ] # import apis into sdk package diff --git a/modules/openapi-generator/src/main/resources/python/__init__package.mustache b/modules/openapi-generator/src/main/resources/python/__init__package.mustache index 78e8331a55c..b6105807797 100644 --- a/modules/openapi-generator/src/main/resources/python/__init__package.mustache +++ b/modules/openapi-generator/src/main/resources/python/__init__package.mustache @@ -19,8 +19,8 @@ __all__ = [ "ApiAttributeError", "ApiException", {{#hasHttpSignatureMethods}}"HttpSigningConfiguration", - {{/hasHttpSignatureMethods}}{{#models}}{{#model}}"{{classname}}", - {{/model}}{{/models}} + {{/hasHttpSignatureMethods}}{{#models}}{{#model}}"{{classname}}"{{^-last}}, + {{/-last}}{{#-last}},{{/-last}}{{/model}}{{/models}} ] # import apis into sdk package diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/__init__.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/__init__.py index f2f0fc3e57f..1203d0f4afb 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/__init__.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/__init__.py @@ -46,7 +46,6 @@ __all__ = [ "TestFormObjectMultipartRequestMarker", "TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter", "TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter", - ] # import apis into sdk package diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/__init__.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/__init__.py index f2f0fc3e57f..1203d0f4afb 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/__init__.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/__init__.py @@ -46,7 +46,6 @@ __all__ = [ "TestFormObjectMultipartRequestMarker", "TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter", "TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter", - ] # import apis into sdk package diff --git a/samples/client/echo_api/python/openapi_client/__init__.py b/samples/client/echo_api/python/openapi_client/__init__.py index f2f0fc3e57f..1203d0f4afb 100644 --- a/samples/client/echo_api/python/openapi_client/__init__.py +++ b/samples/client/echo_api/python/openapi_client/__init__.py @@ -46,7 +46,6 @@ __all__ = [ "TestFormObjectMultipartRequestMarker", "TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter", "TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter", - ] # import apis into sdk package From ec7dba89c6e9c2b9a9539cff3e8a8803756f5608 Mon Sep 17 00:00:00 2001 From: Juanpe Araque Date: Wed, 30 Apr 2025 08:17:13 +0200 Subject: [PATCH 3/3] Add missing samples --- .../client/petstore/python-aiohttp/petstore_api/__init__.py | 1 - .../petstore/python-pydantic-v1-aiohttp/petstore_api/__init__.py | 1 - .../client/petstore/python-pydantic-v1/petstore_api/__init__.py | 1 - samples/openapi3/client/petstore/python/petstore_api/__init__.py | 1 - 4 files changed, 4 deletions(-) diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py index 84a3991e68a..3c1abd3c2ee 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py @@ -144,7 +144,6 @@ __all__ = [ "UploadFileWithAdditionalPropertiesRequestObject", "User", "WithNestedOneOf", - ] # import apis into sdk package diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/__init__.py index fec6084e06e..0a6d6fdf8a2 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/__init__.py @@ -144,7 +144,6 @@ __all__ = [ "UploadFileWithAdditionalPropertiesRequestObject", "User", "WithNestedOneOf", - ] # import apis into sdk package diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/__init__.py index fec6084e06e..0a6d6fdf8a2 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/__init__.py @@ -144,7 +144,6 @@ __all__ = [ "UploadFileWithAdditionalPropertiesRequestObject", "User", "WithNestedOneOf", - ] # import apis into sdk package diff --git a/samples/openapi3/client/petstore/python/petstore_api/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/__init__.py index 84a3991e68a..3c1abd3c2ee 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/__init__.py @@ -144,7 +144,6 @@ __all__ = [ "UploadFileWithAdditionalPropertiesRequestObject", "User", "WithNestedOneOf", - ] # import apis into sdk package