cyclonedx-cli icon indicating copy to clipboard operation
cyclonedx-cli copied to clipboard

Improve JSON validation

Open andreas-hilti opened this issue 2 years ago • 1 comments

Improve JSON validation, in particular if you don't specify the specification version.

This helps to address https://github.com/CycloneDX/cyclonedx-cli/issues/221.

On the given example, it will result in:

cyclonedx.exe validate --input-file badType_log4j_2.17.2_cyclonedx_1.3_sbom.json
Validation failed: Value is "boolean" but should be "string"
#/properties/dependencies/items/$ref/properties/ref/type
On instance: #/dependencies/0/ref:
True
Unable to validate against any JSON schemas.
BOM is not valid.

andreas-hilti avatar Apr 21 '23 21:04 andreas-hilti

There are a couple of merge tests that fail due to the update of CycloneDX.Utils; however, they are unrelated to the changes in the validation.

andreas-hilti avatar Apr 21 '23 21:04 andreas-hilti