I have the following json which is malformed, which has missing property value, I want JSON.Convert to throw an error while deserializing, but instead phoneNumber is replaced with null
when deserialize to strongly typed Object Person, and with dynamic type the value of phoneNumber is replaced with {}
, I have tried various JsonSerializerSettings but doesn't seem to help throw an error, is there a way to do this
var json= {
"firstName": "joe",
"lastName": "doe",
"phoneNumber": ,
"email": "joe.doe@test.com"
}
JsonConvert.DeserializeObject<Person>(json);
JsonConvert.DeserializeObject<Dynamic>(json);