You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It should work except that the function is inside a call to flask.jsonify() wich doesn't allow for anything but json serailization. So I have to override the entire response function to rewrite just that one line.
If we replace flask.jsonify()by flask.make_response() it allow for much greater customization, including setting custom headers. That would break the default serialization but that can be fix by doing the equivalent of jsonify inside of _prepare_response_content:
All my endpoint support serializing to JSON and CBOR. It is done by overriding the
_prepare_response_content
like that:It should work except that the function is inside a call to
flask.jsonify()
wich doesn't allow for anything but json serailization. So I have to override the entireresponse
function to rewrite just that one line.flask-smorest/flask_smorest/response.py
Lines 110 to 111 in 5ac7296
If we replace
flask.jsonify()
byflask.make_response()
it allow for much greater customization, including setting custom headers. That would break the default serialization but that can be fix by doing the equivalent ofjsonify
inside of_prepare_response_content
:I think this is a small modificatrion that would really make supporting multiple content-type much easier.
Is there any other impact that I have not forseen ? If this modification is acceptable I can do the merge request / documentation.
The text was updated successfully, but these errors were encountered: