-
Notifications
You must be signed in to change notification settings - Fork 42
Description
right now stac-fastapi-pgstac uses previous, while pgstac use prev
https://github.com/stac-utils/pgstac/blob/8a37c997f31439d203ee586fa8fdeb60d10b2f4b/src/pgstac/sql/004a_collectionsearch.sql#L121
https://github.com/stac-utils/pgstac/blob/8a37c997f31439d203ee586fa8fdeb60d10b2f4b/src/pgstac/sql/004_search.sql#L1029
stac-fastapi-pgstac/stac_fastapi/pgstac/models/links.py
Lines 152 to 173 in 4321497
| def link_prev(self) -> Optional[Dict[str, Any]]: | |
| """Create link for previous page.""" | |
| if self.prev is not None: | |
| method = self.request.method | |
| if method == "GET": | |
| href = merge_params(self.url, {"token": f"prev:{self.prev}"}) | |
| return { | |
| "rel": Relations.previous.value, | |
| "type": MimeTypes.geojson.value, | |
| "method": method, | |
| "href": href, | |
| } | |
| if method == "POST": | |
| return { | |
| "rel": Relations.previous, | |
| "type": MimeTypes.geojson, | |
| "method": method, | |
| "href": f"{self.request.url}", | |
| "body": {**self.request.postbody, "token": f"prev:{self.prev}"}, | |
| } | |
| return None |
In the stac specs it's not specified which one to use but I feel we should at least use the same one as pgstac
from https://www.iana.org/assignments/link-relations/link-relations.xml
prev Indicates that the link's context is a part of a series, and that the previous in the series is the link target. [HTML]
previous Refers to the previous resource in an ordered series of resources. Synonym for "prev". [HTML 4.01 Specification]