Expose EntityViewAwareMappingJackson2HttpMessageConverter as a Bean to support re-usage for http-clients #1899
Labels
component: entity-view
component: jackson
component: spring-data
component: spring-data-webflux
component: spring-data-webmvc
component: spring-hateoas
kind: enhancement
worth: medium
Implementing this has a medium worth
Milestone
Right now
EntityViewAwareMappingJackson2HttpMessageConverter
is used to add support for Spring MVC to (de)serialize entityViews and it is created internally and never expose.In fact
RestClient
andRestTemplate
both support the same converters to (de)serialize requests/responses. So if one would like to add EV support to those clients, one would need to create a ownEntityViewAwareMappingJackson2HttpMessageConverter
for this case.This can lead to unexpected side-effects when not done properly (ObjectMapper cloning) as happened in #1895
Exposing it as a Bean will make it possible to use the existing instance for the http-clients and avoid any unwanted sideeffects or even the extra-effort.
The text was updated successfully, but these errors were encountered: