From fcdc638336e863434f4dcdd1a7acdff71cd4b7aa Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 25 Oct 2023 11:01:28 +0100 Subject: [PATCH] Mention what to do when use-hal-as-default-json-media-type is false Closes gh-26814 --- .../spring-boot-docs/src/docs/asciidoc/web/spring-hateoas.adoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/spring-hateoas.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/spring-hateoas.adoc index 72414c8d4361..0731b7067dbe 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/spring-hateoas.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/spring-hateoas.adoc @@ -9,3 +9,6 @@ Note that doing so disables the `ObjectMapper` customization described earlier. WARNING: `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 configprop: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.