All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lsdconsulting.generatorui.config.objectmapper.ObjectMapperCreator.kt Maven / Gradle / Ivy

The newest version!
package com.lsdconsulting.generatorui.config.objectmapper

import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.SerializationFeature
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
import com.fasterxml.jackson.module.kotlin.KotlinModule

class ObjectMapperCreator {
    fun create(): ObjectMapper {
        val mapper = ObjectMapper()
        mapper.registerModule(KotlinModule.Builder().build())
        mapper.registerModule(JavaTimeModule())
        mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
        return mapper
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy