Closed MrSeccubus closed 3 months ago
The error message is fairly clear: 'references' is a required property
:-) Your record is missing references
which are a required field: https://cveproject.github.io/cve-schema/schema/docs/#oneOf_i0_containers_cna_references
It ia correct it stating that, what is weird is that the sentence that starts with exclusively-hosted-service:
is turned into an array of words and thus makes for a very, very (3 screens) long output that cannot be presented to an end user.
I cannot spot anything in your code that might do this, so suspect this is an upstream bug in the draft7validator.
It's just the way that the schema gets printed by the validator because the issue is in one of the required elements at the top level set of definitions. If the issue was somewhere deeper in a more specific schema element, the output would be much smaller. But yes, it's a bit harder to navigate the output unless you're familiar with it. You can choose to ignore it and only report error_str
:wink:
I've raised it as a ticker in the python-jsonschema
project:
https://github.com/python-jsonschema/jsonschema/issues/1260
For me personally error_str
is too general and what I have now too verbose (because of this bug).
I don't think this is something we should work around in cvelib, so I'd suggest trying to submit patches to jsonschema to improve the formatting of the schema, or add some way to produce different levels of details for the printed schema.
I have this record: https://github.com/DIVD-NL/cna-bot/blob/main/error-cves/cve_5.1/refs/01.missing/CVE-1999-0012.json
When I validate it with this code:
error_str is return as this:
Not sure if this is you bug or a bug in the Draft7Validator.