You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is currently possible to pass dicts to methods that create or update resources. This is not explained anywhere, and is basically an implementation detail.
Being able to pass in dicts to these methods is beneficial if the API spec changes in a backwards-incompatible way in the future, as users will be able to pass in custom dicts conforming to the new spec until an official harborapi update is available, after which they can resume using the models.
Implementation
In order to document this (currently implicit) behavior, we should add a new type called MaybeModel[T] that is an alias for Union[T, dict[str, Any]], where T is bound to BaseModel, and replace current types on POST/PUT/PATCH methods with this type.
Rationale
It is currently possible to pass dicts to methods that create or update resources. This is not explained anywhere, and is basically an implementation detail.
Being able to pass in dicts to these methods is beneficial if the API spec changes in a backwards-incompatible way in the future, as users will be able to pass in custom dicts conforming to the new spec until an official
harborapi
update is available, after which they can resume using the models.Implementation
In order to document this (currently implicit) behavior, we should add a new type called
MaybeModel[T]
that is an alias forUnion[T, dict[str, Any]]
, whereT
is bound toBaseModel
, and replace current types on POST/PUT/PATCH methods with this type.The text was updated successfully, but these errors were encountered: