@@ -62,7 +62,7 @@ class BomTargetVersionRange:
62
62
`version` and `version_range` are mutually exclusive.
63
63
64
64
.. note::
65
- See the CycloneDX schema: https://cyclonedx.org/docs/1.6/#type_vulnerabilityType
65
+ See the CycloneDX schema: https://cyclonedx.org/docs/1.6/xml/ #type_vulnerabilityType
66
66
"""
67
67
68
68
def __init__ (
@@ -219,7 +219,7 @@ class VulnerabilityAnalysis:
219
219
Class that models the `analysis` sub-element of the `vulnerabilityType` complex type.
220
220
221
221
.. note::
222
- See the CycloneDX schema: https://cyclonedx.org/docs/1.6/#type_vulnerabilityType
222
+ See the CycloneDX schema: https://cyclonedx.org/docs/1.6/xml/ #type_vulnerabilityType
223
223
"""
224
224
225
225
def __init__ (
@@ -229,11 +229,6 @@ def __init__(
229
229
responses : Optional [Iterable [ImpactAnalysisResponse ]] = None ,
230
230
detail : Optional [str ] = None ,
231
231
) -> None :
232
- if not state and not justification and not responses and not detail :
233
- raise NoPropertiesProvidedException (
234
- 'At least one of state, justification, responses or detail must be provided for VulnerabilityAnalysis '
235
- '- none supplied'
236
- )
237
232
self .state = state
238
233
self .justification = justification
239
234
self .responses = responses or [] # type:ignore[assignment]
@@ -408,18 +403,14 @@ class VulnerabilitySource:
408
403
This type is used for multiple purposes in the CycloneDX schema.
409
404
410
405
.. note::
411
- See the CycloneDX schema: https://cyclonedx.org/docs/1.6/#type_vulnerabilitySourceType
406
+ See the CycloneDX schema: https://cyclonedx.org/docs/1.6/xml/ #type_vulnerabilitySourceType
412
407
"""
413
408
414
409
def __init__ (
415
410
self , * ,
416
411
name : Optional [str ] = None ,
417
412
url : Optional [XsUri ] = None ,
418
413
) -> None :
419
- if not name and not url :
420
- raise NoPropertiesProvidedException (
421
- 'Either name or url must be provided for a VulnerabilitySource - neither provided'
422
- )
423
414
self .name = name
424
415
self .url = url
425
416
@@ -480,7 +471,7 @@ class VulnerabilityReference:
480
471
intelligence.
481
472
482
473
.. note::
483
- See the CycloneDX schema: https://cyclonedx.org/docs/1.6/#type_vulnerabilityType
474
+ See the CycloneDX schema: https://cyclonedx.org/docs/1.6/xml/ #type_vulnerabilityType
484
475
"""
485
476
486
477
def __init__ (
@@ -723,7 +714,7 @@ class VulnerabilityRating:
723
714
1.4 - see https://github.com/CycloneDX/specification/blob/master/schema/ext/vulnerability-1.0.xsd.
724
715
725
716
.. note::
726
- See `ratingType` in https://cyclonedx.org/docs/1.6/#ratingType
717
+ See `ratingType` in https://cyclonedx.org/docs/1.6/xml/ #ratingType
727
718
728
719
.. warning::
729
720
As part of implementing support for CycloneDX schema version 1.4, the three score types defined in the schema
@@ -741,11 +732,6 @@ def __init__(
741
732
vector : Optional [str ] = None ,
742
733
justification : Optional [str ] = None ,
743
734
) -> None :
744
- if not source and not score and not severity and not method and not vector and not justification :
745
- raise NoPropertiesProvidedException (
746
- 'At least one property must be provided when creating a VulnerabilityRating - none supplied.'
747
- )
748
-
749
735
self .source = source
750
736
self .score = score
751
737
self .severity = severity
@@ -861,18 +847,14 @@ class VulnerabilityCredits:
861
847
extension (in XML only).
862
848
863
849
.. note::
864
- See the CycloneDX schema: https://cyclonedx.org/docs/1.6/#type_vulnerabilityType
850
+ See the CycloneDX schema: https://cyclonedx.org/docs/1.6/xml/ #type_vulnerabilityType
865
851
"""
866
852
867
853
def __init__ (
868
854
self , * ,
869
855
organizations : Optional [Iterable [OrganizationalEntity ]] = None ,
870
856
individuals : Optional [Iterable [OrganizationalContact ]] = None ,
871
857
) -> None :
872
- if not organizations and not individuals :
873
- raise NoPropertiesProvidedException (
874
- 'One of `organizations` or `individuals` must be populated - neither were'
875
- )
876
858
self .organizations = organizations or [] # type:ignore[assignment]
877
859
self .individuals = individuals or [] # type:ignore[assignment]
878
860
0 commit comments