mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-06-29 12:10:54 +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}}
|
{{#operation}}
|
||||||
|
|
||||||
@validate_call
|
@validate_call
|
||||||
{{#asyncio}}
|
{{#asyncio}}async {{/asyncio}}def {{operationId}}(
|
||||||
async def {{operationId}}(
|
|
||||||
self,
|
self,
|
||||||
{{#allParams}}
|
{{#allParams}}
|
||||||
{{paramName}}: {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}},
|
{{paramName}}: {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}},
|
||||||
{{/allParams}}
|
{{/allParams}}
|
||||||
**kwargs,
|
**kwargs,
|
||||||
) -> {{{returnType}}}{{^returnType}}None{{/returnType}}:
|
) -> {{{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
|
"""{{#isDeprecated}}(Deprecated) {{/isDeprecated}}{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
|
||||||
|
|
||||||
{{#notes}}
|
{{#notes}}
|
||||||
@ -97,24 +86,13 @@ class {{classname}}:
|
|||||||
)
|
)
|
||||||
|
|
||||||
@validate_call
|
@validate_call
|
||||||
{{#asyncio}}
|
{{#asyncio}}async {{/asyncio}}def {{operationId}}_with_http_info(
|
||||||
async def {{operationId}}_with_http_info(
|
|
||||||
self,
|
self,
|
||||||
{{#allParams}}
|
{{#allParams}}
|
||||||
{{paramName}}: {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}},
|
{{paramName}}: {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}},
|
||||||
{{/allParams}}
|
{{/allParams}}
|
||||||
**kwargs,
|
**kwargs,
|
||||||
) -> ApiResponse:
|
) -> 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
|
"""{{#isDeprecated}}(Deprecated) {{/isDeprecated}}{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
|
||||||
|
|
||||||
{{#notes}}
|
{{#notes}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user