validateJsonReader<T> function

JsonReader<T> validateJsonReader<T>(
  1. JsonReader<T> reader
)

Makes a JsonReader validate the order of its operations.

The methods of a reader can be called in any order, including some which do not correspond to any JSON structure. Readers can be non-validating and accept any such incorrect ordering of operations.

The returned reader will forward all methods to reader, but will ensure that methods are not called in an order which does not correspond to a JSON structure.

Implementation

JsonReader<T> validateJsonReader<T>(JsonReader<T> reader) =>
    ValidatingJsonReader<T>(reader);