diff --git a/CHANGES.md b/CHANGES.md index 732d59178..ba0307bfb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Added + +- titles in `Landing` page links + ### Changed - remove `child` links (`collections`) in landing page response diff --git a/stac_fastapi/api/tests/test_app.py b/stac_fastapi/api/tests/test_app.py index 417d12f41..7c77a9ab9 100644 --- a/stac_fastapi/api/tests/test_app.py +++ b/stac_fastapi/api/tests/test_app.py @@ -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 @@ -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 diff --git a/stac_fastapi/api/tests/test_app_prefix.py b/stac_fastapi/api/tests/test_app_prefix.py index 196e46135..ea20c6c29 100644 --- a/stac_fastapi/api/tests/test_app_prefix.py +++ b/stac_fastapi/api/tests/test_app_prefix.py @@ -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"), @@ -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"), @@ -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"), diff --git a/stac_fastapi/types/stac_fastapi/types/core.py b/stac_fastapi/types/stac_fastapi/types/core.py index 4796f5849..99ef87f9c 100644 --- a/stac_fastapi/types/stac_fastapi/types/core.py +++ b/stac_fastapi/types/stac_fastapi/types/core.py @@ -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"), }, { @@ -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", }, @@ -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"), } ) @@ -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", }