Skip to content

Commit

Permalink
Disable jackson FAIL_ON_UNKNOWN_PROPERTIES (#2690)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanyu66 authored Apr 26, 2023
1 parent e0c15f6 commit e534021
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -51,6 +52,7 @@ public static <T> T parseFromJson(ByteString json, Class<T> 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) {
Expand Down

0 comments on commit e534021

Please sign in to comment.