tech.figure.classification.asset.util.objects.ACObjectMapperUtil.kt Maven / Gradle / Ivy
package tech.figure.classification.asset.util.objects
import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.SerializationFeature
import com.fasterxml.jackson.module.kotlin.registerKotlinModule
import com.hubspot.jackson.datatype.protobuf.ProtobufModule
object ACObjectMapperUtil {
fun getObjectMapper(): ObjectMapper = ObjectMapper()
.registerKotlinModule()
.registerModule(com.fasterxml.jackson.datatype.jsr310.JavaTimeModule())
.registerModule(ProtobufModule())
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
}