News for hackers. Stuff that matters.
Re:REST worst practices by jamesbritt on Saturday January 21, 2012 @12:41AM (#3492728)
If one wants to nest links in JSON, one has to tell the client how those links will appear. On has to define the structure beyond merely syntaxical correctness. This is where REST falls down, IMHO.

Then use HTML. Or some other representation with known link semantics.

I don't see how failures or shortcomings of JSON indicate a problem with REST. They are orthogonal; JSON has nothing to do with REST, it's just a serialization format some people like.

Re:REST worst practices by randomdata on Saturday January 21, 2012 @04:04AM (#3493084)
I am not sure who wrote it, or where to even find it again, but I have read exactly what virmundi is referring to. It is possible he is confusing authors.

The long and the short of the document was that a REST client must be able to navigate the entire API when given just a single endpoint URL, much like you can navigate an entire website just by entering the homepage URL into your browser, but without the dependance on HTML.

The leap the document made, and what virmundi seems to be referring to, is that a REST client that speaks, say, JSON is not enough to traverse any random service, as everyone will provide a completely different JSON representation of their data. When you start hardcoding site-specific keys in which to find the action descriptions, you lose all of the flexibility the author claimed REST would provide in the first place.

Re:REST worst practices by virmundi on Sunday January 22, 2012 @01:44PM (#3497268)
Part of my comment is backed by the implicit constraint on HATEOS, http://en.wikipedia.org/wiki/HATEOAS.

I've downloaded the original thesis. I'll look there to see what's mentioned about the hypermedia linking process.

Re:REST worst practices by masklinn on Saturday January 21, 2012 @05:09AM (#3493220)
> Then use HTML. Or some other representation with known link semantics.

Or define link semantics in JSON, the one documentation a restful service should have is that of media types (the documents returned) anyway, the only URL which should appear in the documentation is the root of the service.

Whining that JSON has no link semantics is nonsensical, SGML does not have any either, HTML added those when it was first created as an application of SGML, just as text/xhtml+xml is an application of XML defining links, "XML" as a meta-type does not know about links either.