As a person that has to debug validation failures, it would be helpful if the exception provided more details about what validation failed
Currently any failed validation says
RootedData\Exception\ValidationException: JSON Schema validation failed.
I am suggesting we iterate through the errors and list them so the output of the exception would be
RootedData\Exception\ValidationException: JSON Schema validation failed.
1) data -> describedByType: application/pdf
Reproduction steps
Reproducing this is challenging as you need to start with invalid schema which is hard to save, because we don't allow invalid data.
- First you need a dataset json that is invalid. (an empty downloadUrl or a describedByType = 7)
- Then you can run it through $this->validMetadataFactory->get($json_string, $schema_id)
- This should result in a validation exception being thrown. Without the PR it will just tell you it failed validation, with the PR it will tell you what element(s) and values filed validation.
As a person that has to debug validation failures, it would be helpful if the exception provided more details about what validation failed
Currently any failed validation says
I am suggesting we iterate through the errors and list them so the output of the exception would be
Reproduction steps
Reproducing this is challenging as you need to start with invalid schema which is hard to save, because we don't allow invalid data.