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
This causes confusion with Flask's make_response which behaves differently, and it also makes it hard to 1) get a consistent API for serialisers over many modules 2) change simple things like e.g. response code while keeping the serialiser the same.
Example:
GET/POST serialisation of an object is likely the same, but often response code will be 200 vs 201/202.
Proposals
A) Always just call make_response() explicitly from views
B) Align with Flask's make_response() and allow either 1) a response (already possible today) or 2) a 2/3-tuple of (response, status, headers) or (response, headers)
The text was updated successfully, but these errors were encountered:
Proposal is still valid and I think should be fixed prior to final release. For both proposal A and B, we need to check all uses of ContentNegotiatedMethodView in other modules.
I would probably go with proposal A which involves:
Problem:
When you define a view method in a subclass of
ContentNegotiatedMethodView
you can currently return (retval
):make_response()
)make_response(*retval)
make_response(retval)
See here
This causes confusion with Flask's
make_response
which behaves differently, and it also makes it hard to 1) get a consistent API for serialisers over many modules 2) change simple things like e.g. response code while keeping the serialiser the same.Example:
GET/POST serialisation of an object is likely the same, but often response code will be 200 vs 201/202.
Proposals
make_response()
explicitly from viewsmake_response()
and allow either 1) a response (already possible today) or 2) a 2/3-tuple of (response, status, headers) or (response, headers)The text was updated successfully, but these errors were encountered: