Add Pagination metadata to JSONAPISerializer
See original GitHub issueIs it possible to support returning metadata with a route’s response? (Would be good for something like pagination).
Ie a JSON API response like:
{
data: [
{ type: 'item', id: 1 },
{ type: 'item', id: 2 },
{ type: 'item', id: 3 },
{ type: 'item', id: 4 },
{ type: 'item', id: 5 }
],
meta: {
total: 200
}
}
Where this is eventually available in the controller like so:
this.get('model.meta');
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Add Pagination metadata to JSONAPISerializer #442 - GitHub
Is it possible to support returning metadata with a route's response? (Would be good for something like pagination).
Read more >Pagination in Ember with a JSON API Backend
Every Ember Data model has a property called meta where arbitrary metadata can be stored. First approach: Make the backend return links in...
Read more >How to use json-api pagination links in Ember 2.x?
You just have to create a Serializer that intercepts the payload from the server and moves the response.links into Ember Data's metadata.
Read more >JSON:API — Latest Specification (v1.1)
Any pagination links in a relationship object MUST paginate the relationship data, not the related resources. Note: See fields and member names ...
Read more >Adding Pagination to an API - MetaBates.com
Here the API returns the pagination meta-data right inside of the JSON response. The advantage here is that everything is very visible to ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you want you can manually call
serialize
then add the data yourself in the route handler:Would that work for now?
Is any updates/examples on this (pagination)?