We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
HI,
schema().loads failed to load Optional fields correctly. It raises: marshmallow.exceptions.ValidationError: {'b': ['Field may not be null.']}
marshmallow.exceptions.ValidationError: {'b': ['Field may not be null.']}
Example code:
from typing import Optional from dataclasses import dataclass from dataclasses_json import dataclass_json @dataclass_json @dataclass class A: a: int b: Optional[int] print(A.from_json('{"a": 4, "b": 5}')) print(A.from_json('{"a": 4, "b": null}')) print(A.schema().loads('{"a": 4, "b": 5}')) print(A.schema().loads('{"a": 4, "b": null}'))
The last line raises ValidationError. I am using version 0.2.1.
Thanks.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. Fixed in #66
Sorry, something went wrong.
No branches or pull requests
HI,
schema().loads failed to load Optional fields correctly. It raises:
marshmallow.exceptions.ValidationError: {'b': ['Field may not be null.']}
Example code:
The last line raises ValidationError.
I am using version 0.2.1.
Thanks.
The text was updated successfully, but these errors were encountered: