-
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validation fails for valid JSON BOMs #202
Comments
Oh, I see this is a known issue... 😅 The schemas do not differ in a way that could explain this. $ diff cyclonedx-specification/schema/bom-1.4.schema.json cyclonedx-dotnet-library/src/CycloneDX.Core/Schemas/bom-1.4.schema.json
614c614
< "$ref": "spdx.schema.json",
---
> "$ref": "file://spdx.schema.json",
1692c1692
< "$ref": "jsf-0.82.schema.json#/definitions/signature",
---
> "$ref": "file://jsf-0.82.schema.json#/definitions/signature", Could this be an issue with the JSON schema library used? |
I was able to debug this by lifting these restrictions of adding validation results to the output message.
The JSON schema validator used in
In all other files, addresses are either valid (as in, have a TLD) or are simply not present at all. When adding a TLD, validation succeeds. However, AFAICT, the RFCs behind Is this a bug in the schema library then? Their implementation of |
see CycloneDX/cyclonedx-cli#202 Signed-off-by: nscuro <nscuro@protonmail.com>
* ci: update cyclonedx-cli: `0.15.2` -> `0.22.0` Signed-off-by: nscuro <nscuro@protonmail.com> * test: fix cyclonedx-cli invocation Signed-off-by: nscuro <nscuro@protonmail.com> * test: rename testdata files to not include spec version will allow us to spot differences after v1.4 update more easily Signed-off-by: nscuro <nscuro@protonmail.com> * test: add testdata input files for v1.4 Signed-off-by: nscuro <nscuro@protonmail.com> * wip: implement v1.4 changes adds release notes and vulnerabilities Signed-off-by: nscuro <nscuro@protonmail.com> * use `string` for timestamp fields; fix `response` field for json Signed-off-by: nscuro <nscuro@protonmail.com> * move new types to `cyclonedx.go` Signed-off-by: nscuro <nscuro@protonmail.com> * fix affected versions for json Signed-off-by: nscuro <nscuro@protonmail.com> * update snapshots for v1.4 Signed-off-by: nscuro <nscuro@protonmail.com> * make json validator happy see CycloneDX/cyclonedx-cli#202 Signed-off-by: nscuro <nscuro@protonmail.com> * add jsf model Signed-off-by: nscuro <nscuro@protonmail.com> * Revert "add jsf model" This reverts commit abee4cf. JSF support will be implemented with #17 Signed-off-by: nscuro <nscuro@protonmail.com> Closes #14
probably an other case
and the generated BOM is not valid, without any modification
|
Another way to reproduce this is to use a BOM that has invalid licenses in it. This one did it for me, the validation fails with no message:
As a test, I changed to MIT and then the BOM validated. |
I'm using the CLI to ensure that
cyclonedx-go
andcyclonedx-gomod
produce valid BOMs.While implementing support for spec v1.4 in
cyclonedx-go
, I noticed that some JSON BOMs fail to validate without apparent reason.The validation fails not only for the BOMs produced by the Go tooling, but also for the input test files from the
specification
repo.When testing the offending files using other tools like https://www.jsonschemavalidator.net/ with the official schema, validation succeeds.
Steps to reproduce
This yields 3 failing validations:
The same happens when validating files within
tools/src/test/resources/1.4/valid-*.json
using--input-version v1_3
, albeit only forvalid-bom-1.3.json
. I did not observe this behavior with XML BOMs.The text was updated successfully, but these errors were encountered: