You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cyclonedx/model/vulnerability.py
+13-10
Original file line number
Diff line number
Diff line change
@@ -486,43 +486,46 @@ class VulnerabilityReference:
486
486
487
487
.. note::
488
488
See the CycloneDX schema: https://cyclonedx.org/docs/1.6/xml/#type_vulnerabilityType
489
+
490
+
.. note::
491
+
Properties ``id`` and ``source`` are mandatory.
492
+
In v1.4 JSON scheme, both properties were mandatory: https://github.com/CycloneDX/specification/blob/d570ffb8956d796585b9574e57598c42ee9de770/schema/bom-1.4.schema.json#L1455-L1474
493
+
In v1.4 XML schema, both properties were optional: https://github.com/CycloneDX/specification/blob/d570ffb8956d796585b9574e57598c42ee9de770/schema/bom-1.4.xsd#L1788-L1797
494
+
In v1.5 XML schema, both were mandatory: https://github.com/CycloneDX/specification/blob/d570ffb8956d796585b9574e57598c42ee9de770/schema/bom-1.5.xsd#L3364-L3374
495
+
Decision: since CycloneDXCoreWorkingGroup chose JSON schema as the dominant schema, the one that serves as first spec implementation, and since XML schema was "fixed" to work same as JSON schema, we'd consider it canon/spec that both properties were always mandatory.
489
496
"""
490
497
491
498
def__init__(
492
499
self, *,
493
-
id: Optional[str] =None,
494
-
source: Optional[VulnerabilitySource] =None,
500
+
id: str,
501
+
source: VulnerabilitySource,
495
502
) ->None:
496
-
ifnotidandnotsource:
497
-
raiseNoPropertiesProvidedException(
498
-
'Either id or source must be provided for a VulnerabilityReference - neither provided'
0 commit comments