question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JSON API compatibility

See original GitHub issue

Now that ember-data final is in the wild and it’s default to JSON API, a lot of people are going to be making moves to make their APIs compatible.

I realize that before JSON API, Kaminari was the best option for defaults, but now I think we should switch to JSON API compatible pagination.

We’re currently having to do some crazy param mapping stuff every single place we need to do it and we can’t even get the total pages to render properly.

Meta Tag Example for Pagination Metadata

{
  "meta": {
    "page": {
      "offset": 1,
      "limit": 10,
      "total": 35
    }
  }
}

Request Parameters Examples

  • page[number]
  • page[size]
  • page[offset]
  • page[limit]
  • page[cursor]

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:7
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
gte451fcommented, Oct 9, 2015

+1 All hail JSON API

0reactions
robertoplancartecommented, Jun 30, 2016

Frank Treacy has a post about this and shows a good workaround; he even links to this thread. Jump to “#1: Accessing pagination links”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSON:API — Frequently Asked Questions
Now that JSON:API has reached a stable version 1.0, it will always be backwards compatible using a never remove, only add strategy. A...
Read more >
About the JSON compatibility - IBM
You can combine relational and JSON data into a single query by using the JSON compatibility features. Applications that use the JSON-oriented query ......
Read more >
How to make your API backward compatible (Web, REST ...
It's a universally accepted standard nowadays to evolve APIs in a way as not to break existing clients. This holds for most APIs,...
Read more >
Asserting API Compatibility when using JSON | Niels Delestinne
It is often too easy to break API compatibility when using JSON as the data-interchange format. In an application landscape where we have ......
Read more >
How Does JSON:API Compare To REST and GraphQL?
That being said, both GraphQL and JSON:API are compatible with REST, and while the Venn Diagram of offerings that are “REST and also ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found