Spring HATEOAS
| This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Boot 4.1.1! |
If you develop a RESTful API that makes use of hypermedia, Spring Boot provides auto-configuration for Spring HATEOAS that works well with most applications.
The auto-configuration replaces the need to use @EnableHypermediaSupport and registers a number of beans to ease building hypermedia-based applications, including a LinkDiscoverers (for client side support) and an JsonMapper configured to correctly marshal responses into the desired representation.
The JsonMapper is customized by setting the various spring.jackson.* properties or, if any exist, the JsonMapperBuilderCustomizer beans.
You can take control of Spring HATEOAS’s configuration by using @EnableHypermediaSupport.
Note that doing so disables the JsonMapper customization described earlier.
spring-boot-starter-hateoas is specific to Spring MVC and should not be combined with Spring WebFlux. In order to use Spring HATEOAS with Spring WebFlux, you can add a direct dependency on org.springframework.hateoas:spring-hateoas along with spring-boot-starter-webflux. |
By default, requests that accept application/json will receive an application/hal+json response.
To disable this behavior set spring.hateoas.use-hal-as-default-json-media-type to false and define a HypermediaMappingInformation or HalConfiguration to configure Spring HATEOAS to meet the needs of your application and its clients.
- Related Spring Documentation
- Spring Boot
- Spring Framework
- Spring Cloud
- Spring Cloud Build
- Spring Cloud Bus
- Spring Cloud Circuit Breaker
- Spring Cloud Commons
- Spring Cloud Config
- Spring Cloud Consul
- Spring Cloud Contract
- Spring Cloud Function
- Spring Cloud Gateway
- Spring Cloud Kubernetes
- Spring Cloud Netflix
- Spring Cloud OpenFeign
- Spring Cloud Stream
- Spring Cloud Task
- Spring Cloud Vault
- Spring Cloud Zookeeper
- Spring Data
- Spring Integration
- Spring Batch
- Spring Security
- Spring AI
- Spring AMQP
- Spring CLI
- Spring GraphQL
- Spring for Apache Kafka
- Spring Modulith
- Spring for Apache Pulsar
- Spring Shell All Docs...
