-
Couldn't load subscription status.
- Fork 42
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
When creating the /search - GET|POST response we don't infer links, while we do it for `/items
stac-fastapi-pgstac/stac_fastapi/pgstac/core.py
Lines 523 to 532 in 4a34c90
| item_collection = await self._search_base(search_request, request=request) | |
| # If we have the `fields` extension enabled | |
| # we need to avoid Pydantic validation because the | |
| # Items might not be a valid STAC Item objects | |
| if fields := getattr(search_request, "fields", None): | |
| if fields.include or fields.exclude: | |
| return JSONResponse(item_collection) # type: ignore | |
| return ItemCollection(**item_collection) |
stac-fastapi-pgstac/stac_fastapi/pgstac/core.py
Lines 405 to 408 in 4a34c90
| links = await ItemCollectionLinks( | |
| collection_id=collection_id, request=request | |
| ).get_links(extra_links=item_collection["links"]) | |
| item_collection["links"] = links |
It will result in a self link with type="application/json", defined in
stac-fastapi-pgstac/stac_fastapi/pgstac/models/links.py
Lines 64 to 70 in 4a34c90
| def link_self(self) -> Dict: | |
| """Return the self link.""" | |
| return { | |
| "rel": Relations.self.value, | |
| "type": MimeTypes.json.value, | |
| "href": self.url, | |
| } |
curl http://127.0.0.1:8000/search | jq '.links[]'
...
{
"rel": "self",
"type": "application/json",
"href": "http://127.0.0.1:8000/search"
}
vprivat-ads
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working