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
A dependency is not considered satisfied if it has a null value #305
Comments
No, a required field with a null value satisfies the >>> from cerberus import Validator
... validator = Validator(schema={
... 'field1': {
... 'required': True,
... 'nullable': True
... },
... 'field2': {
... 'required': False,
... #'dependencies': 'field1'
... }
... })
... document = {
... 'field1': None,
... 'field2': 'foo'
... }
>>> assert validator.validate(document), validator.errors
>>> |
davidt99
pushed a commit
to davidt99/cerberus
that referenced
this issue
Apr 13, 2017
davidt99
pushed a commit
to davidt99/cerberus
that referenced
this issue
Apr 13, 2017
davidt99
added a commit
to davidt99/cerberus
that referenced
this issue
Apr 13, 2017
davidt99
added a commit
to davidt99/cerberus
that referenced
this issue
Apr 16, 2017
funkyfuture
added a commit
to funkyfuture/cerberus
that referenced
this issue
Apr 17, 2017
Before that a document field with None as value was considered to be absent in the document. Also gets the nullable rule's constraint from Validator.ignore_none_values in case that one may not be the default. Amended docs to clarify that. Fixes pyeve#305
funkyfuture
added a commit
to funkyfuture/cerberus
that referenced
this issue
Apr 17, 2017
Before that a document field with None as value was considered to be absent in the document. Also gets the nullable rule's constraint from Validator.ignore_none_values in case that one may not be the default. Amended docs to clarify that. Fixes pyeve#305
funkyfuture
added a commit
to funkyfuture/cerberus
that referenced
this issue
Apr 18, 2017
Before that a document field with None as value was considered to be absent in the document. Also gets the nullable rule's constraint from Validator.ignore_none_values in case that one may not be the default. Amended docs to clarify that. Fixes pyeve#305
funkyfuture
added a commit
to funkyfuture/cerberus
that referenced
this issue
Apr 18, 2017
Before that a document field with None as value was considered to be absent in the document. Also gets the nullable rule's constraint from Validator.ignore_none_values in case that one may not be the default. Amended docs to clarify that. Fixes pyeve#305
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Used Cerberus version / latest commit: 1.1
I consulted these documentations:
I consulted these sections of the docs (add more lines as necessary):
I found nothing relevant to my problem in the docs.
I found the documentation not helpful to my problem.
I have the capacity to improve the docs when my problem is solved.
I have the capacity to submit a patch when a bug is identified.
Use-case abstract
A dependency is not considered satisfied if it has a null value.
Support request / Bug report
To reproduce:
This seems wrong considering required fields with a null value satisfy the required constraint, but not a dependency.
The text was updated successfully, but these errors were encountered: