specification icon indicating copy to clipboard operation
specification copied to clipboard

[Defect]: 2.0 linked elements - docs and type mismatch

Open jkowalleck opened this issue 3 weeks ago • 1 comments

for some linked types, the description and type don't match.

the description reads:

References using bom-link or refId [...]

but the type is cyclonedx-common-2.0.schema.json#/$defs/refLinkType

either the description is wrong, or the type should be cyclonedx-common-2.0.schema.json#/$defs/elementLink.

example / findings

  • https://github.com/CycloneDX/specification/blob/da93871d287b86a6bd71f85a88316629c2365872/schema/2.0/modules/cyclonedx-blueprint-2.0.schema.json#L163-L171
  • https://github.com/CycloneDX/specification/blob/da93871d287b86a6bd71f85a88316629c2365872/schema/2.0/modules/cyclonedx-control-2.0.schema.json#L93-L102
  • to be continues

context

  • a refLinkType is not a bom-link, but a value of a refId.
  • a bomLinkElementType is a bom-link to an element
  • a bomLinkDocumentType is a bom-link to an entire document
  • and a bomLink is a bomLinkDocumentType or bomLinkElementType
  • and a elementLink is a refLinkType or bomLinkElementType

goal

revisit all the usages of the mentioned things, and check if they match their description text in the respective context.

jkowalleck avatar Nov 11 '26 14:11 jkowalleck

I went through all of 2.0-dev: 98 properties across 13 modules say "bom-link or refId" but are typed refLinkType, almost all in blueprint, threat, risk, control, declaration, data and usecase. It also goes the other way in a few places, e.g. annotation subjects, component identity evidence tools and formulation resourceReferenceChoice are elementLink but described as refId only. Since 98 is a lot, which way do you want it? Switching them to elementLink allows cross-BOM references everywhere, fixing the wording keeps them document-local. I can send a PR for either once you pick.

cvas22 avatar Nov 12 '26 01:11 cvas22