From dcb7d33289e2a4d32288ad075af23a1d33f164ba Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Thu, 6 Nov 2025 14:50:44 +0800 Subject: [PATCH 1/2] Remove /collections-search from default landing page --- CHANGELOG.md | 2 ++ stac_fastapi/core/stac_fastapi/core/core.py | 34 ++++++++++++--------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 554b1a3c..22ca3a03 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`. + ### 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( { From b8c627769eab6a56f825e6428c954f20a4264f16 Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Thu, 6 Nov 2025 14:52:11 +0800 Subject: [PATCH 2/2] add pr number --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22ca3a03..651db1b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ 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`. +- 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