Skip to content

Pagination links are missing from STAC API responses #274

@bmcandr

Description

@bmcandr

Describe the bug
Pagination links are missing from STAC API responses from the /items and /search endpoints. This prevents clients from paging over results which has effects such as:

  • Limiting Items returned by /items and /search endpoints to the first page of results. While the limit param can be passed to increase the number of Items returned per page, there is still a hard cap enforced (e.g., 1000 Items for /search endpoint).
  • STAC Browser only displays first page of Items returned and it is not possible to advance to the next page (no links -> no next/prev buttons).

To reproduce
Steps to reproduce the behavior:

/items endpoints

  1. Navigate to https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-2-l2a/items
  2. Check links list

/search endpoint

# search sentinel-2-l2a collection for all Items with s2:mgrs_tile == '18STH' (there are thousands). 
# limit response to 1 Item/page so "next" link is expected.

curl -X GET "https://planetarycomputer.microsoft.com/api/stac/v1/search?collections=sentinel-2-l2a&query=%7B%22s2%3Amgrs_tile%22%3A%7B%22eq%22%3A%2218STH%22%7D%7D&limit=1" | jq '.links'

Response:

    [
        {
            "rel":"root",
            "type":"application/json",
            "href":"https://planetarycomputer.microsoft.com/api/stac/v1/"
        },
        {
            "rel":"self",
            "type":"application/json",
            "href":"https://planetarycomputer.microsoft.com/api/stac/v1/search?collections=sentinel-2-l2a&query=%7B%22s2%3Amgrs_tile%22%3A%7B%22eq%22%3A%2218STH%22%7D%7D&limit=1"
        }
    ]

Expected behavior
Pagination links should be present in responses.

Screenshots and shell session dumps

Missing pagination links

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions