Say I have a class
class A {
public int x;
}
Then a valid json can be parsed as follows:
ObjectMapper mapper = new Obje
As of Jackson version 2.9, there is now DeserializationFeature.FAIL_ON_TRAILING_TOKENS which can be used to achieve that:
ObjectMapper objectMapper =
new ObjectMapper().enable(DeserializationFeature.FAIL_ON_TRAILING_TOKENS);
See https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.9 and https://medium.com/@cowtowncoder/jackson-2-9-features-b2a19029e9ff