specification
specification copied to clipboard
fix(tests): enable JS functional tests for CycloneDX 2.0
What
Fixes the JS functional test harness for CycloneDX 2.0:
- Resolve the correct 2.0 schema (
schema/2.0/cyclonedx-2.0-bundled.schema.json) when running-v 2.0. - Use the Ajv 2020-12 build for 2.0 schemas.
- Register referenced schemas under both http and https IDs to avoid ref resolution mismatches.
- Align 2.0 cryptography "valid-*" test vectors with the bundled schema by wrapping single values in one-element arrays:
components[].cryptoProperties.algorithmProperties.implementationPlatformcomponents[].cryptoProperties.securedBy[].algorithmRef
Why
node tools/src/test/js/json-schema-functional-tests.js -v 2.0 previously failed due to:
- outdated schema path assumptions (
schema/bom-2.0.schema.json) - missing draft 2020-12 meta-schema support in Ajv
- a small mismatch in 2.0 cryptography test vectors where the schema expects arrays
Testing
cd tools/src/test/js && npm install && npm testnode json-schema-functional-tests.js -v 2.0
Closes #835