Hello! I'm having trouble configuring Jackson in a...
# jackson-kotlin
h
Hello! I'm having trouble configuring Jackson in a Kotlin codebase with a custom serializer for Long-class (want it for Java and Kotlin instances). Right now I'm trying to serialize a Java-class(provided in a lib from a jar) with Long-fields but the custom serializer I've added isn't matching it seems.
Copy code
val objectMapper = jacksonObjectMapper()
        val module = SimpleModule()
        module.addSerializer(Long::class.java, MyCustomSerializer())
        module.addSerializer(Long::class.javaPrimitiveType, MyCustomSerializer())
        module.addDeserializer(Long::class.java, MyCustomDeserializer())
        module.addDeserializer(Long::class.javaPrimitiveType, MyCustomDeserializer())
        objectMapper.registerModule(module)
        objectMapper.registerModule(Jdk8Module())
        objectMapper.registerModule(KotlinModule())
        <http://logger.info|logger.info>("test ${objectMapper.writeValueAsString(classWithLong.first())}")