"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.