|
@@ -2,6 +2,7 @@ package api.common.util;
|
|
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
+import com.fasterxml.jackson.databind.DeserializationFeature;
|
|
|
import com.fasterxml.jackson.databind.JavaType;
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
@@ -72,7 +73,9 @@ public class JsonUtil {
|
|
|
*/
|
|
|
@SneakyThrows
|
|
|
public static <T> T jsonToBean(String json, Class<T> tClass) {
|
|
|
- return new ObjectMapper().readValue(json, tClass);
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
+ objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
|
|
+ return objectMapper.readValue(json, tClass);
|
|
|
}
|
|
|
|
|
|
/**
|