unioslo / harborapi

Python async client for the Harbor REST API v2.0.
https://unioslo.github.io/harborapi/
MIT License
28 stars 5 forks source link

get_artifact_vulnerability_reports() Raises a Validation Error when report has no vulnerabilites #91

Closed pkalemba closed 3 months ago

pkalemba commented 5 months ago

Steps to reproduce

  1. Have an artifact that has no vulnerabilities but has a report.
  2. run a get_artifact_vulnerability_reports() method
  3. You will get *** pydantic_core._pydantic_core.ValidationError: 1 validation error for HarborVulnerabilityReport severity Input should be 'Unknown', 'Negligible', 'Low', 'Medium', 'High', 'Critical' or 'None' [type=enum, input_value='', input_type=str] For further information visit https://errors.pydantic.dev/2.7/v/enum

IMHO you should get a report object with a None severity and empty vulnerabilities list