Hi,
I need to help with how to pass my instance of JacksonJsonpMapper to RestClientTransport in Spring Java/Kotlin project.
I have the following exception
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type `java.time.LocalDateTime` not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling.
It is thrown by JacksonJsonpMapper in Elastic client
at co.elastic.clients.json.jackson.JacksonJsonpMapper.serialize(JacksonJsonpMapper.java:98) ~[elasticsearch-java-8.5.3.jar:?]
Artifact jackson-datatype-jsr310 is added to the pom.xml. It is ok.
I can create my custom object mapper. It is ok.
val objectMapper = ObjectMapper().registerModule(JavaTimeModule())
val jsonpMapper = JacksonJsonpMapper(objectMapper)
In the documentation "Connecting" I see that I can pass on my instance of JacksonJsonpMapper
But how to do it in a project using Spring? Maybe by ClientConfiguration? How to pass my instance of JacksonJsonpMapper?