Add a top-level links object in the response object for pagination.
The example below follows the links top-level object structure.
{
"links": {
"self": "http://example.com/_/items/projects",
"first": "http://example.com/_/items/projects?page=1",
"last": "http://example.com/_/items/projects?page=10",
"prev": null,
"next": "http://example.com/_/items/projects?page=2"
},
"data": {
}
}
Information about this are explained in the jsonapi specification:
Why?
Also, since when do we have a page query param?
Why?
These are helper information that make it easier for consumer to fetch the next/prev/first/last items from the pagination list.
Also, since when do we have a page query param?
We don't, I added the example as a reference. I updated the text to avoid confusion
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Does it make more sense to have this inside meta?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I can work on this using the offset and limit parameters already in place.
In addition, I can also add the total_filter if the filters argument is passed.
Open to suggestions on implementation.
Thanks @philleepflorence — this would be awesome. 😄
To achieve better clarity/visibility, we are now tracking feature requests within the Feature Request project board.
This issue being closed does not mean it's not being considered.
I've added this one to in progress @philleepflorence ... cool?
Yes, once I have the go ahead on the structure of the meta object, I can finalize.
Working on that now in the POR comments!
Most helpful comment
I can work on this using the
offsetandlimitparameters already in place.In addition, I can also add the
total_filterif thefiltersargument is passed.Open to suggestions on implementation.