pepkit / eido

Validator for PEP objects
http://eido.databio.org
BSD 2-Clause "Simplified" License
4 stars 6 forks source link

Multiple validation errors #40

Closed aliparslan closed 1 year ago

aliparslan commented 1 year ago

This pull request attempts to change the way validation errors are defined and handled. Currently, when a project isn't able to be validated successfully by eido, a jsonschema.exceptions.ValidationError is returned, which heuristically returns the "best" error. There is no way to view everything that doesn't match up—once one error is fixed, the next one is thrown, each needing to be dealt with individually.

The request adds a new EidoValidationError exception and changes the way validation is done by using jsonschema's Draft7Validator instead of validate. Using a validator enables all errors to be viewed at once, and the error that is thrown returns a list of where the error is occurring and the reason for it.