I have a simple method in which i try to deserialize a string, in most cases this is a valid object in json but I also have cases like this:
private static string DoSomething(string data)
{
var result = JsonConvert.DeserializeObject(data);
}
If data is a simply string
data = "Healthy"; // JsonConvert.DeserializeObject throws an exception
JsonReaderException: Unexpected character encountered while parsing value: H. Path '', line 0, position 0.