File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
88## [ Unreleased]
99
10+ ### Fixed
11+
12+ - Fixed issue where searches return an empty ` links ` array [ #241 ] ( https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/241 )
1013
1114## [ v2.4.0]
1215
Original file line number Diff line number Diff line change @@ -318,9 +318,7 @@ async def item_collection(
318318 if maybe_count is not None :
319319 context_obj ["matched" ] = maybe_count
320320
321- links = []
322- if next_token :
323- links = await PagingLinks (request = request , next = next_token ).get_links ()
321+ links = await PagingLinks (request = request , next = next_token ).get_links ()
324322
325323 return ItemCollection (
326324 type = "FeatureCollection" ,
@@ -619,9 +617,7 @@ async def post_search(
619617 if maybe_count is not None :
620618 context_obj ["matched" ] = maybe_count
621619
622- links = []
623- if next_token :
624- links = await PagingLinks (request = request , next = next_token ).get_links ()
620+ links = await PagingLinks (request = request , next = next_token ).get_links ()
625621
626622 return ItemCollection (
627623 type = "FeatureCollection" ,
Original file line number Diff line number Diff line change @@ -570,6 +570,15 @@ async def test_get_missing_item_collection(app_client):
570570 assert resp .status_code == 404
571571
572572
573+ @pytest .mark .asyncio
574+ async def test_pagination_base_links (app_client , ctx ):
575+ """Test that a search query always contains basic links"""
576+ page = await app_client .get (f"/collections/{ ctx .item ['collection' ]} /items" )
577+
578+ page_data = page .json ()
579+ assert {"self" , "root" }.issubset ({link ["rel" ] for link in page_data ["links" ]})
580+
581+
573582@pytest .mark .asyncio
574583async def test_pagination_item_collection (app_client , ctx , txn_client ):
575584 """Test item collection pagination links (paging extension)"""
You can’t perform that action at this time.
0 commit comments