-
Notifications
You must be signed in to change notification settings - Fork 4
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
record validator addition #12
base: master
Are you sure you want to change the base?
record validator addition #12
Conversation
576eb1a
to
7807d7b
Compare
"""A check that returns a warning.""" | ||
errors = {} | ||
if data.get('hello', '') == 'world': | ||
errors['hello'] = [{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am assuming that checker functions will return in the key
that has the problem a list of errors (even if there is only one). So after I use extend
- https://github.com/inveniosoftware-contrib/invenio-record-editor/pull/12/files#diff-71a4f12cd34d737a14762152409ffef7R66
I am not sure if we should allow to return also just a dict
for cases with only one problem and deal with it on RecordValidator.validate
7807d7b
to
abd2d50
Compare
2 similar comments
* Adds API endpoint for custom validation of records. * Adds util class RecordValidator for running multiple validation functions. * New config RECORD_EDITOR_VALIDATOR_FUNCTIONS to pass all validation functions that need to run on the record. Signed-off-by: Javier Martin Montull <[email protected]>
abd2d50
to
4db1d93
Compare
Adds API endpoint for custom validation of records.
Adds util class RecordValidator for running multiple validation functions.
New config RECORD_EDITOR_VALIDATOR_FUNCTIONS to pass all validation
functions that need to run on the record.
Signed-off-by: Javier Martin Montull [email protected]