Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong implementation of pagination #19

Closed
Art4 opened this issue Nov 5, 2015 · 0 comments · Fixed by #20
Closed

Wrong implementation of pagination #19

Art4 opened this issue Nov 5, 2015 · 0 comments · Fixed by #20
Labels
Milestone

Comments

@Art4
Copy link
Owner

Art4 commented Nov 5, 2015

It seems that I have misinterprete the spec about the pagination. The pagination links have to be in the links object, and not in their own object. See this pagination example:

GET /articles?page[number]=3&page[size]=1

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "meta": {
    "total-pages": 13
  },
  "data": [
    {
      "type": "articles",
      "id": "3",
      "attributes": {
        "title": "JSON API paints my bikeshed!",
        "body": "The shortest article. Ever.",
        "created": "2015-05-22T14:56:29.000Z",
        "updated": "2015-05-22T14:56:28.000Z"
      }
    }
  ],
  "links": {
    "self": "http://example.com/articles?page[number]=3&page[size]=1",
    "first": "http://example.com/articles?page[number]=1&page[size]=1",
    "prev": "http://example.com/articles?page[number]=2&page[size]=1",
    "next": "http://example.com/articles?page[number]=4&page[size]=1",
    "last": "http://example.com/articles?page[number]=13&page[size]=1"
  }
}
@Art4 Art4 added the bug label Nov 5, 2015
@Art4 Art4 added this to the 0.6 milestone Nov 5, 2015
@Art4 Art4 closed this as completed in #20 Nov 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant