Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Added

- titles in `Landing` page links

### Changed

- remove `child` links (`collections`) in landing page response
Expand Down
8 changes: 6 additions & 2 deletions stac_fastapi/api/tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ def get_search(
)

assert landing.status_code == 200, landing.text
assert "Queryables" in [link.get("title") for link in landing.json()["links"]]
assert "Queryables available for this Catalog" in [
link.get("title") for link in landing.json()["links"]
]
assert get_search.status_code == 200, get_search.text
assert post_search.status_code == 200, post_search.text

Expand Down Expand Up @@ -221,7 +223,9 @@ def get_search(
)

assert landing.status_code == 200, landing.text
assert "Queryables" in [link.get("title") for link in landing.json()["links"]]
assert "Queryables available for this Catalog" in [
link.get("title") for link in landing.json()["links"]
]
assert get_search.status_code == 200, get_search.text
assert post_search.status_code == 200, post_search.text

Expand Down
3 changes: 3 additions & 0 deletions stac_fastapi/api/tests/test_app_prefix.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def test_api_prefix(TestCoreClient, prefix):

link_tests = [
("root", "application/json", "/"),
("self", "application/json", "/"),
("conformance", "application/json", "/conformance"),
("data", "application/json", "/collections"),
("search", "application/geo+json", "/search"),
Expand Down Expand Up @@ -126,6 +127,7 @@ def test_async_api_prefix(AsyncTestCoreClient, prefix):

link_tests = [
("root", "application/json", "/"),
("self", "application/json", "/"),
("conformance", "application/json", "/conformance"),
("data", "application/json", "/collections"),
("search", "application/geo+json", "/search"),
Expand Down Expand Up @@ -190,6 +192,7 @@ def test_api_prefix_with_root_path(TestCoreClient, prefix):

link_tests = [
("root", "application/json", "/"),
("self", "application/json", "/"),
("conformance", "application/json", "/conformance"),
("data", "application/json", "/collections"),
("search", "application/geo+json", "/search"),
Expand Down
11 changes: 7 additions & 4 deletions stac_fastapi/types/stac_fastapi/types/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,16 +289,19 @@ def _landing_page(
{
"rel": Relations.self.value,
"type": MimeTypes.json.value,
"title": "This document",
"href": base_url,
},
{
"rel": Relations.root.value,
"type": MimeTypes.json.value,
"title": "Root",
"href": base_url,
},
{
"rel": Relations.data.value,
"type": MimeTypes.json.value,
"title": "Collections available for this Catalog",
"href": urljoin(base_url, "collections"),
},
{
Expand All @@ -310,14 +313,14 @@ def _landing_page(
{
"rel": Relations.search.value,
"type": MimeTypes.geojson.value,
"title": "STAC search",
"title": "STAC search [GET]",
"href": urljoin(base_url, "search"),
"method": "GET",
},
{
"rel": Relations.search.value,
"type": MimeTypes.geojson.value,
"title": "STAC search",
"title": "STAC search [POST]",
"href": urljoin(base_url, "search"),
"method": "POST",
},
Expand Down Expand Up @@ -391,7 +394,7 @@ def landing_page(self, **kwargs) -> stac.LandingPage:
{
"rel": Relations.queryables.value,
"type": MimeTypes.jsonschema.value,
"title": "Queryables",
"title": "Queryables available for this Catalog",
"href": urljoin(base_url, "queryables"),
}
)
Expand Down Expand Up @@ -601,7 +604,7 @@ async def landing_page(self, **kwargs) -> stac.LandingPage:
{
"rel": Relations.queryables.value,
"type": MimeTypes.jsonschema.value,
"title": "Queryables",
"title": "Queryables available for this Catalog",
"href": urljoin(base_url, "queryables"),
"method": "GET",
}
Expand Down
Loading