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
Used Cerberus version: 1.3.4
There is a value in my schema that can be an integer or a string or null.
This seems like a bug, because as soon as I try to introduce an anyof* rule, the nullable rule is no longer respected.
anyof*
nullable
nullable works with only a single type. The following validate() call returns True.
validate()
schema = {"foo": {"type": "integer", "nullable": True}} Validator(schema).validate({"foo": None})
nullable stops working with multiple possible types. All of the following validate() calls erroneously return False.
schema = {"foo": {"anyof_type": ["integer", "string"], "nullable": True}} Validator(schema).validate({"foo": None})
schema = {"foo": {"anyof": [{"type": "integer"}, {"type": "string"}, {"nullable": True}]}} Validator(schema).validate({"foo": None})
schema = {"foo": {"anyof": [{"type": "integer", "nullable": True}, {"type": "string", "nullable": True}, {"nullable": True}]}} Validator(schema).validate({"foo": None})
The text was updated successfully, but these errors were encountered:
35d9f7b
No branches or pull requests
Used Cerberus version: 1.3.4
Use-case abstract
There is a value in my schema that can be an integer or a string or null.
Bug report
This seems like a bug, because as soon as I try to introduce an
anyof*
rule, thenullable
rule is no longer respected.nullable
works with only a single type. The followingvalidate()
call returns True.nullable
stops working with multiple possible types. All of the followingvalidate()
calls erroneously return False.The text was updated successfully, but these errors were encountered: