Client-initiated pagination

From Hydra Community Group

During the discussions around collections and pagination it became clear that people want a mechanism to tell clients how to control pagination and how jump directly to specific pages/views. This page collects requirements.

Pagination with offset and limit

Desired functionality:

  • allow a client to jump directly to a specific PartialCollectionView
  • allow a client to specify the maximum number of items to return
  • allow a server to specify how many items there are on the current page
  • allow a client to calculate the number of pages

Necessary concepts:

  • offset (index of the first item to return)
  • limit (maximum number of items to return)
  • number of items per page (former hydra:itemsPerPage)
  • property to attach a IRI template to a collection to jump directly to a PartialCollectionView

Pagination by member properties

Desired functionality:

  • allow a client to discover a non-page-unit pagination mechanism (i.e. partitioning posts by dates or products by categories)

Necessary concepts:

  • property denoting date parts, i.e. day, month, year, named individual

Allow sorting

Desired functionality:

  • allow a client to define a member sorting rule(s) usually accompanying pagination

Additional concepts:

  • pointer to properties to sort by
  • sorting direction (either ascending or descending)

Specialized views

Extending the pagination concept implemented by views, additional scenarios of custom views may be acknowledged. These may be subjects to separate issues, but may proof useful during consideration for further development.