Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My statement that HATEOAS is misunderstood is corroborated over and over by the replies to my comment. HATEOAS being misunderstood is so weird because it is an acronym of its own definition so I have no idea where all these other definitions are coming from. Let's examine it closer. HATEOAS stands for:

Hypermedia as the engine of application state

Hypermedia means HTML, period. Putting a list of URLs in a text or JSON response does not magically make it hypermedia.

Engine of application state means that all representations of the resources must be possible.

Combine those two and it means that all functionality must be accessible to and from the text/html content type. It must be able to handle all supported HTTP verbs and no fancy request headers that are not supported by HTML forms or hyperlinks.



> Hypermedia means HTML, period.

Wrong. Any resource representation that can contain links to other resources with semantic identification of the relationship they have with the current resource is hypermedia. HTML is particularly popular, but far from the only hypermedia format.

> Putting a list of URLs in a text or JSON response does not magically make it hypermedia.

No, not magically, but if you have URLs with identification of their relationship to the current document in JSON, it is hypermedia. Hypermedia is older than HTML, and extends well beyond it.

> Engine of application state means that all representations of the resources must be possible.

No, it doesn't. HATEOAS does not mean that all resources must have hypermedia representations, it means that all available actions on the application state (whether read actions or write actions) must be identified to the client through hypermedia. (E.g., through links communicated in hypermedia resource representations wherein the semantics of the representation and the media-type of the resource in which it appears and which applies to the linked resource define the available actions.) A resource representation to which access is provided via a hypermedia link but which does not define additional linked resources need not be in a hypermedia format (that is, some resources may be purely defined by things like straight -- not hyper- -- text resources, or images, or whatever.)

> Combine those two and it means that all functionality must be accessible to and from the text/html content type.

It doesn't mean that at all. What HATEOAS means is laid out most clearly by Roy Fielding in a blog post responding to the way in which his definition of REST had been misunderstood on this point: http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hyperte...

REST isn't about HTML or the Web, though the Web and HTML are the inspiration for the definition of the REST architectural style. REST (and HATEOAS more specifically) requires neither HTML, nor any of the other specific technologies (HTTP, etc.) that define "the Web".


"Hypermedia means HTML, period."

Um, no. XHTML and SVG are hypermedia.

JSON isn't hypermedia, but you can define hypermedia formats that use JSON (just as SVG uses XML).


True, but with so much confusion over a blatantly clear definition I figured I needed to keep it simple.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: