From d3fd61ddd13bb527c8fcb949dc098003c4ecfdae Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Thu, 6 Feb 2025 14:12:22 +0100 Subject: [PATCH 1/2] remove child links (collections) in landing page response --- CHANGES.md | 5 ++++ stac_fastapi/types/stac_fastapi/types/core.py | 26 ------------------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 8d7a3f2dc..8f5aa3689 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,11 @@ ## [Unreleased] + +### Changed + +- remove `child` links (`collections`) in landing page response + ## [5.0.2] - 2025-01-30 ### Fixed diff --git a/stac_fastapi/types/stac_fastapi/types/core.py b/stac_fastapi/types/stac_fastapi/types/core.py index e4ad4d252..4796f5849 100644 --- a/stac_fastapi/types/stac_fastapi/types/core.py +++ b/stac_fastapi/types/stac_fastapi/types/core.py @@ -415,19 +415,6 @@ def landing_page(self, **kwargs) -> stac.LandingPage: ] ) - # Add Collections links - collections = self.all_collections(request=kwargs["request"]) - - for collection in collections["collections"]: - landing_page["links"].append( - { - "rel": Relations.child.value, - "type": MimeTypes.json.value, - "title": collection.get("title") or collection.get("id"), - "href": urljoin(base_url, f"collections/{collection['id']}"), - } - ) - # Add OpenAPI URL landing_page["links"].append( { @@ -639,19 +626,6 @@ async def landing_page(self, **kwargs) -> stac.LandingPage: ] ) - # Add Collections links - collections = await self.all_collections(request=kwargs["request"]) - - for collection in collections["collections"]: - landing_page["links"].append( - { - "rel": Relations.child.value, - "type": MimeTypes.json.value, - "title": collection.get("title") or collection.get("id"), - "href": urljoin(base_url, f"collections/{collection['id']}"), - } - ) - # Add OpenAPI URL landing_page["links"].append( { From 8e657eca2ec8ba66f4340ec5275529ab4dba8de7 Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Thu, 6 Feb 2025 14:15:10 +0100 Subject: [PATCH 2/2] fix changelog --- CHANGES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 8f5aa3689..7c06d84c8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -580,7 +580,8 @@ Full changelog: https://stac-utils.github.io/stac-fastapi/migrations/v3.0.0/#cha * First PyPi release! -[Unreleased]: +[Unreleased]: +[5.0.2]: [5.0.1]: [5.0.0]: [4.0.1]: