harborapi icon indicating copy to clipboard operation
harborapi copied to clipboard

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

Open pkalemba opened this issue 8 months ago • 0 comments

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

pkalemba avatar Jun 24 '24 09:06 pkalemba