com.bybutter.sisyphus.jackson.Smile.kt Maven / Gradle / Ivy
package com.bybutter.sisyphus.jackson
import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.core.JsonParser
import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.dataformat.smile.SmileFactory
object Smile : JacksonFormatSupport() {
override val mapper: ObjectMapper by lazy {
ObjectMapper(SmileFactory()).findAndRegisterModules()
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.configure(JsonParser.Feature.IGNORE_UNDEFINED, true)
.configure(JsonGenerator.Feature.IGNORE_UNKNOWN, true)
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy