From 1d7009e13a219be827cdf2223b3826f2af95eb5a Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Wed, 26 Apr 2023 15:37:52 +0800 Subject: [PATCH] Disable jackson FAIL_ON_UNKNOWN_PROPERTIES (#2690) (#2694) --- .../main/java/com/pingcap/tikv/catalog/CatalogTransaction.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tikv-client/src/main/java/com/pingcap/tikv/catalog/CatalogTransaction.java b/tikv-client/src/main/java/com/pingcap/tikv/catalog/CatalogTransaction.java index fa879a816d..0516f1f0d5 100644 --- a/tikv-client/src/main/java/com/pingcap/tikv/catalog/CatalogTransaction.java +++ b/tikv-client/src/main/java/com/pingcap/tikv/catalog/CatalogTransaction.java @@ -19,6 +19,7 @@ import static com.pingcap.tikv.codec.MetaCodec.KEY_DBs; import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.pingcap.tikv.Snapshot; @@ -51,6 +52,7 @@ public static T parseFromJson(ByteString json, Class cls) { logger.debug(String.format("Parse Json %s : %s", cls.getSimpleName(), json.toStringUtf8())); ObjectMapper mapper = new ObjectMapper(); + mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); try { return mapper.readValue(json.toStringUtf8(), cls); } catch (JsonParseException | JsonMappingException e) {