You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using POST /collections to add a new Collection, the self and root links in the response are the original links from the submitted Collection instead of the links for the newly created Collection in the API.
Observed Response
As an example, add the following self link to the example joplin Collection:
This can be easily fixed by adding the CollectionLinks logic to the AsyncBaseTransactionsClient.create_collection handler (and the equivalent handlers for the other endpoints):
Just a note that this would be really helpful in implementing a solution for stac-utils/pystac-client#241 because we could create a CollectionClient directly from the POST or PUT response rather than having to fetch the Collection again in order to get the correct links.
I can work on a PR for this in the pgstac backend.
The text was updated successfully, but these errors were encountered:
When using
POST /collections
to add a new Collection, theself
androot
links in the response are the original links from the submitted Collection instead of the links for the newly created Collection in the API.Observed Response
As an example, add the following self link to the example
joplin
Collection:The
POST /collections
response includes that sameself
link unchanged:The same issue exists with
PUT /collections
,POST /collections/{collection_id}/items
, andPUT /collections/{collection_id}/items
.Expected Response
I expected this to instead return the new
self
link:Possible Solution
This can be easily fixed by adding the
CollectionLinks
logic to theAsyncBaseTransactionsClient.create_collection
handler (and the equivalent handlers for the other endpoints):Just a note that this would be really helpful in implementing a solution for stac-utils/pystac-client#241 because we could create a
CollectionClient
directly from thePOST
orPUT
response rather than having to fetch the Collection again in order to get the correct links.I can work on a PR for this in the
pgstac
backend.The text was updated successfully, but these errors were encountered: