You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passing an unknown attribute to this route causes a schema error even though the unknown is set to EXCLUDE in the schema's meta class. For example in the above case, if I pass an unknown attribute age:
curl -X POST http://localhost:5000/ --data-raw '{"name": "test", "age": 12}'
it raises a schema error:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>400 Bad Request</title>
<h1>Bad Request</h1>
<p>Error parsing request body: {'age': ['Unknown field.']}</p>
But, if I pass the instance of the schema itself instead of the type by changing these lines:
Simple flask app to reproduce:
Passing an unknown attribute to this route causes a schema error even though the unknown is set to
EXCLUDE
in the schema's meta class. For example in the above case, if I pass an unknown attributeage
:curl -X POST http://localhost:5000/ --data-raw '{"name": "test", "age": 12}'
it raises a schema error:
But, if I pass the instance of the schema itself instead of the type by changing these lines:
then the Meta unknown is considered and no schema errors are raised.
I think the issue is caused by passing
RAISE
as the argument tounknown
on this line.One possible way to fix this could be to not pass any arguments while creating the schema instance, letting the schema itself define its behaviour.
The text was updated successfully, but these errors were encountered: