forked from loafle/openapi-generator-original
[python-flask] Fix return type too strict (#12190)
Flask (and connexion by extension) allows the return type to be either just the body, or the body & status code, or the body & status code & headers. This commit fixes the stated `rtype` to allow the latter two cases.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import connexion
|
||||
import six
|
||||
from typing import Dict
|
||||
from typing import Tuple
|
||||
from typing import Union
|
||||
|
||||
{{#imports}}{{import}} # noqa: E501
|
||||
{{/imports}}
|
||||
@@ -55,7 +58,7 @@ def {{operationId}}({{#allParams}}{{paramName}}{{^required}}=None{{/required}}{{
|
||||
{{/isMap}}
|
||||
{{/allParams}}
|
||||
|
||||
:rtype: {{returnType}}{{^returnType}}None{{/returnType}}
|
||||
:rtype: Union[{{returnType}}{{^returnType}}None{{/returnType}}, Tuple[{{returnType}}{{^returnType}}None{{/returnType}}, int], Tuple[{{returnType}}{{^returnType}}None{{/returnType}}, int, Dict[str, str]]
|
||||
"""
|
||||
{{#allParams}}
|
||||
{{^isContainer}}
|
||||
|
||||
Reference in New Issue
Block a user