org.http4k.format.JacksonXml.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http4k-format-jackson-xml Show documentation
Show all versions of http4k-format-jackson-xml Show documentation
Http4k XML support using Jackson as an underlying engine
package org.http4k.format
import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.module.kotlin.KotlinModule
/**
* To implement custom XML configuration, create your own object singleton. Extra mappings can be added before done() is called.
*/
object JacksonXml : ConfigurableJacksonXml(KotlinModule.Builder().build().asConfigurableXml()
.withStandardMappings()
.done().apply {
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)
}
)