This sample uses the P:Newtonsoft.Json.JsonSerializerSettings.MaxDepth setting to constrain JSON to a maximum depth when deserializing.
Sample