![](/style/images/good.png)
![](/style/images/bad.png)
model/vulnerability: fix optional type by woodruffw · Pull Request #61 · Cyclone...
source link: https://github.com/CycloneDX/cyclonedx-python-lib/pull/61
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
This fixes a small bug when constructing a Vulnerability
model that eventually gets serialized to XML: get_ratings
expects self._ratings
to be a List[VulnerabilityRating]
instead of an Optional[...]
, so we default-initialize it if the constructor is passed None
.
There are other type errors in the same constructor; I'll update this PR as I continue to try to get XML serialization working in pip-audit
.
Downstream: trailofbits/pip-audit#109
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK