Skip to content

Valid media types for links is too restrictive #181

Open
@mishaschwartz

Description

@mishaschwartz

The Link class has a type attribute that can either be one of the media types defined by the MimeTypes enum or None

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions