The idea is to also allow parsing of simple valid JSON strings which are not wrapped in an object or array.
In the current implementation the Json sink is never invoked which leads to blocked resources (and timeouts) if the client does respond with just numbers, enum values etc.
By invoking the sink.accept function whenever a token was processed and the depth is 0 we also make sure simple JSON strings can be processed.
The idea is to also allow parsing of simple valid JSON strings which are not wrapped in an object or array. In the current implementation the Json sink is never invoked which leads to blocked resources (and timeouts) if the client does respond with just numbers, enum values etc.
By invoking the sink.accept function whenever a token was processed and the depth is 0 we also make sure simple JSON strings can be processed.