@@ -427,7 +427,7 @@ def validate(self,
427427
428428 # License concluded is mandatory in SPDX 2.2, but not in SPDX 2.3
429429 # It is mandatory in OpenChain Telco SBOM Guide
430- if not package . license_concluded :
430+ if not hasattr ( package , ' license_concluded' ) :
431431 problems .append ("Missing mandatory field from Package" ,
432432 package .spdx_id ,
433433 package .name ,
@@ -445,7 +445,7 @@ def validate(self,
445445
446446 # License declared is mandatory in SPDX 2.2, but not in SPDX 2.3
447447 # It is mandatory in OpenChain Telco SBOM Guide
448- if not package . license_declared :
448+ if not hasattr ( package , ' license_declared' ) :
449449 problems .append ("Missing mandatory field from Package" ,
450450 package .spdx_id ,
451451 package .name ,
@@ -464,7 +464,7 @@ def validate(self,
464464
465465 # Package copyright text is mandatory in SPDX 2.2, but not in SPDX 2.3
466466 # It is mandatory in OpenChain Telco SBOM Guide
467- if not package . copyright_text :
467+ if not hasattr ( package , ' copyright_text' ) :
468468 problems .append ("Missing mandatory field from Package" ,
469469 package .spdx_id ,
470470 package .name ,
@@ -490,17 +490,7 @@ def validate(self,
490490 Problem .SEVERITY_WARNING ,
491491 file )
492492
493- if not package .version :
494- pass
495- ### This is already detected during the NTIA check.
496- #problems.append("Missing mandatory field from Package", package.spdx_id, package.name, "Version field is missing")
497-
498- if not package .supplier :
499- pass
500- ### This is already detected during the NTIA check.
501- #problems.append("Missing mandatory field from Package", package.spdx_id, package.name, "Supplier field is missing")
502-
503- if package .external_references :
493+ if hasattr (package , 'external_references' ):
504494 purlFound = False
505495 for ref in package .external_references :
506496 logger .debug (f"cat: { str (ref .category )} , type: { ref .reference_type } , locator: { ref .locator } " )
0 commit comments