docs: Change complex example to match new middleware feature
The `process_response` method of `JSONTranslator` is missing the `resource` argument in order to fully comply with the new middleware feature. Closes #443
This commit is contained in:
@@ -282,7 +282,7 @@ class JSONTranslator(object):
|
||||
'JSON was incorrect or not encoded as '
|
||||
'UTF-8.')
|
||||
|
||||
def process_response(self, req, resp):
|
||||
def process_response(self, req, resp, resource):
|
||||
if 'result' not in req.context:
|
||||
return
|
||||
|
||||
|
||||
@@ -302,7 +302,7 @@ Here is a more involved example that demonstrates reading headers and query para
|
||||
'JSON was incorrect or not encoded as '
|
||||
'UTF-8.')
|
||||
|
||||
def process_response(self, req, resp):
|
||||
def process_response(self, req, resp, resource):
|
||||
if 'result' not in req.context:
|
||||
return
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ class JSONTranslator(object):
|
||||
'JSON was incorrect or not encoded as '
|
||||
'UTF-8.')
|
||||
|
||||
def process_response(self, req, resp):
|
||||
def process_response(self, req, resp, resource):
|
||||
if 'result' not in req.context:
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user