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

`ScheduleObj.type` can have un-documented value `"Schedule"` #34

Closed pederhan closed 1 year ago

pederhan commented 1 year ago

When calling endpoints that return ScheduleObj models, the value of the type field has been observed to sometimes be "Schedule". This is not a part of the official Harbor API spec:

https://github.com/pederhan/harborapi/blob/1b1a25089b6040dca1057fa1fcd57f02bfc4e8dd/harborapi/models/_models.py#L656-L662

To rectify this, we have had to create a new Type enum with "Schedule" as a valid value:

https://github.com/pederhan/harborapi/blob/1b1a25089b6040dca1057fa1fcd57f02bfc4e8dd/harborapi/models/models.py#L583-L591

This is cumbersome, as we need to override all models that reference the original Schedule, of which there are quite a few:

https://github.com/pederhan/harborapi/blob/1b1a25089b6040dca1057fa1fcd57f02bfc4e8dd/harborapi/models/models.py#L594-L607

There is an active issue on this on the offical Harbor repo: https://github.com/goharbor/harbor/issues/18262

pederhan commented 1 year ago

Fixed upstream