Skip to content

ElasticsearchClientAutoConfiguration causes global ObjectMapper to be overwritten #33426

Closed
@manofthepeace

Description

@manofthepeace

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;

  1. Run the test via mvn test the test will pass
  2. modify the pom.xml and uncomment the elasticsearch-java dependency
  3. run the test via mvn test the test will fail
  4. in TestingWebApplication.java use @SpringBootApplication(exclude = ElasticsearchClientAutoConfiguration.class)
  5. 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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions