diff --git a/CHANGES.md b/CHANGES.md index 36750040d..42f9ec2bb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ * Pin FastAPI to 0.67 to avoid issues with rendering OpenAPI documentation ([#246](https://github.com/stac-utils/stac-fastapi/pull/246)) * Restrict `limit` parameter in sqlalchemy backend to between 1 and 10,000. ([#251](https://github.com/stac-utils/stac-fastapi/pull/251)) * Fix OAS conformance URL ([#263](https://github.com/stac-utils/stac-fastapi/pull/263)) +* Links to children collections from the landing pagge always have a title ([#260](https://github.com/stac-utils/stac-fastapi/pull/260)) ## [2.1.0] @@ -70,4 +71,4 @@ _2020-09-25_ [2.1.0]: [2.0.0]: [1.1.0]: -[1.0.0]: \ No newline at end of file +[1.0.0]: diff --git a/stac_fastapi/sqlalchemy/tests/clients/test_postgres.py b/stac_fastapi/sqlalchemy/tests/clients/test_postgres.py index 1d887fc49..a3c0acf5e 100644 --- a/stac_fastapi/sqlalchemy/tests/clients/test_postgres.py +++ b/stac_fastapi/sqlalchemy/tests/clients/test_postgres.py @@ -269,4 +269,4 @@ class MockStarletteRequestWithApp(MockStarletteRequest): landing_page = postgres_core.landing_page(request=MockStarletteRequestWithApp) for link in landing_page["links"]: if link["href"].split("/")[-1] == coll["id"]: - assert not link["title"] + assert link["title"] diff --git a/stac_fastapi/types/stac_fastapi/types/core.py b/stac_fastapi/types/stac_fastapi/types/core.py index c1c331e9d..2fdb092a8 100644 --- a/stac_fastapi/types/stac_fastapi/types/core.py +++ b/stac_fastapi/types/stac_fastapi/types/core.py @@ -359,7 +359,7 @@ def landing_page(self, **kwargs) -> stac_types.LandingPage: { "rel": Relations.child.value, "type": MimeTypes.json.value, - "title": collection.get("title"), + "title": collection.get("title") or collection.get("id"), "href": urljoin(base_url, f"collections/{collection['id']}"), } )