Skip to content

Commit

Permalink
Disable jackson FAIL_ON_UNKNOWN_PROPERTIES (#2690) (#2694)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Apr 26, 2023
1 parent 3444ecf commit 1d7009e
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 1d7009e

Please sign in to comment.