Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jmartinm
Copy link
Contributor

@jmartinm jmartinm commented Feb 2, 2017

  • 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]

"""A check that returns a warning."""
errors = {}
if data.get('hello', '') == 'world':
errors['hello'] = [{
Copy link
Contributor Author

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

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.5%) to 98.462% when pulling abd2d50 on jmartinm:validator-endpoint into 874d16b on inveniosoftware-contrib:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.5%) to 98.462% when pulling abd2d50 on jmartinm:validator-endpoint into 874d16b on inveniosoftware-contrib:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.5%) to 98.462% when pulling abd2d50 on jmartinm:validator-endpoint into 874d16b on inveniosoftware-contrib:master.

* 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]>
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.4%) to 98.63% when pulling 4db1d93 on jmartinm:validator-endpoint into 42fb668 on inveniosoftware-contrib:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.4%) to 98.63% when pulling 4db1d93 on jmartinm:validator-endpoint into 42fb668 on inveniosoftware-contrib:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.4%) to 98.63% when pulling 4db1d93 on jmartinm:validator-endpoint into 42fb668 on inveniosoftware-contrib:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants