Jackson Json parser does not parse strictly. Solution?
The following string is an invalid JSON string according to http://www.json.org/
"billPeriod":{"from":"2011-6-1","to":"2011-6-28"}}
It is missing a closing brace at the start.
However, when I pass this through the Jackson Json parser, it returns a JsonMappingException rather开发者_开发问答 than a JsonParseException.
ObjectMapper mapper = new ObjectMapper();
String input = "\"billPeriod\":{\"from\":\"2011-6-1\",\"to\":\"2011-6-28\"}}"
mapper.readValue(input, clazz.class);
Can anyone help? I've looked but can't find a variable setting to increase the "strictness" of the parsing.
Thanks Dan
精彩评论