stac-utils / stac-fastapi-elasticsearch-opensearch

Elasticsearch backend for stac-fastapi with Opensearch support.
https://stac-utils.github.io/stac-fastapi-elasticsearch-opensearch
MIT License
31 stars 15 forks source link

CollectionSerializer is duplicating "Items" link #143

Closed ahuarte47 closed 7 months ago

ahuarte47 commented 1 year ago

Describe the bug db_to_stac method to transform database model to STAC collection is adding a set of links by default. "Items" link is not included in the list of inferred. So the later invoking to resolve_links adds it again because "items" passes this filter.

To Reproduce Steps to reproduce the behavior:

  1. Uploads a Collection to ES
  2. Reads it using CollectionSerializer:db_to_stac()

Expected behavior "Items" link should be unique. INFERRED_LINK_RELS should include "Items" or taking care of this issue in Serializer.

jonhealy1 commented 1 year ago

Hi @ahuarte47 do you have a fix for this?

ahuarte47 commented 1 year ago

Hi @jonhealy1 I did create any PR to fix this, I only changed my own copy of stac-fastapi including "items" in the list INFERRED_LINK_RELS, it works here. It does not seem a bug from stac-fastapi-elasticsearch, but it in combination with stac-fastapi.

StijnCaerts commented 8 months ago

I created a PR in the upstream repository: https://github.com/stac-utils/stac-fastapi/pull/640

jonhealy1 commented 8 months ago

Nice ok. Thank you.

StijnCaerts commented 8 months ago

211 also fixes this, as the generated links are no longer stored in the database.