Skip to content

Commit 3d4b4d9

Browse files
authored
Remove /collections-search from default landing page (#524)
**Related Issue(s):** - #523 **Description:** - Removed `/collections-search` endpoint from default landing page. It now only shows when `ENABLE_COLLECTIONS_SEARCH_ROUTE` is set to `True`. **PR Checklist:** - [x] Code is formatted and linted (run `pre-commit run --all-files`) - [x] Tests pass (run `make test`) - [x] Documentation has been updated to reflect changes, if applicable - [x] Changes are added to the changelog
1 parent 504bc6a commit 3d4b4d9

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1717

1818
### Removed
1919

20+
- 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)
21+
2022
### Updated
2123

2224
## [v6.7.2] - 2025-11-04

stac_fastapi/core/stac_fastapi/core/core.py

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -137,20 +137,6 @@ def _landing_page(
137137
"href": urljoin(base_url, "search"),
138138
"method": "POST",
139139
},
140-
{
141-
"rel": "collections-search",
142-
"type": "application/json",
143-
"title": "Collections Search",
144-
"href": urljoin(base_url, "collections-search"),
145-
"method": "GET",
146-
},
147-
{
148-
"rel": "collections-search",
149-
"type": "application/json",
150-
"title": "Collections Search",
151-
"href": urljoin(base_url, "collections-search"),
152-
"method": "POST",
153-
},
154140
],
155141
stac_extensions=extension_schemas,
156142
)
@@ -202,6 +188,26 @@ async def landing_page(self, **kwargs) -> stac_types.LandingPage:
202188
]
203189
)
204190

191+
if self.extension_is_enabled("CollectionsSearchEndpointExtension"):
192+
landing_page["links"].extend(
193+
[
194+
{
195+
"rel": "collections-search",
196+
"type": "application/json",
197+
"title": "Collections Search",
198+
"href": urljoin(base_url, "collections-search"),
199+
"method": "GET",
200+
},
201+
{
202+
"rel": "collections-search",
203+
"type": "application/json",
204+
"title": "Collections Search",
205+
"href": urljoin(base_url, "collections-search"),
206+
"method": "POST",
207+
},
208+
]
209+
)
210+
205211
# Add OpenAPI URL
206212
landing_page["links"].append(
207213
{

0 commit comments

Comments
 (0)