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
fields.Contsant only works for fields which are already present in the object.
fields.Contsant
from marshmallow import fields, Schema, pprint class Test(Schema): field = fields.Constant(0) field2 = fields.Constant(1) pprint(Test().load({'field': 1}))
I'd expect this code to give me:
UnmarshalResult(data={'field': 0, 'field2': 1}, errors={})
But this is what I get:
UnmarshalResult(data={'field': 0}, errors={})
If this is the expected behavior, it isn't really clear from the docs. So either the docs or the behavior ought to be changed.
The text was updated successfully, but these errors were encountered:
This is indeed a bug. Fixed in a69622c. Thanks @fayazkhan for reporting.
Sorry, something went wrong.
No branches or pull requests
fields.Contsant
only works for fields which are already present in the object.I'd expect this code to give me:
But this is what I get:
If this is the expected behavior, it isn't really clear from the docs.
So either the docs or the behavior ought to be changed.
The text was updated successfully, but these errors were encountered: