Flask-RESTful automatically converts a response body to JSON when it
creates the Response object. The Flask app configuration option
RESTFUL_JSON is added by this commit to appropriately modify how the
JSON body is constructed.
response_filter has been modified so that it returns a tuple of
information that Flask-RESTful will use to create an appropriately
formatted response.
Resource.error_response is creating the Response object itself and so
has been modified to format the JSON in the same way as Flask-RESTful.
Ideally, error_response would not create a separate Response object
however addressing this is a separate issue.
Reviewed: https:/ /review. openstack. org/442588 /git.openstack. org/cgit/ openstack/ craton/ commit/ ?id=0f7ee6d7918 9b2d8c5a81cf9e9 598f96575f511d
Committed: https:/
Submitter: Jenkins
Branch: master
commit 0f7ee6d79189b2d 8c5a81cf9e9598f 96575f511d
Author: git-harry <email address hidden>
Date: Tue Mar 7 15:33:08 2017 +0000
Pretty-print format all JSON response bodies
Flask-RESTful automatically converts a response body to JSON when it
creates the Response object. The Flask app configuration option
RESTFUL_JSON is added by this commit to appropriately modify how the
JSON body is constructed.
response_filter has been modified so that it returns a tuple of
information that Flask-RESTful will use to create an appropriately
formatted response.
Resource. error_response is creating the Response object itself and so
has been modified to format the JSON in the same way as Flask-RESTful.
Ideally, error_response would not create a separate Response object
however addressing this is a separate issue.
Change-Id: I02eafaf48d7c6e 2ceab0add2f78cf 6aa1b890f18
Closes-bug: 1664328