Repository navigation
Description
allowing $schema in JSON files was a good idea - see #106
but pinning it to a certain value - as if it was a namespace - was just wrong.
this pinning prevents reusing JSON documents that adhere to multiple schemas.
lets take the following JSON:
{
"$schema": "http://cyclonedx.org/schema/bom-1.3.schema.json",
"bomFormat": "CycloneDX",
"specVersion": "1.3",
"components": []
}see also:
specification/schema/bom-1.5.schema.json
Lines 13 to 18 in 8af880d
| "$schema": { | |
| "type": "string", | |
| "enum": [ | |
| "http://cyclonedx.org/schema/bom-1.5.schema.json" | |
| ] | |
| }, |
This document IS valid to schema http://cyclonedx.org/schema/bom-1.3.schema.json.
This document WOULD also be valid to schema http://cyclonedx.org/schema/bom-1.5.schema.json, IF the $schema was removed from the document (since the $schema has an enum pining).
Let's make documents be able to be validated by upgraded schema-parsers.
The required change: remove the enum pinning from the $schema property.
Activity
jkowalleck commentedon Mar 18, 2024
this change would also enable us to put
$schemaon our test data, without a need to change this with every bugfix/patch -- see #138remove restriction on json's `$schema` annotation (#403)
[WIP] v1.6 (#323)
[WIP] v1.6 (#323)
remove restriction on json's `$schema` annotation (CycloneDX#403)
[WIP] v1.6 (CycloneDX#323)