Skip to content

Commit

Permalink
remove child links (collections) in landing page response (#798)
Browse files Browse the repository at this point in the history
* remove child links (collections) in landing page response

* fix changelog
  • Loading branch information
vincentsarago authored Mar 3, 2025
1 parent b20da94 commit 54c85ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 27 deletions.
6 changes: 5 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Changed

- remove `child` links (`collections`) in landing page response

## [5.0.3] - 2025-03-03

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

[Unreleased]: <https://github.com/stac-utils/stac-fastapi/compare/5.0.3..main>
[5.0.3]: <https://github.com/stac-utils/stac-fastapi/compare/5.0.1..5.0.3>
[5.0.3]: <https://github.com/stac-utils/stac-fastapi/compare/5.0.2..5.0.3>
[5.0.2]: <https://github.com/stac-utils/stac-fastapi/compare/5.0.1..5.0.2>
[5.0.1]: <https://github.com/stac-utils/stac-fastapi/compare/5.0.0..5.0.1>
[5.0.0]: <https://github.com/stac-utils/stac-fastapi/compare/4.0.1..5.0.0>
Expand Down
26 changes: 0 additions & 26 deletions stac_fastapi/types/stac_fastapi/types/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand Down Expand Up @@ -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(
{
Expand Down

0 comments on commit 54c85ab

Please sign in to comment.