diff --git a/CHANGES.md b/CHANGES.md index 0b5d3f192..12c776368 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ ### Added * Add benchmark in CI ([#650](https://github.com/stac-utils/stac-fastapi/pull/650)) +* Add `/queryables` link to the landing page ([#587](https://github.com/stac-utils/stac-fastapi/pull/587)) ### Changed diff --git a/stac_fastapi/types/stac_fastapi/types/core.py b/stac_fastapi/types/stac_fastapi/types/core.py index 79b18f57b..a704ae49b 100644 --- a/stac_fastapi/types/stac_fastapi/types/core.py +++ b/stac_fastapi/types/stac_fastapi/types/core.py @@ -369,6 +369,18 @@ def landing_page(self, **kwargs) -> stac_types.LandingPage: extension_schemas=[], ) + # Add Queryables link + if self.extension_is_enabled("FilterExtension"): + landing_page["links"].append( + { + "rel": Relations.queryables.value, + "type": MimeTypes.jsonschema, + "title": "Queryables", + "href": urljoin(base_url, "queryables"), + "method": "GET", + } + ) + # Add Collections links collections = self.all_collections(request=kwargs["request"]) for collection in collections["collections"]: @@ -566,6 +578,20 @@ async def landing_page(self, **kwargs) -> stac_types.LandingPage: conformance_classes=self.conformance_classes(), extension_schemas=[], ) + + # Add Queryables link + if self.extension_is_enabled("FilterExtension"): + landing_page["links"].append( + { + "rel": Relations.queryables.value, + "type": MimeTypes.jsonschema, + "title": "Queryables", + "href": urljoin(base_url, "queryables"), + "method": "GET", + } + ) + + # Add Collections links collections = await self.all_collections(request=kwargs["request"]) for collection in collections["collections"]: landing_page["links"].append(