isObject and isArray methods do also return true if the value is in fact a nullValue, which a bit strange IMHO.
Consider a common use like this:
const Json::Value& name = json["name"];
const Json::Value& age = json["age"];
const Json::Value& details = json["details"];
if (!name.isString()) // OK -> works as expected for string.
throw Error("name is unset or not in valid format");
if (!age.isNumeric()) // OK -> works as expected for number.
throw Error("age is unset or not in valid format");
if (!details.isObject()) // ERROR -> will fail to detect missing object
throw Error("details are unset or not in valid format");
if (details.type() == Json::typeObject) // OK, but this workaround is inconsistent with other types.
throw Error("details are unset or not in valid format");
It seems to me that JSON grammar does not make the null type a special case for empty object/array. In fact it considers null, object and array all distinct types.
It's definitely an error, null is just a value like a string or number as can be seen in http://json.org/.
I agree, but this is an old design decision. I'd be afraid to change it now.