-
Notifications
You must be signed in to change notification settings - Fork 241
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
Proposal: Add an option to require all defined fields of a schema #417
Comments
It looks like this can be achieved, by changing couple of places, where self.schema[field].get('required', self.forbid_known_missed) |
Ok, I have successfully patched cerberus |
if this gets added, i'd prefer the option name should there also be a same-named flag for (sub-)schemas like |
I think this would make for a nice addition. Feel free to submit a PR so, we can review it. |
@pohmelie a feedback on the progress would be great to have rather soonish as we're getting closer to the next minor release after which new features can't be merged for a while due to planned, larger code changes. |
There are four cases which I think should be covered with validator instance arguments:
allow_unknown=True
)Cerberus have
allow_unknown
option for validator, but have noallow_known_missed
/forbid_known_missed
or something like this. As stackoverflow question said, it is pretty annoying to setrequired: True
for all fields, cause they can be nested and schema looks noisy and dirty.The text was updated successfully, but these errors were encountered: