Closed
Description
Json::Value root;
Json::Reader reader;
const bool parsingSuccessful = reader.parse("404 Not Found", root);
parsingSuccessful == true !
p.s.
http://jsonlint.com/
Parse error on line 1:
404 NotFound
^
Expecting '{', '['
Json::Value root;
Json::Reader reader;
const bool parsingSuccessful = reader.parse("404 Not Found", root);
parsingSuccessful == true !
p.s.
http://jsonlint.com/
Parse error on line 1:
404 NotFound
^
Expecting '{', '['
Activity
Xiao-Chong commentedon Sep 11, 2014
Please use
Json::Reader reader(Json::Features::strictMode());
then it will return false
pavel-pimenov commentedon Sep 11, 2014
tnx
cdunn2001 commentedon Sep 11, 2014
Thanks, Xiao.
https://github.com/open-source-parsers/jsoncpp/wiki/FAQ#How_can_I_get_stricter_JSON_parsing