Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose EntityViewAwareMappingJackson2HttpMessageConverter as a Bean to support re-usage for http-clients #1899

Open
EugenMayer opened this issue Apr 26, 2024 · 0 comments

Comments

@EugenMayer
Copy link
Contributor

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 and RestTemplate 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 own EntityViewAwareMappingJackson2HttpMessageConverter 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment