Skip to content

Commit ad7a248

Browse files
committed
add serializer to item collection
1 parent eb80c82 commit ad7a248

File tree

1 file changed

+5
-0
lines changed
  • stac_fastapi/elasticsearch/stac_fastapi/elasticsearch

1 file changed

+5
-0
lines changed

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/core.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ async def item_collection(
9191
) -> ItemCollection:
9292
"""Read an item collection from the database."""
9393
request: Request = kwargs["request"]
94+
base_url = str(kwargs["request"].base_url)
9495

9596
items, maybe_count, next_token = await self.database.execute_search(
9697
search=self.database.apply_collections_filter(
@@ -101,6 +102,10 @@ async def item_collection(
101102
sort=None,
102103
)
103104

105+
items = [
106+
self.item_serializer.db_to_stac(item, base_url=base_url) for item in items
107+
]
108+
104109
context_obj = None
105110
if self.extension_is_enabled("ContextExtension"):
106111
context_obj = {

0 commit comments

Comments
 (0)