org.http4k.format.JacksonYaml.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-yaml Show documentation
Show all versions of http4k-format-jackson-yaml Show documentation
Http4k YAML support using Jackson as an underlying engine
package org.http4k.format
import com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES
import com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES
import com.fasterxml.jackson.databind.DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS
import com.fasterxml.jackson.databind.DeserializationFeature.USE_BIG_INTEGER_FOR_INTS
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.Feature.WRITE_DOC_START_MARKER
import com.fasterxml.jackson.module.kotlin.KotlinModule
object JacksonYaml : ConfigurableJacksonYaml(KotlinModule()
.asConfigurable(ObjectMapper(YAMLFactory().disable(WRITE_DOC_START_MARKER)))
.withStandardMappings()
.done()
.deactivateDefaultTyping()
.configure(FAIL_ON_UNKNOWN_PROPERTIES, false)
.configure(FAIL_ON_IGNORED_PROPERTIES, false)
.configure(USE_BIG_DECIMAL_FOR_FLOATS, true)
.configure(USE_BIG_INTEGER_FOR_INTS, true)
)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy