diff --git a/CHANGELOG.md b/CHANGELOG.md index 554b1a3c..651db1b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Removed +- Removed `/collections-search` endpoint from default landing page. It now only shows when `ENABLE_COLLECTIONS_SEARCH_ROUTE` is set to `True`. [#524](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/524) + ### Updated ## [v6.7.2] - 2025-11-04 diff --git a/stac_fastapi/core/stac_fastapi/core/core.py b/stac_fastapi/core/stac_fastapi/core/core.py index 42106761..56d2333f 100644 --- a/stac_fastapi/core/stac_fastapi/core/core.py +++ b/stac_fastapi/core/stac_fastapi/core/core.py @@ -137,20 +137,6 @@ def _landing_page( "href": urljoin(base_url, "search"), "method": "POST", }, - { - "rel": "collections-search", - "type": "application/json", - "title": "Collections Search", - "href": urljoin(base_url, "collections-search"), - "method": "GET", - }, - { - "rel": "collections-search", - "type": "application/json", - "title": "Collections Search", - "href": urljoin(base_url, "collections-search"), - "method": "POST", - }, ], stac_extensions=extension_schemas, ) @@ -202,6 +188,26 @@ async def landing_page(self, **kwargs) -> stac_types.LandingPage: ] ) + if self.extension_is_enabled("CollectionsSearchEndpointExtension"): + landing_page["links"].extend( + [ + { + "rel": "collections-search", + "type": "application/json", + "title": "Collections Search", + "href": urljoin(base_url, "collections-search"), + "method": "GET", + }, + { + "rel": "collections-search", + "type": "application/json", + "title": "Collections Search", + "href": urljoin(base_url, "collections-search"), + "method": "POST", + }, + ] + ) + # Add OpenAPI URL landing_page["links"].append( {