-
Notifications
You must be signed in to change notification settings - Fork 73
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
Different unknown
arguments behaviour locally vs on production
#611
Labels
Comments
You may want to double-check the marshmallow versions are the same, and
perhaps the webargs versions too.
…--
Jérôme
|
Thanks for suggestion @lafrech. They are installed during Docker Compose build from requirements.txt file which is the same for both envs. I rebuild the containers all the time and if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a bit of a sanity check question and I'm not sure which library I should post it in, sorry about that.
TLDR: Q: Is there a flag which disables check for extra params in request locally / in debug / dev scenario? I seem to experience such a thing.
I have Flask app (Flask==2.3.3) with: flask-smorest==0.42.3, marshmallow==3.20.1, webargs==8.4.0.
I have Marshmallow schema defined with a few fields and a Smorest blueprint endpoint with arguments decorator which expects a SUBSET of the schema (no
id
,date_created
, etc.):What happens is when I run this locally (in Docker but in dev mode) I can run PUT request with extra params and it goes through, but when I run the same code on remote server with production settings I get '"Unknown field" errors for the extra fields.
What's more I added
unknown=ma.EXCLUDE
:@blp.arguments(ItemSchema(only=("name", "description", "language"), unknown=ma.EXCLUDE))
which solves the problem on the remote server. But even if I tried to set it explicitly to RAISE it is still ignored locally - I can pass extra arguments without errors. These settings seem to be completely ignored. Is there any obvious thing that may affect it?
The text was updated successfully, but these errors were encountered: