From 13fa31c17f5e13b2a593ad389b411152d9ee3171 Mon Sep 17 00:00:00 2001 From: Nikit Srivastava Date: Thu, 28 Apr 2022 12:48:38 +0200 Subject: [PATCH] modifying qald json deserialization ignores unknown fields while reading the QALD json --- .../org/aksw/qa/commons/load/json/ExtendedQALDJSONLoader.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qa.commons/src/main/java/org/aksw/qa/commons/load/json/ExtendedQALDJSONLoader.java b/qa.commons/src/main/java/org/aksw/qa/commons/load/json/ExtendedQALDJSONLoader.java index ef5a72c7..de9508ce 100644 --- a/qa.commons/src/main/java/org/aksw/qa/commons/load/json/ExtendedQALDJSONLoader.java +++ b/qa.commons/src/main/java/org/aksw/qa/commons/load/json/ExtendedQALDJSONLoader.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.ObjectMapper; @@ -109,6 +110,7 @@ public static Object readJson(final byte[] inputJson, final Class type) throw */ public static Object readJson(final InputStream in, final Class type) throws JsonParseException, JsonMappingException, IOException { ObjectMapper mapper = new ObjectMapper(); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS); return mapper.readValue(in, type);