Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(restapi): fix API ignoring query string parameters for GET requests #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

crabique
Copy link

Hello, it's me again 馃檪

Webargs 6.0 changed the behaviour of data location lookups to be single-source instead of a union of all locations, the default now is json and it only looks in there.

This broke the /versions endpoint of the rest-api, because it expects filter_expression and include_blocks as query string parameters: GET method does not have a request body (json) in its specification, so only query string is available.

Inside the route-decorated function call, the following state can be observed:

request.body.getvalue(): filter_expression=123&include_blocks=true
locals(): {'self': <benji.restapi.RestAPI object at 0x7f5a23fc6280>, 'filter_expression': None, 'include_blocks': False}

This change fixes this problem by forcing webargs to look into the query string parameters if it is a GET request, falling back to the default json otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant