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
24 stars 14 forks source link

Issue with Creating Collections #256

Open pedro-cf opened 1 month ago

pedro-cf commented 1 month ago

Describe the bug Greetings since the stac-fastapi.api update to 3.0.0a it seems that when creating collections two additional restrictions were added:

  1. Must specify a license: "test" key/value
  2. Must specify a "links": [] key/value (empty at least)

To Reproduce Steps to reproduce the behavior:

  1. Create a collection without specifying license or links

Expected behavior Be able to create a collection without specifying these 2 fields.

Additional Context Not sure if this is a stac-fastapi.core or stac-fastapi.api issue...

jonhealy1 commented 1 month ago

According to this document, both of those fields are required: https://github.com/radiantearth/stac-spec/blob/master/collection-spec/collection-spec.md#collection-fields. In stac-fastapi.types.stac it looks like these fields are not optional but I think the error is coming from stac-pydantic.

pedro-cf commented 1 month ago

According to this document, both of those fields are required: https://github.com/radiantearth/stac-spec/blob/master/collection-spec/collection-spec.md#collection-fields. In stac-fastapi.types.stac it looks like these fields are not optional but I think the error is coming from stac-pydantic.

I can understand the license field being a new stac spec rule, but the links field seems weird to me, since the new strategy with stac-fastapi.api is to not store links in the database and have the api return the links dynamically.

https://github.com/stac-utils/stac-fastapi/blob/096c93032335d43fd45433297e804f8582c803a5/stac_fastapi/types/stac_fastapi/types/links.py#L10-L14

image

jonhealy1 commented 1 month ago

I do agree with you. There's a similar issue where someone wants to ingest items without the collection_id field because the stac api should be able to assign this field based on what collection the items are being added to. Even license? If someone doesn't care if their data doesn't have license?

jonhealy1 commented 1 month ago

Links are dynamically assigned already so allowing links to not exist seems like a no-brainer