From 438bf25a4768af3e419d42dac6d5a26d30e89be8 Mon Sep 17 00:00:00 2001 From: Robert Schweizer Date: Sun, 15 Oct 2023 04:44:43 +0200 Subject: [PATCH] chore: Simplify async/non-async api method templates (#16820) --- .../src/main/resources/python/api.mustache | 26 ++----------------- 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api.mustache b/modules/openapi-generator/src/main/resources/python/api.mustache index 5b2369b9033d..4578ea735fbb 100644 --- a/modules/openapi-generator/src/main/resources/python/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/api.mustache @@ -36,24 +36,13 @@ class {{classname}}: {{#operation}} @validate_call -{{#asyncio}} - async def {{operationId}}( + {{#asyncio}}async {{/asyncio}}def {{operationId}}( self, {{#allParams}} {{paramName}}: {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}}, {{/allParams}} **kwargs, ) -> {{{returnType}}}{{^returnType}}None{{/returnType}}: -{{/asyncio}} -{{^asyncio}} - def {{operationId}}( - self, - {{#allParams}} - {{paramName}}: {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}}, - {{/allParams}} - **kwargs, - ) -> {{{returnType}}}{{^returnType}}None{{/returnType}}: -{{/asyncio}} """{{#isDeprecated}}(Deprecated) {{/isDeprecated}}{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 {{#notes}} @@ -97,24 +86,13 @@ class {{classname}}: ) @validate_call -{{#asyncio}} - async def {{operationId}}_with_http_info( + {{#asyncio}}async {{/asyncio}}def {{operationId}}_with_http_info( self, {{#allParams}} {{paramName}}: {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}}, {{/allParams}} **kwargs, ) -> ApiResponse: -{{/asyncio}} -{{^asyncio}} - def {{operationId}}_with_http_info( - self, - {{#allParams}} - {{paramName}}: {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}}, - {{/allParams}} - **kwargs, - ) -> ApiResponse: -{{/asyncio}} """{{#isDeprecated}}(Deprecated) {{/isDeprecated}}{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 {{#notes}}