stac-utils / pystac

Python library for working with any SpatioTemporal Asset Catalog (STAC)

Home Page:https://pystac.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Root link parsing is not filtering based on media types

turingtestfail opened this issue · comments

commented

I have a STAC Catalog that supports multiple media type implementations of the root link in the Catalog. It appears that the stac_object.get_root_link call is not passing a media type to stac_object.get_single_link, leading to it trying to parse representations other than expected (eg the HTML version instead of json).

I think this issue is similar to what was discussed in #1255

Thanks

This is totally reasonable. I just worry that it might break things for people who might not have media_type defined on their root link. I just double checked the spec for links and type is not a required field.

So to support existing users I think we would want to first look for a link with the matching on rel AND media_type and then if None just match on rel.

Just realized that #1255 (comment) has a very similar suggestion. The difference being that the match is on rel AND (media_type OR no media_type)