Skip to content

Commit

Permalink
fix: constructor for Vulnerability to correctly define ratings as…
Browse files Browse the repository at this point in the history
… optional

Signed-off-by: William Woodruff <william@trailofbits.com>
  • Loading branch information
woodruffw authored Nov 10, 2021
1 parent 385b835 commit 395a0ec
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cyclonedx/model/vulnerability.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,11 @@ class Vulnerability:
Represents <xs:complexType name="vulnerability">
"""

def __init__(self, id: str, source_name: Optional[str], source_url: Optional[str],
ratings: Optional[List[VulnerabilityRating]], cwes: Optional[List[int]], description: Optional[str],
recommendations: Optional[List[str]], advisories: Optional[List[str]]) -> None:
def __init__(self, id: str, source_name: Optional[str] = None, source_url: Optional[str] = None,
ratings: Optional[List[VulnerabilityRating]] = None,
cwes: Optional[List[int]] = None, description: Optional[str] = None,
recommendations: Optional[List[str]] = None,
advisories: Optional[List[str]] = None) -> None:
self._id = id
self._source_name = source_name
self._source_url: Optional[ParseResult] = urlparse(source_url) if source_url else None
Expand Down

0 comments on commit 395a0ec

Please sign in to comment.