Anyone know how to retrieve the spring provided instance of an object mapper? I've tried autowiring ...
a
Anyone know how to retrieve the spring provided instance of an object mapper? I've tried autowiring as such
Copy code
@Autowired
lateinit var builder: Jackson2ObjectMapperBuilder
😶 1
t
objectMapper: ObjectMapper works for me (in the Java world though)
a
I've tried that as well
Copy code
@Autowired
private val objectMapper: ObjectMapper
but no luck lol
t
You should be able to inject an instance of the
ObjectMapper
or
Jackson2ObjectMapperBuilder
. See: https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/sprin[…]mework/boot/autoconfigure/jackson/JacksonAutoConfiguration.java If you manually registered a qualified instance or don’t have right starter project (web/webflux) in your project, that may be the cause of this behavior.
✅ 1