Incorrect set http response data when returning flask.Response objects
From the documentation:
"If the endpoint returns a Response object this response will be used as is."
The response is parsed in connexion.decorators.decorator.BaseDecorator.get_full_response() and the response object itself is mistakenly set as the response's data instead of response.data:
This later throws a JSON serialize error when trying to JSON serialize the data variable (mistaken Response object)
Output of the commands:
python --versionpip show connexion | grep "^Version\:"I got it to work by replacing these lines
with this:
response = data
data = response.data
status_code = response.status_code
headers = response.headers
@heyglen Thank you for reporting it.
Most helpful comment
I got it to work by replacing these lines
with this: