hello!
according to your piece of code, my legitamately correct json string:
'{"order":"RUN","speeds":[100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0],"listeners":[1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0]}'
which consists of three pairs:
- first is (string,string)
- second is (string, array of int)
- third is (string, array of int)
doesn't pass the isValidJson() function...
please help!
here's a piece of code you can run to check it
<<code title= little test case>>
const char* message = "{\"order\":\"RUN\",\"speeds\":[100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0],\"listeners\":[1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0]}";
Json myd(message, strlen(message));
if ( !myd.isValidJson () )
{
printf( "Invalid JSON: %s\n", message );
return -1;
}
<<\code>>
Issue was solved adding Quotation mark before and after the array definition.