Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am currently reading the book RESTful Web APIs by Leonard Richardson, Mike Amundsen and Sam Ruby, that describes the Collection+JSON pattern, and while searching around the web during my exploration of the information in the book, I stumbled upon JSON API.

Now I am thinking which to choose? And are there many more attempts and standardizing how a RESTful JSON API should look? So I looked around and found that big players like github invents there own! (Github+JSON) Others just use plain old, no standardized JSON formatting.

So what is up with this?

Are people actually using Collection+JSON or is it as standardized as Github+JSON, in the practical world? What about JSON API?

What have others betted on? What are others doing in this matter?

share|improve this question

closed as primarily opinion-based by Kilian Foth, MichaelT, GlenH7, gnat, ChrisF Sep 8 '14 at 10:10

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

    
Collection+JSON, JSON API, etc. are all media types. You could create your own! There are a lot of factors to consider here and they're well set out in Chp. 6 of "Designing Evolvable Web APIs with ASP.NET". –  Boggin Sep 5 '14 at 11:19
1  
Several parts to this question appear to be soliciting opinions and polling for what other people are doing. These aspects are ones more appropriate for a discussion (which Stack Exchange isn't designed to handle well). Do you think you could modify your question so that it clearly presents the problem you are encountering without asking for recommendations or encouraging short answers of "we use XYZ"? –  MichaelT Sep 5 '14 at 16:06

1 Answer 1

Plain JSON isn't RESTful since it lacks the hypermedia constraint. If you are making a small-scale web application and don't need the development overhead of REST, however, then plain JSON will work just fine.

The Internet hasn't settled on a favored JSON hypermedia format. There are multiple formats available, each with their own pros and cons, and you should pick the format that best suits the needs of your application.

NOTE: This list is incomplete, and will likely become out-of-date due to the speed of emerging technologies. But it's a start.

A word of caution in case you decide to make your own. Writing your own format sounds great in theory, but you lose the main advantage of using a standard format; namely, that other developers don't need to learn a new format for each web application.

You can do it if you really need to, but be prepared to host your own documentation and maybe even provide a simple library for handling your response JSON.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.