mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-06-29 04:00:51 +00:00
chore: Simplify async/non-async api method templates (#16820)
This commit is contained in:
parent
769990d654
commit
438bf25a47
@ -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}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user