#1453 - Make sure we only extend the default MappingJackson2HttpMessageConverter.

This is to make sure the custom converters registered by Spring Data REST, which all extend MJ2HMC, do not get the general customizations added as they otherwise trump the explicit configuration that Spring Data REST sets up.
This commit is contained in:
Oliver Drotbohm
2021-02-11 18:53:12 +01:00
parent bb3ed0add1
commit 0aae59a5e3

View File

@@ -92,7 +92,7 @@ class WebConverters {
Assert.notNull(converters, "HttpMessageConverters must not be null!");
MappingJackson2HttpMessageConverter converter = converters.stream()
.filter(MappingJackson2HttpMessageConverter.class::isInstance)
.filter(it -> MappingJackson2HttpMessageConverter.class.equals(it.getClass()))
.map(MappingJackson2HttpMessageConverter.class::cast)
.findFirst()
.orElseGet(() -> new MappingJackson2HttpMessageConverter(mapper));