Skip to content

Commit

Permalink
Merge pull request #69 from semantic-systems/ignore-unknown-fields
Browse files Browse the repository at this point in the history
Ignoring unknown fields in QALD
  • Loading branch information
RicardoUsbeck authored Apr 28, 2022
2 parents b562d38 + 13fa31c commit 977fa9e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 977fa9e

Please sign in to comment.