Open keul opened 1 year ago
Ah! Digging into the code I found that transaction.create_item can also try to load the collection id from the item itself.
If I provide it in my item JSON, it works.
I'm not sure if this is the intended way to use this API. Right now I cannot pass the same item definition to the bulk upload and single upload endpoint (or at least, in the simple item upload I can skip this parameter, which seems optional).
I still think that the collection_id should be taken from the path parameter instead, but I can live this it! 😄
Using the vanilla docker-compose provided by the project, and trying to use the /collections/{collection_id}/bulk_items endpoint on the stac_fastapi.sqlalchemy service.
For what I see from the swagger documentation, the POST payload must be something like:
…and inspecting the code I guess
items
should a a structure of"item-id": { definition of item }
But I get an error:
I suspect the JSON format is not the proper ones (but I'm using test data from the same project).
In facts, it try to find the "collection" id from the stac_data, but to be honest I think it should load it from the request path parameter.