Skip to content

[BREAKING] Add datatype for Component.bom_ref /Service.bom_ref #170

@jkowalleck

Description

@jkowalleck

From @jkowalleck

The ref/bom-ref properties in CycloneDX are a special kind of string. They are intended to link elements together.
(in Spec 1.4 the ref/bom-ref became an own element-definition, to make this more clear.)
-> refs/bom-refs are used, instead of the actual linked elements.
Having special data types makes it easy to tell elements apart by the reference. and linking elements without memory-leaks is easy.

proposal:
have a data class BomRef. BomRef has a property value of type Optional[str].

  • Components, Services have a property _bom_ref: BomRef and have the the setter for bom_ref removed - as it is a read-only property.property.
  • all usages of ref/bom-ref adopt the use of new data type BomRef instead of str

The above will become critical when we look to implement #7 and doing this now will lower the risk of introducing another breaking change release at that point.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions