zalando/restful-api-guidelines

Add guidance on overlong cursors requiring `GET with body`

Closed this issue · 0 comments

tkrop commented

Because a search query and the subsequent cursor can be quite extensive, it may be good to give advice how to handle this cases consistently. The idea is to implement a body based search query containing a cursor as follows:

{
  "cursor": "<encode-search-query-with-resource-pointer-and-direction>"
  "limit": <numer>
  "query-params": ... // ignored, if cursor is provided
}

The response contains the encode [first?, next, prev, and last? cursors] as usual without making use of pagination links.

We should also add cursor, first, next, prev, and last to Use common field names and semantics with a reference to pagination.