Demis,
If you only specify object as the type, then the JsonSerializer doesn't know what object that is and will just leave it as a string.
To a degree JSON has some type information in the format itself. Would you mind if the JsonSerializer was changed to preserve the original JSON types instead of converting everything into strings?
For example:
JsonSerializer.DeserializeFromString<<object>.
25 -> 25 // int, currently a "25" string
25.5 ->
25.5
// double, currently a "25" string
"25" -> "25" // string, same as the current behavior
{"i": 25} -> new Dictionary<string, object> { { "i", 25 } }
etc
--
Pasha