-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
BaseField: the parameters required
and nullable
have counter-intuitive results
#167
Comments
Just to add to this - if the jsonmodel is used to produce a jsonschema, and that schema is used to validate json, then nullable does have an effect: if nullable is False, null values in the json will throw an error. So it seems that this behavior is inconsistent between the jsonschema the jsonmodel creates and the jsonmodel's own expectations. |
Hey, thanks @vaughnkoch - will dive into this problem during next days |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, first off, thanks for writing and maintaining this library!
The code below shows a very basic jsonmodel with two different permutations of
required
andnullable
forBaseField
.The two problems are:
nullable
is not properly enforced - even if a field is not required, it should be possible to deny null values. (required=false, nullable=False
).required=True, nullable=True
).I looked through the documentation and examples, and couldn't find a way to achieve these two goals, although I could have missed something.
Example (tested with
jsonmodels
2.5.1):Also, there doesn't appear to be much documentation on
nullable
.The text was updated successfully, but these errors were encountered: