Skip to content

Commit

Permalink
chore: Simplify async/non-async api method templates (OpenAPITools#16820
Browse files Browse the repository at this point in the history
)
  • Loading branch information
robertschweizer authored Oct 15, 2023
1 parent 769990d commit 438bf25
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions modules/openapi-generator/src/main/resources/python/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down Expand Up @@ -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}}
Expand Down

0 comments on commit 438bf25

Please sign in to comment.