Skip to content

Commit 5c954d1

Browse files
committed
fix: Component.bom_ref is not Optional in our model implementation (in the schema it is) - we generate a UUID if bom_ref is not supplied explicitly
Signed-off-by: Paul Horton <[email protected]>
1 parent 9b6ce4b commit 5c954d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cyclonedx/model/component.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ def mime_type(self, mime_type: Optional[str]) -> None:
766766
self._mime_type = mime_type
767767

768768
@property
769-
def bom_ref(self) -> Optional[str]:
769+
def bom_ref(self) -> str:
770770
"""
771771
An optional identifier which can be used to reference the component elsewhere in the BOM. Every bom-ref MUST be
772772
unique within the BOM.
@@ -779,7 +779,7 @@ def bom_ref(self) -> Optional[str]:
779779
return self._bom_ref
780780

781781
@bom_ref.setter
782-
def bom_ref(self, bom_ref: Optional[str]) -> None:
782+
def bom_ref(self, bom_ref: str) -> None:
783783
self._bom_ref = bom_ref
784784

785785
@property

0 commit comments

Comments
 (0)