specVersion has no restrictions on value #476
Replies: 3 comments 5 replies
-
Yes, according to the spec, they MUST allow arbitrary strings for lets try the following { "bomFormat": "CycloneDX", "specVersion": "1.6", "components": [{
"type": "library",
"name": "foo",
"version": "v124",
"modified": false
}]} this is valid for schema >= 1.2 < 2. regardless of the value in Let's say I have a tool supporting the entirety of CycloneDX 1.2 JSON. not 1.3 or later. if this would be changed, then this would be a breaking change. |
Beta Was this translation helpful? Give feedback.
-
I don't think that is a valid bom for 1.2 because you're missing the Regardless, if you added a version, it won't pass this tools validation: https://cyclonedx.github.io/cyclonedx-web-tool When I put it in I got the message: I would propose a path forward: make the general guidance to validation tools be that they should only validate BOMs which contain a Another path would be to allow for either a string (what we have now) or a number. If it is a number then it has to be a valid CycloneDX version number and if it is a string then it can be whatever. |
Beta Was this translation helpful? Give feedback.
-
Related: #438 |
Beta Was this translation helpful? Give feedback.
-
The JSON schema has
specVersion
as a string with no restrictions on its value. This means that a BOM with any random string for a specVersion is valid, like:Is this the intention? Should validation tools allow for random strings in the specVersion field? Or should they restrict to the known valid spec versions?
Beta Was this translation helpful? Give feedback.
All reactions