Hot answers tagged

25 votes

What's the point with HATEOAS on the client-side?

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 ...
  • 1,195
15 votes

Is REST and HATEOAS a good architecture for web services?

AFAIK Fielding didn't claim REST was any good, he was just describing the de-facto architecture of the web. That undersells it a bit, I would think. REST is, after all, an enumeration of the ...
10 votes
Accepted

What does "HATEOAS" have to do with Application State?

A web application, RESTful or not, is generally not simply a data service; it exposes various resources and provides some behavior, and so it has state; a distinction is made between resource state (...
10 votes

What does "HATEOAS" have to do with Application State?

If you want to understand REST, or HATEOAS, you should probably start by understanding the web. HAL is (effectively) just a substitute for HTML; if you understand how HTML "works", then ...
6 votes

Is REST and HATEOAS a good architecture for web services?

No, 'full REST' is not that great. As evidenced by the lack of people who implement HATEOS in thier APIs and the endless arguments over which HTTP verb to use for a particular call. But you have to ...
  • 65.4k
6 votes

What is the need for 'discoverability' in a REST API when the clients are not advanced enough to make use of it anyway?

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 ...
  • 38.5k
6 votes

HATEOAS APIs and front end development

The benefits of HATEOAS (Hypermedia) are real for both internal and external APIs. However, the tooling is often lacking to take advantage of those benefits. Let's start with the "problem" of having ...
6 votes
Accepted

How should REST resources relate to the server database schema?

How should REST resources relate to the server database schema? Not at all. The REST architectural principles are completely independent of the technology that is used to persist information. It is ...
5 votes
Accepted

Why do RESTful services that implement HATEOAS provide a self-relationship link?

The self link is also used for embedded entities where it can be used to navigate to the proper entity. See this HAL example: { "_links": { "self": { "href": "/orders" }, "curies":...
  • 9,057
5 votes
Accepted

HATEOAS links with client defined parameters, how to represent?

I highly recommend that, when using hypermedia, you use a hypermedia enabled media type. There are many JSON based media types out there that support form-like interactions. Here is an example using ...
5 votes

Advantages of HATEOAS based RESTful service

What are the advantages of HATEOS compliant RESTful service? In short: You stay in control of your server side, minimize client knowledge about server internals. Imagine Amazon giving you a product ...
5 votes

How does a RESTful client know the proper way of manipulating the state of a resource?

REST have come to mean two different things: The architecture of the web, as described by R.T.Fielding (who coined the term REST). This is the original definition. A HTTP API called from JavaScript ...
  • 55.2k
4 votes

How to expose field constraints using HATEOAS?

JSON Hyper-Schema is great for this kind of thing. It allows you to define a JSON Schema for the JSON you expect from the request. GET /my-resource/10 HTTP/1.1 200 OK Content-Type: application/json ...
4 votes

Advantages of HATEOAS based RESTful service

There is no advantage to a HATEOS compliant service. The stated goal is to make the api 'discoverable'. However no-one has managed to develop a client with enough AI to be able to interpret the ...
  • 65.4k
4 votes

Direct link with HATEOAS?

You just include the complete absolute url in an e-mail. That is an entry point to your app. It's a fantastic example of HATEOAS, because it allows an unknown application (email client) to continue a ...
  • 3,331
3 votes

HATEOAS APIs and front end development

REST is designed to facilitate API stability and reusability over a very long time horizon when you have multiple clients outside of your control. It sounds like your project has a single API client ...
  • 3,362
3 votes
Accepted

In REST is HATEOAS really about self-discovery or about navigation?

Disclaimer: answer offered without first rereading the Fielding thesis. HATEOAS supports the discovery of previously unknown application states. Think state machine. The hypermedia representation ...
3 votes

What's the point with HATEOAS on the client-side?

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 ...
3 votes
Accepted

What's the ideal way to send a success message in the response of a HATEOAS Rest Api?

Remember, you are not sending messages from the server to the clients. You are sharing resources. Representations of resources you have somewhere. More specifically, their status. A projection of them....
  • 11.9k
3 votes

RESTful API design using HATEOAS - Decision on Structure

This seems like a purely implementation question, it makes no difference to the end result but might make it easier to debug How would you explain to a client that sometimes a call returns X and ...
  • 65.4k
2 votes

What's the point with HATEOAS on the client-side?

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 ...
  • 2,604
2 votes

What does HATEOAS offer for discoverability and decoupling besides ability to change your URL structure more or less freely?

There are some Hypermedia formats which endeavour to provide richer responses which include more information about what kind of requests to send, and there's nothing stopping you from enriching the ...
2 votes
Accepted

Defining user operations on application/collection+json response?

As @Bart van Ingen Schenau said if your permissions can be mapped to http verbs, you could use the Allow header to indicate which operations are allowed on a resource. But since you talked about the ...
  • 263
2 votes
Accepted

Modeling resources with links

In the case bellow, no it should not be updated (then again is a uri to close account restful ? or withdraw money ?) class BankingAccount() { Double totalAmount; String ownerName; URI ...
  • 263
2 votes

What is the function of URLs as "key" names in markup used for a RESTful API?

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. ...
2 votes
Accepted

Does discoverability in HATEOAS require the information must be machine readable, or can it just be human readable?

As you pointed out, Roy Fielding wrote an interesting article on his blog. And this paragraph summarize pretty well "How to HATEOAS": A REST API should spend almost all of its descriptive effort in ...
2 votes
Accepted

What is wrong with treating a client session as a resource/application state in REST architecture?

what would be wrong with treating a client session as a resource/an application state as well? There is nothing wrong with that per say, the problem comes when you try and use application state (in ...
2 votes

What is wrong with treating a client session as a resource/application state in REST architecture?

what would be wrong with treating a client session as a resource/an application state as well? The short answer is that you get unexpected side effects when the client's understanding of application ...
2 votes

HATEOAS APIs and front end development

Let be honest, HATEOAS is not worth implementing. However, it sounds like your issue isn't really about HATEOAS. It's about what's included in the model. Even if the api caller already knows all the ...
  • 65.4k

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