Skip to content

Commit 54c85ab

Browse files
remove child links (collections) in landing page response (#798)
* remove child links (collections) in landing page response * fix changelog
1 parent b20da94 commit 54c85ab

File tree

2 files changed

+5
-27
lines changed

2 files changed

+5
-27
lines changed

CHANGES.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
### Changed
6+
7+
- remove `child` links (`collections`) in landing page response
8+
59
## [5.0.3] - 2025-03-03
610

711
### Added
@@ -588,7 +592,7 @@ Full changelog: https://stac-utils.github.io/stac-fastapi/migrations/v3.0.0/#cha
588592
* First PyPi release!
589593

590594
[Unreleased]: <https://github.com/stac-utils/stac-fastapi/compare/5.0.3..main>
591-
[5.0.3]: <https://github.com/stac-utils/stac-fastapi/compare/5.0.1..5.0.3>
595+
[5.0.3]: <https://github.com/stac-utils/stac-fastapi/compare/5.0.2..5.0.3>
592596
[5.0.2]: <https://github.com/stac-utils/stac-fastapi/compare/5.0.1..5.0.2>
593597
[5.0.1]: <https://github.com/stac-utils/stac-fastapi/compare/5.0.0..5.0.1>
594598
[5.0.0]: <https://github.com/stac-utils/stac-fastapi/compare/4.0.1..5.0.0>

stac_fastapi/types/stac_fastapi/types/core.py

-26
Original file line numberDiff line numberDiff line change
@@ -415,19 +415,6 @@ def landing_page(self, **kwargs) -> stac.LandingPage:
415415
]
416416
)
417417

418-
# Add Collections links
419-
collections = self.all_collections(request=kwargs["request"])
420-
421-
for collection in collections["collections"]:
422-
landing_page["links"].append(
423-
{
424-
"rel": Relations.child.value,
425-
"type": MimeTypes.json.value,
426-
"title": collection.get("title") or collection.get("id"),
427-
"href": urljoin(base_url, f"collections/{collection['id']}"),
428-
}
429-
)
430-
431418
# Add OpenAPI URL
432419
landing_page["links"].append(
433420
{
@@ -639,19 +626,6 @@ async def landing_page(self, **kwargs) -> stac.LandingPage:
639626
]
640627
)
641628

642-
# Add Collections links
643-
collections = await self.all_collections(request=kwargs["request"])
644-
645-
for collection in collections["collections"]:
646-
landing_page["links"].append(
647-
{
648-
"rel": Relations.child.value,
649-
"type": MimeTypes.json.value,
650-
"title": collection.get("title") or collection.get("id"),
651-
"href": urljoin(base_url, f"collections/{collection['id']}"),
652-
}
653-
)
654-
655629
# Add OpenAPI URL
656630
landing_page["links"].append(
657631
{

0 commit comments

Comments
 (0)