The ProblemDetailXmlMapperBuilderCustomizer applied the wrong
ProblemDetail mixin for the Jackson XmlMapper. Namely the
ProblemDetailJacksonMixin, which is intended for JSON.
Now the ProblemDetailJacksonXmlMixin is used instead.
The corresponding test also tested for the wrong XML output,
which has been adjusted.
Fixes gh-48222
Signed-off-by: Maurice Zeijen <mzeijen@bol.com>
This commit polishes the renaming of JsonComponent to JacksonComponent
and the use of JacksonModule instead of Module in Jackson 2.
This also adds integration tests that use a JacksonComponent with
WebMvcTest and WebFluxTest.
Closes gh-47864
Previously, the auto-configured JsonMapper would back off when any
type of ObjectMapper was defined. Updating this was missed as part
of the move to Jackson 3 where both Boot and Framework now intend to
use the more specific JsonMapper type.
This commit updates the condition such that a JsonMapper will still
be auto-configured when any other type of ObjectMapper is definied.
It will now only back off when a JsonMapper bean is defined.
Closes gh-47379
Remove spring-boot-json-test module and spread code between
`spring-boot-test`, `spring-boot-test-autoconfigure` and JSON
technology modules.
See gh-46356
See gh-47322
The spring.jackson.read and spring.jackson.write properties are
JSON-specific. To make this more clear, this commit moves them
beneath spring.jackson.json. This also paves the way for
spring.jackson.cbor and spring.jackson.xml properties for CBOR- and
XML-specific settings should we add auto-configuration for XMLMapper
and/or CBORMapper in the future.
Closes gh-47328
Prior to this commit, Spring Boot would use Framework's
`Jackson2ObjectMapperBuilder` to configure the `ObjectMapper` instance.
This builder would configure the `ProblemDetail` mixin automatically.
With the introduction of Jackson 3.x support, Spring Framework removed
its builder in favor of the native Jackson builder. As a result, the
mixin is not registered with the `JsonMapper` aymore.
This commit ensures that the mixin is registered if the `ProblemDetail`
class is present in the classpath.
Closes gh-47298