I'm not sure how to define the data
property to deserialize the following json data...
{
"response": {
"total_rows": 39,
"data": [
[
"XXXXXXXXXXXXXXXXXBs2VI",
"a7ac4aa7-7211-4116-be57-0c36fc2abeee",
"AAAAAA",
"Crn Burnley & Victoria St",
"Richmond",
"VIC",
"3121",
"555-555-555",
null,
"Real Estate & Home Improvement > Storage",
null,
null,
-37.8114511488511,
145.009782837163
],
[ .. ]
[ .. ]
....
},
status = "ok"
}
so I had ..
public class ResultData
{
public Response Response { get; set; }
public string Status { get; set; }
}
and....
public class Response
{
public int total_rows { get; set; }
public IList<string> data { get; set; }
}
but that was throwing an exception, saying "Can't cast float to string"
. SO it was trying to add those last two floats, into the List<>
.. but failed.
How can I fix this, please? (I can't control the json output).
Cheers :)
Update
It looks like the content of the data
json property is a fixed size array with fixed object types. So is there a way i could define that, in my .NET code so JSON.NET knows how to exactly deserialize it? Do I need to make a custom json deserializer for that json property?