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

jchanghong.gson.GsonHelper.kt Maven / Gradle / Ivy

There is a newer version: 3.0.38
Show newest version
package jchanghong.gson

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.jacksonObjectMapper


object JsonHelper {

    fun newJacksonMapper(): ObjectMapper {
        val objectMapper = jacksonObjectMapper()
        objectMapper.setSerializationInclusion(JsonInclude.Include.ALWAYS)
        objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false)
        objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS,false)
        return objectMapper
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy