This is what I do:
var aTrueVar (true); String stringValue (JSON::toString (aTrueVar)); var anotherTrueVar = JSON::parse (stringValue);
at this point, I expect anotherTrueVar to be "true", but it is "null" instead
I found the reason for this in the fact that all the parse(...) methods expect to be feeded with either an array (starting with '[') or an object (starting with '{'), but don't take in account the fact that the passed string could be a primitive value instead (a number, a true/false value or a proper string instead).
I thought that a more suitable implementation for those "parse" methods would have been along the lines of the (currently private) method parseAny. Is there a reason why this isn't so and, if there is, how could I serialize and deserialize my var's to and from strings regardless of the fact that they could be primitive values or arrays?
TL;DR: the JSON::parse() method isn't the reciprocal of the JSON::toString() method when it comes to primitive type vars. Could you please make it so, or provide a workaround?