While deserializing some JSON into a C# object, I started getting a System.OverflowException for one of my Int32 properties: Value was either too large or too small. I was able to save the offending json to a file to inspect it further and reproduced the error in a unit test. There should really never be a value this big or small coming in; I need to find the specific JSON attribute with this large value (to make the underlying property long). The problem is there are roughly 5000 lines to sort through.
From my research, Visual Studio Find RegExs don't seem like a good fit for this case as their don't seem to be greater than or less than operators. What is the best way to search this file for values greater than 2147483647?
Sample Json:
"id": "pmanc",
"operation": "UPDATE",
"ResourceIAQStats": {
"resourceId": "pmanc",
"resourceName": "Peter Manc",
"resourceState": 7,
"durationInStateMillis": 113888,
"nHandledContacts": 68,
"nPresentedContacts": 68,
"avgTalkDuration": 181324,
Edit
Here is my C# method for parsing the JSON, the Overflow Exception is occurring when attempting to deserialize the JArray Children to the generic object. Newtonsoft does not specify which object (or property) was too large.
public async Task<List<T>> GetStatsAsync<T>(string testJson)
{
var requestResult = JArray.Parse(testJson);
return new List<T>(requestResult.Children()
.Select(jo => jo[typeof(T).Name].ToObject<T>()));
}