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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webargs+marshmallow raise validation error on unknown api arguments #532

Closed
LefterisJP opened this issue Nov 3, 2019 · 0 comments · Fixed by #782
Closed

Webargs+marshmallow raise validation error on unknown api arguments #532

LefterisJP opened this issue Nov 3, 2019 · 0 comments · Fixed by #782

Comments

@LefterisJP
Copy link
Member

LefterisJP commented Nov 3, 2019

Problem Definition

At the moment unknown keys given to the API are ignored by webargs even though in marshmallow 3 it's possible to choose how to handle unknown fields. We would like to raise validation errors if unknown keys are given.

But webargs does not seem to support it yet. Check:
marshmallow-code/webargs#435
marshmallow-code/webargs#267
marshmallow-code/webargs#420

Task

Once implemented by webargs use this feature to raise errors also on unknown arguments passed to the API. Write some tests for this.

Most probably a single test for all will do such as this xfailing one:

https://github.com/LefterisJP/rotkehlchen/blob/17d9e868b4a3dc6b9b409938f6686904edf774e5/rotkehlchen/tests/api/test_settings.py#L111-L127

LefterisJP added a commit to LefterisJP/rotkehlchen that referenced this issue Mar 11, 2020
Fix rotki#532

If an invalid/unknown argument is given to an endpoint then an error
is now properly raised
LefterisJP added a commit that referenced this issue Mar 11, 2020
Fix #532

If an invalid/unknown argument is given to an endpoint then an error
is now properly raised
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 a pull request may close this issue.

1 participant