I have a JSON file where I have data types as integer, array, string etc … issue happens while reading file in C# when array property for one of my valid JSON has data like this "power":[-INF, -INF, 6,-8.98]
.
Now I know, modern JSON parser do not support -INF value and that is why this error occurs. So one workaround will be to replace -INF in my data file to something like "-Infinity".
Can someone help me with an optimized code where I read the file and replace the -INF without breaking anything else in the JSON file before doing any further transformation.
Sample of my JSON file
{
"AppVersion":"testb0d",
"Bin":"P",
"FailCounts":[-INF,-INF,-INF,-INF,3.223622,-3.111,12,0,0]
}