I have the following json string
{
"property1" : "value",
"property2" : 2,
"property3" : { "subprperty1" : "value" }
}
and I want to deserialize it (using Newtonsoft's Json.net) but keep property3 as a string.
So I have created the following model class
class JsonModel {
string property1 {get; set;}
int property2 {get; set;}
string property3 {get; set;}
}
But when i deserialize it using JsonConvert.DeserializeObject<JsonModel>(json_string); I get the following error :
Newtonsoft.Json.JsonReaderException: 'Unexpected character encountered while parsing value: {.