HATEOAS
- related: JSON-HAL Hyper Schema
-
List https://restfulapi.net/hateoas/
-
The dynamic example would be when client building the menu based on links returned for the resource. So server (base on user’s authorization) will return only links accessible for the user and client will build the menu dynamically.
-
clients needs to know about possible actions, but with hypermedia links they don’t have to know about the business logic. Say you have your typical blog with post resources. Some possible actions might be to like, edit, delete and archive posts. Without links, clients would need to know the business logic about when it is possible to like/edit/delete/archive a certain post resource. With links, the server tells clients what they can do, by providing the corresponding links.
-
- https://medium.com/@andreasreiser94/why-hateoas-is-useless-and-what-that-means-for-rest-a65194471bc8
- summary: no good server-side frameworks/tools and no good clients
- https://medium.com/@andreasreiser94/why-hateoas-is-useless-and-what-that-means-for-rest-a65194471bc8
Ideas
- could RDFa be used for embedding semantic data?
- Apparently
- "When representations are provided in hypertext form with typed relations (using microformats of HTML, RDF in N3 or XML, or even SVG), then automated agents can traverse these applications almost as well as any human. There are plenty of examples in the linked data communities. More important to me is that the same design reflects good human-Web design, and thus we can design the protocols to support both machine and human-driven applications by following the same architectural style." 1
- Apparently
Implementations
Resources
- https://www.kapresoft.com/software/2023/11/09/rest-hateoas-best-practices.html
- https://www.baeldung.com/spring-hateoas-tutorial mentions Spring Hateoas
- https://news.ycombinator.com/item?id=36944686
- https://unitcoding.com/implementing-hateoas/ mentions Riskfirst_hateoas
- https://spring.io/guides/gs/rest-hateoas
References
- Hatoeas Is for Humans
- https://softwareengineering.stackexchange.com/questions/388325/advantages-of-hateoas-based-restful-service
Footnotes
Backlinks