Consider the following snippet which passes json string with ascii value 5 
(0x35), and expects deserialization result to be an integer.

        ObjectMapper o = new ObjectMapper();

        String json = "\"5\""; // notice json string rather than json number

        Integer result = o.readValue(json, Integer.class); // expect throws 
for wrong type

        System.out.println("Hello world!");


In default configuration this does not seem to throw mismatch exception. 
Which of the flags should be used to prevent type coercion? For enums I 
found FAIL_ON_NUMBERS_AS_ENUMS, but I couldn't seem to find an equivalent 
for general coercion.

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jackson-user+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/jackson-user/048bd9e4-cd72-4ac3-b6ea-aee5ffeb34d9n%40googlegroups.com.

Reply via email to