开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜