News for hackers. Stuff that matters.
Re:How I learned to stop worrying and love REST by ryanbrunner on Sunday February 05, 2012 @04:32PM (#3555306)
This is probably my number one criticism of most "REST" APIs out there - they are horribly non self-documenting, and the effort required to make them self-documenting is really fairly trivial:

1. Ensure that you have a URI to the resource in question every single time you reference an ID somewhere (in collections, when referencing resources from another resource)

2. Make the root of your application document all the collections available and their respective URIs.

3. Include paging URIs as mentioned in the article.

4. If a resource has nested collections, include URIs to them in your JSON representation of the resource.

Boom! You now have a REST API better than 99% of what's on the web today.

Re:How I learned to stop worrying and love REST by vyrotek on Sunday February 05, 2012 @07:02PM (#3555710)
Yes, what you describe is true. We also had a good discussion a few days ago about scenarios where REST doesn't seem to work well. The specific problem is when things start getting too chatty. Its very difficult to expose a flexible (fine-grained) REST API and at the same time give you all the data you need in the least amount of calls. It takes quite a bit of work up front to figure out what your model is going to be and figuring out if that model will work for most of your consumers. Getting the 'pattern' down as you described is half the battle.

http://news.ycombinator.com/item?id=3538585

http://news.ycombinator.com/item?id=3538134

Re:How I learned to stop worrying and love REST by verelo on Sunday February 05, 2012 @04:33PM (#3555312)
and this is what i was talking about!
[deleted]
Re:How I learned to stop worrying and love REST by gotmayonase on Sunday February 05, 2012 @05:06PM (#3555426)
Think he was referring to another comment, he's not the author.