What to do if I have this kind of json? I'm using rapidjson
{[
{
"username": "A",
"level": "1",
"score": "1774"
},
{
"username": "Ab",
"level": "1",
"score": "1923"
},
{
"username": "M",
"level": "1",
"score": "1991"
},
{
"username": "P",
"level": "1",
"score": "2030"
},
{
"username": "Am",
"level": "1",
"score": "2044"
}
]}
This will surely failed the assert.
rapidjson::Document doc;
doc.Parse<0>(message.c_str());
assert(doc.IsObject());
and how to extract the array if it doesn't even have a key?