Skip to content

Commit

Permalink
fix: use id instead of title in item id metadata (#1193)
Browse files Browse the repository at this point in the history
  • Loading branch information
alambare authored Jun 11, 2024
1 parent ea12faa commit 5f1b707
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion eodag/resources/stac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ items:
item:
stac_version: "{stac_version}"
stac_extensions:
id: '$.product.properties.title'
id: '$.product.properties.id'
bbox:
- '{item[geometry].bounds[0]}'
- '{item[geometry].bounds[1]}'
Expand Down
2 changes: 1 addition & 1 deletion eodag/rest/stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def __get_item_list(

# parse download link
downloadlink_href = (
f"{catalog['url']}/items/{product.properties['title']}/download"
f"{catalog['url']}/items/{product.properties['id']}/download"
)
_dc_qs = product.properties.get("_dc_qs", None)
url_parts = urlparse(downloadlink_href)
Expand Down
4 changes: 1 addition & 3 deletions tests/units/test_stac_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,7 @@ def test_search_stac_items_with_stac_providers(self, mock__request):
"downloadLink", "thumbnail" in response["features"][0]["assets"].keys()
)
# check that assets from the provider response search are reformatted in the response
product_id = self.earth_search_resp_search_json["features"][0]["properties"][
"s2:product_uri"
].replace(".SAFE", "")
product_id = self.earth_search_resp_search_json["features"][0]["id"]
for k in self.earth_search_resp_search_json["features"][0]["assets"]:
self.assertIn(k, response["features"][0]["assets"].keys())
if k == "thumbnail":
Expand Down

0 comments on commit 5f1b707

Please sign in to comment.