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.
7
7
8
8
## [ Unreleased]
9
9
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 )
10
13
11
14
## [ v2.4.0]
12
15
Original file line number Diff line number Diff line change @@ -318,9 +318,7 @@ async def item_collection(
318
318
if maybe_count is not None :
319
319
context_obj ["matched" ] = maybe_count
320
320
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 ()
324
322
325
323
return ItemCollection (
326
324
type = "FeatureCollection" ,
@@ -619,9 +617,7 @@ async def post_search(
619
617
if maybe_count is not None :
620
618
context_obj ["matched" ] = maybe_count
621
619
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 ()
625
621
626
622
return ItemCollection (
627
623
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):
570
570
assert resp .status_code == 404
571
571
572
572
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
+
573
582
@pytest .mark .asyncio
574
583
async def test_pagination_item_collection (app_client , ctx , txn_client ):
575
584
"""Test item collection pagination links (paging extension)"""
You can’t perform that action at this time.
0 commit comments