Skip to content

Rethink paging #42

@RubenVerborgh

Description

@RubenVerborgh

As discussed on the mailing list, the current implementation of paging might be confusing. This became apparent when I was implementing this for the Linked Data Fragments server (try the Turtle or JSON-LD representaiton).

Basically, the whole misconception for me comes with the term PagedCollection. If I told you "x is a paged collection", what would you expect? That x is a single page or that x is a collection that is accessible as pages?
Hydra says that a PagedCollection is a page, as is apparent from the current spec:

// EXAMPLE 14: A Hydra PagedCollection splits a collection into multiple pages
{
  "@context": "http://www.w3.org/ns/hydra/context.jsonld",
  "@id": "http://api.example.com/an-issue/comments?page=3",
  "@type": "PagedCollection",
  "totalItems": "4980",
  "itemsPerPage": "10",
  "firstPage": "/an-issue/comments?page=1",
  "nextPage": "/an-issue/comments?page=4",
  "previousPage": "/an-issue/comments?page=2",
  "lastPage": "/an-issue/comments?page=498",
  "member": [

  ]
}

This seems like a misnomer. What can we do to fix? Suggestions in comments.


BTW @lanthaler I would be totally willing to write this into the spec.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions