Is there any way to limit the nesting level in the JSON document at the parsing stage in rapidjson (in order to limit the resource consumption, e.g. memory)? For instance set maximum nesting level to 100, so if the document to be parsed overpassed that limit, then rapidjson returns error.
I mean, something like this:
rapidjson::Document document;
document.Parse(myJsonAsString, 100);
if (document.HasParseError())
{
// use GetParseError() to check if the error was due to exceding nesting level
}
I have been looking to the Parse() method documentation but it's not clear to me if something like this is possible.