Questions tagged [json-api]

"JSON API" is a standard for building APIs in JSON format. If you've ever argued with your team about the way your JSON responses should be formatted, JSON API is your anti-bikeshedding weapon.

"JSON API" is a standard for building APIs in JSON format. If you've ever argued with your team about the way your JSON responses should be formatted, JSON API is your anti-bikeshedding weapon.

Furthermore, clients built around JSON API are able to take advantage of its features around efficiently caching responses, sometimes eliminating network requests entirely.

By following shared conventions, you can increase productivity, take advantage of generalized tooling, and focus on what matters: your application.

Here's what JSON API (in the ID style) looks like:

{
  "posts": [{
    "id": "1",
    "title": "Rails is Omakase",
    "links": {
      "author": "9",
      "comments": [ "5", "12", "17", "20" ]
    }
  }]
}

and in the URL style:

{
  "posts": [{
    "id": "1",
    "title": "Rails is Omakase",
    "links": {
      "author": "http://example.com/people/9",
      "comments": "http://example.com/comments/5,12,17,20"
    }
  }]
}

JSON API covers creating and updating resources as well, not just responses.

More information can be found on the project's homepage.

693 questions
-2
votes
1 answer

Best practice: data-centric or client-centric JSON API for small amount of clients?

We´re developing a JSON API to deliver data to a handful of clients (namely iOS and Android Apps). Now, the constantly arising question is: from what point of view do we structure our JSON? 1) 'Client-centric': The JSONs keys are named after the…
stk
  • 6,311
  • 11
  • 42
  • 58
-3
votes
3 answers

Parse JSON String Using Retrofit, & Populate to List view/Recycler view?

I am new to Retrofit and Android, and now i am stuck at receiving the JSON from API. I want full solution to parse this JSON and populate it into RecyclerView or ListView. The Sample of JSON Data is…
-4
votes
1 answer

Are there any JSON:API parsers in PHP and JS?

I am considering using the JSON:API (http://jsonapi.org) standard to output resources. But are there any parsers for this standard? The JSON:API standard will put refereces for relationships in the relationships object in the json. The relationship…
Tom
  • 49
  • 6
1 2 3
46
47