Search⌘ K
AI Features

The Value of Hypermedia

Understand why hypermedia is crucial in building Spring Boot APIs. Learn how it provides metadata like JSON Schema and ALPS to guide clients, reducing tight coupling and improving API flexibility. Discover how hypermedia links enable clients to navigate resources dynamically, supporting better maintainability and aligning with REST principles.

We'll cover the following...

Why add hypermedia?

At this point, we’ve seen how to create hypermedia and how to test it. But why is this all necessary?

That’s a fair question. After all, just because we can do something doesn’t mean we should. The point of hypermedia is to provide not only data, but also information on how to digest that data. That’s why hypermedia documents often come with profile links. These are links that give us a different JSON format that tells us about the data. These profile records can sometimes be fed into JavaScript libraries to render create/update forms.

JSON Schema is a great example of this. If served by our API, this metadata format can be piped into JSON Editor, a JavaScript library that creates a pop-up HTML form.

JSON Schema profiles are offered by Spring Data REST, a user of Spring HATEOAS, not Spring ...