Tag Info

Hot answers tagged

30

I think your instincts are largely correct; those proclaimed benefits really aren't all that great, as for any non-trivial web application the clients are going to have to care about the semantics of what they're doing as well as the syntax. But that doesn't mean that you shouldn't make your application follow the principles of HATEOAS! What does HATEOAS ...


6

The need for discoverability may not be relevant, but the links that allow discoverability serve more purposes. The most important of these, to my mind, is that providing full URI's in the responses to the client, means that no client will ever need to "compose" an URI. That means that no client will ever need knowledge about how the URI's are structured. ...


4

The things is, HATEOAS must come with a second pillar that define what a RESTful API is : standardized media type. Roy fielding himself said A REST API should spend almost all of its descriptive effort in defining the media type(s) used for representing resources". With a standardized media type that define the transition explicitely, and hypertext to ...


4

You can publish details on your services through a "WADL" http://en.wikipedia.org/wiki/Web_Application_Description_Language It's optional and not every backend REST technos supports this. Jersey, the "official" java implementation of jax-rs, supports it for example - it can be automaitcally generated for you. It's quite rare though, to see it used. I ...


3

the app we are building won't simply look at the links and then by itself render the correct UI and make the right ajax calls In fact, this is exactly what HATEOAS will give the UI. Not what is possible, but when it is possible. A formal HATEOAS like HAL, as the question states, gives links that indicate what is possible. But when those links show ...


3

"Clients" may not be advanced enough to make use of it, but the users of clients can. A client can be something as simple as a web browser, after all. The discoverability is all about enabling people to learn and use the API. For example, Jenkins (the CI server) has a REST-like interface. Go to any page, postfix the URL with "/api", and you get a page ...


2

NOTE: I'm no expert on the subject, but I went through a similar process of trying to reconcile the different nuances of people's interpretations of "REST" a few years ago, and this is the takeaway I got from looking into it at the time. To my understanding, this stems from Roy Fielding's Hypermedia as the Engine of Application State aka "HATEOAS", which ...


2

what is expected to live at the endpoint represented by that URI? A resource of some kind. Generally, you can identify the type of resource by examining the mime type. Often, it's just a web page. How is http://schema.org/name less ambiguous than name? It lives specifically at the http://schema.org/ domain, and the domain itself is unique. In ...


2

As I currently understand HATEOAS is basically all about sending together with each response links with information about what to do next HATEOAS is a lot more than just links. It is "hyper media" as the engine of application state. What is missed in your description is the content type, the formal definition of the hyper media that is passed between ...


2

You don't have to build a dynamically generated interface. Though it could be nice it's not required. If you cannot build a dynamic interface just use the links and you are done. Disadvantage is that you are again hard linked to the backend and will crash if something changes. Using the dynamic layout can be quite simple btw: links.forEach(function(link) { ...


2

HATEOAS is a somewhat controversial topic. Many people feel it's an example of overengineering and see no practical benefit to it. I believe it offers a natural and sensible approach to implementing Web APIs, with the benefits of increased decoupling between server and clients and a lower burden on client developers (see my answer to "REST HATEOAS - How does ...


1

Your second approach—including in the job model only links to actions the user is actually entitled to perform—is the one I would take. It keeps the focus on the resource and the actions that can be performed on it, which makes it both relatively simple and a good fit conceptually for the REST architectural style. It retains on the server all ...


1

In REST, do we always use link relation values to convey semantics/role of a linked resource? Using link relations is just one way to add semantics to links. The other standard solution to use RDF vocabs, for example hydra or schema.org. I assume link relation value is always specified using rel attribute? This depends on the media type, for ...


1

Spring has some support for this as does resteasy.


1

How would you know what kind of inputs are acceptable? That is to say, if your client has no prior knowledge, how would you define the semantics of "surname"? You're starting to get into the territory of needing something like OWL. I think it's more practical to expect your clients to understand the semantics of well-known mime-types; say, for example, ...


1

I had the pleasure a while ago to work with an API that had documentation that was very, very hard to understand. Once I managed to get an actual reply from the server, it was possible to compare the documentation with the server reply and use that to decipher the documentation (and yes, deciphering it was the right term). The problem was that if a request ...



Only top voted, non community-wiki answers of a minimum length are eligible