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

RestClient Gson usage #43781

Open
rufus20145 opened this issue Jan 11, 2025 · 2 comments
Open

RestClient Gson usage #43781

rufus20145 opened this issue Jan 11, 2025 · 2 comments
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@rufus20145
Copy link

It would be great, if RestClient followed the spring.mvc.converters.preferred-json-mapper=gson setting or had a similar own. Now it only checks the classpath for the existence of jackson classes (in DefaultRestClientBuilder.initMessageConverters()). Since my application includes spring-boot-starter-actuator jackson will always be on the classpath, so there is no way RestClient will create GsonHttpMessageConverter instead of MappingJackson2HttpMessageConverter. As a workaround we can pass HttpMessageConverters from application context to RestClient.Builder, but DefaultRestClientBuilder.initMessageConverters() creates more converters, than I have in context. It seems, I don't need them, but I haven't tested it properly.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 11, 2025
@snicoll

This comment was marked as resolved.

@snicoll snicoll transferred this issue from spring-projects/spring-framework Jan 12, 2025
@wilkinsona
Copy link
Member

This is related to #33870 (comment) where we were also wondering about a property for choosing Gson that isn't specific to MVC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

4 participants