Closed
Description
Some observations:
- There are two
MappingJackson2HttpMessageConverters
registered with Spring MVC, both of which have the same supported media types. I don't understand why we need two. - If you have Spring Data REST on the classpath, HypermediaAutoConfiguration gets switched off which means that
spring.hateoas.apply-to-primary-object-mapper
has no effect. - If you have Spring Data REST on the classpath, I believe that Spring HATEOAS's
ObjectMapper
is created beforeJacksonAutoConfiguration
runs. This means that HATEOAS'sObjectMapper
becomes the only auto-configuredObjectMapper
, but it isn't annotated@Primary
. - We should try to move away from using
Jackson2HalModule
and its handler instantiator directly as @olivergierke considers them to be private API.
Some goals:
spring.jackson.*
properties should take effect irrespective of what's on the classpath.- When Spring HATEOAS or Spring Data REST are on the classpath,
spring.jackson.*
should affect theirObjectMapper(s)
- When Spring HATEOAS is on the classpath, HAL-formatted responses should be sent in response to requests that accept
application/json
(HAL not set as default in 1.2.0 #2147) - The actuator's JSON output should be affected by
spring.jackson.*
, irrespective of whether or not Spring HATEOAS and Spring Data REST are on the classpath. (Spring-boot-starter-data-rest prevents JSON pretty print in actuator. #1729)