Falcon: missing a params in quickstart's JSONTranslator

Created on 26 Sep 2019  路  4Comments  路  Source: falconry/falcon

def process_response(self, req, resp, resource, params):
    if not hasattr(resp.context, 'result'):
        return
documentation

Most helpful comment

The names here are admittedly a bit confusing; it sounds like we may need to clarify the docs for the params argument passed to process_resource() and hooks to make it clear that they only contain values from the URI path, not the query string, and point the reader to Request.params.

In the future, we should probably either rename the params argument to make it more clear how it differs from Request.params and/or implement query string support for the URI templates.

All 4 comments

I think he means middleware receives an empty dict (<class 'dict'>: {}) as params argument. I got the same problem with hooks. You can use req.params to get what you're looking for.

tks, I will check out. I just thought maybe in quickstart add the params will be nice.

The problem has already been resolved in lattest docs version
But stable docs version keep linked to old docs release

@kgriffs i think you can close this issue, because problem will be automatically solved with the next release.

The names here are admittedly a bit confusing; it sounds like we may need to clarify the docs for the params argument passed to process_resource() and hooks to make it clear that they only contain values from the URI path, not the query string, and point the reader to Request.params.

In the future, we should probably either rename the params argument to make it more clear how it differs from Request.params and/or implement query string support for the URI templates.

Was this page helpful?
0 / 5 - 0 ratings