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

Pagination in compound object #126

Open
ericdevries opened this issue Dec 4, 2019 · 0 comments
Open

Pagination in compound object #126

ericdevries opened this issue Dec 4, 2019 · 0 comments

Comments

@ericdevries
Copy link

ericdevries commented Dec 4, 2019

Describe the bug
The types do not allow for pagination in relationship objects. For example, in the below bit of JSON I would like to add a next relationship to the comments, but the type can only be of type Links which includes self and related and none of the PaginationLinks types.

{
  "data": [{
    "type": "articles",
    "id": "1",
    "attributes": {
      "title": "JSON:API paints my bikeshed!"
    },
    "links": {
      "self": "http://example.com/articles/1"
    },
    "relationships": {
      "comments": {
        "links": {
          "self": "http://example.com/articles/1/relationships/comments",
          "related": "http://example.com/articles/1/comments",
          "next": "http://example.com/articles/1/comments?next=5"
        },
        "data": [
          { "type": "comments", "id": "5" }
        ]
      }
    }
  }],
  "included": [{
    "type": "comments",
    "id": "5",
    "attributes": {
      "body": "First!"
    },
    "relationships": {
      "author": {
        "data": { "type": "people", "id": "2" }
      }
    },
    "links": {
      "self": "http://example.com/comments/5"
    }
  }]
}

Expected behavior
I expect it to allow for all the attributes of the PaginationLinks type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant