io.wisetime.connector.config.TolerantObjectMapper Maven / Gradle / Ivy
/*
* Copyright (c) 2018 Practice Insight Pty Ltd. All Rights Reserved.
*/
package io.wisetime.connector.config;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
/**
* A static singleton of a tolerant object mapper concerning additional of new fields and the like.
*
* @author [email protected]
*/
public class TolerantObjectMapper {
public static ObjectMapper create() {
return new ObjectMapper()
.enable(JsonParser.Feature.ALLOW_COMMENTS)
.enable(JsonParser.Feature.IGNORE_UNDEFINED)
.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true)
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy