-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Description
The Link class has a type attribute that can either be one of the media types defined by the MimeTypes enum or None
stac-pydantic/stac_pydantic/links.py
Lines 11 to 19 in 68d20aa
| class Link(StacBaseModel): | |
| """ | |
| https://github.com/radiantearth/stac-spec/blob/v1.0.0/collection-spec/collection-spec.md#link-object | |
| """ | |
| href: str = Field(..., alias="href", min_length=1) | |
| rel: str = Field(..., alias="rel", min_length=1) | |
| type: Optional[MimeTypes] = None | |
| title: Optional[str] = None |
However, the MimeTypes enum is missing several common types such as text/xml.
The STAC spec actually does not restrict media types for links to a specific set. It does mention that for asset links that "registered media types are preferred" but the set of registered media types is much much bigger than the MimeTypes enum.
I would suggest changing the Link.type attribute to be simply Optional[str] to conform with the STAC spec.
vincentsarago and fmigneault
Metadata
Metadata
Assignees
Labels
No labels