Closed
Description
Tested with springboot 3.0.0
When the new ElasticsearchClient
is in the classpath, it triggers the ElasticsearchClientAutoConfiguration
which then overrides the application objectmapper / the one configured via Jackson2ObjectMapperBuilder
.
Reproducer for this issue; https://github.com/manofthepeace/spring3-elasticClient-mapperissue
Steps to reproduce;
- Run the test via
mvn test
the test will pass - modify the pom.xml and uncomment the elasticsearch-java dependency
- run the test via
mvn test
the test will fail - in
TestingWebApplication.java
use@SpringBootApplication(exclude = ElasticsearchClientAutoConfiguration.class)
- run the test via
mvn test
the test will pass
Expected behaviour;
the RestClientTransport
should use a new ObjectMapper, or somehow a user provided one, but not the one that spring-mvc / the global one is using. Can be done with new JacksonJsonpMapper()
or by passing an objectMapper to the JacksonJsonpMapper
constructor.