Skip to content

Commit

Permalink
Merge pull request #37 from pieter-pon/feature/pagination-start-zero
Browse files Browse the repository at this point in the history
docs(update-pagination): Pagination addition about the first position, should be zero
  • Loading branch information
zeger-pon authored Apr 19, 2023
2 parents fdd2063 + b4b7638 commit c0e7ca4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions chapters/integration/generic/pagination.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ this may comprise the support for {prev}, {first}, {last}, and {self} as
{link-relations}[link relations] (see also <<link-relation-fields>> for
details).

The first position at the api pagination should be 0, and every next position should be increased by 1.
Starting with zero makes the math simple.
API is designed to consumed by another system, and all code starts lists with zero.
https://en.wikipedia.org/wiki/Zero-based_numbering

If the next position doesn't have results, it shoudn't return a link.

The page content is transported via {items}, while the {query} object may
contain the query filters applied to the collection resource as follows:

Expand Down

0 comments on commit c0e7ca4

Please sign in to comment.