https://kotlinlang.org logo
Title
r

Razvan

12/02/2020, 6:51 PM
Hi, I can't figure out why my custom Jackson configuration that excludes null values is not used in the Body.auto lens.
object CustomJackson : ConfigurableJackson(KotlinModule()
    .asConfigurable()
    .withStandardMappings()
    .done()
    .deactivateDefaultTyping()
    .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
    .configure(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES, false)
    .configure(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS, true)
    .configure(DeserializationFeature.USE_BIG_INTEGER_FOR_INTS, true)
    .setSerializationInclusion(JsonInclude.Include.NON_EMPTY)
    .setSerializationInclusion(JsonInclude.Include.NON_NULL)
)
val obj = Body.auto<MyObject>().toLens()
in the json response I have the null object.... Trying to dig around, i see that
Body.auto
uses the mapper that is ConfigurableJackson class but can't figure out how to make sure it's the one from my CustomJackson that's used and not the default Jackson object ? any clues ?
Thanks to David's answer on this github issue I figured out... have to import my own auto... next time I'll search better
👍 1