Closed MrSeccubus closed 1 month ago
@MrSeccubus If you're using CveRecord.validate()
(from cvelib.cve_api
) it will throw an exception that will have an errors
attribute that contains all of the jsonschema-identified issues in the validated JSON.
Thanks, it indeed looks promising.
Was it a deliberate choise to let this method raise an exeception, because in my mind a validation routine getting data that does not validate is not an execption, but an exepected result.
Yes, the exception is just the delivery mechanism of the errors and can also be used to halt the execution of whatever is validating the content.
As a use I would like to have more detailed errors when a CVE record does not validate.
Where's the code I have in cna-bot for this:
This also prints out the path of the offending item.