I have some JSON I would like to deserialize, but I want to treat one of the properties as a string, not an object.
As an example the JSON looks like this:
{
"name":"Frank",
"sex":"male",
"address": {
"street":"nowhere st",
"foo":"bar"
}
}
And I want to deserialize it to this object - Treating the address object as a string literal:
public class Person
{
public string name;
public string sex;
public string address;
}
I've tried literally deserializing it to this object but get the error:
Cannot deserialize JSON object into type 'System.String'.
Any ideas?
Cheers