Skip to content

Bugfix: Add tests and code for pagination links #20

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

Merged
merged 5 commits into from
Nov 6, 2015
Merged

Conversation

Art4
Copy link
Owner

@Art4 Art4 commented Nov 6, 2015

Pagination links must be inside the links object, so I removed the pagination object and moved the links into the right place. I also added a example file for integration tests.

This PR fixes #19.

Bugfix: pagination links must be inside the links object, so
I removed the pagination object and moved the links into the
right place. I also added a example file for integration tests.
@Art4 Art4 added this to the 0.6 milestone Nov 6, 2015
@fcastilloes
Copy link

👍

There's one thing in the json-api documentation I don't feel totally ok with. It states that pagination likns MUST appear in the link objects that correspond to a collection. The only way to validate that it's a collection is checking if data is an array, but a relationship MUST contain at least one of links, data and meta. So if there can be a relationship with no data, we can't validate that the pagination refers to a collection.

I'm not sure in this case if it wold be worth it check if there is data to validate it as array to allow pagination. What do you think?

@Art4
Copy link
Owner Author

Art4 commented Nov 6, 2015

@fcastillo-es I'm going to merge and close this Bugfix. I opened #21 with your question.

@Art4 Art4 closed this Nov 6, 2015
@Art4 Art4 reopened this Nov 6, 2015
Art4 added a commit that referenced this pull request Nov 6, 2015
Bugfix: Add tests and code for pagination links
@Art4 Art4 merged commit f117679 into master Nov 6, 2015
@Art4 Art4 deleted the Bug_Pagination branch November 6, 2015 10:35
@Art4 Art4 restored the Bug_Pagination branch November 6, 2015 10:35
@Art4 Art4 deleted the Bug_Pagination branch November 6, 2015 12:15
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

Successfully merging this pull request may close these issues.

Wrong implementation of pagination
2 participants