I'm having some trouble parsing a nested JSON response from an API.
The API returns an array, with an array of objects. The problem I'm facing is the int value contained in each array before the objects in the array (see attached example JSON snippet).
I've currently set up the deserialized types and objects, which is seemingly fine, however, the problem occurs when restsharp fails to deserialize the INT values to my deserialized type.
The Json
[
[
1064,
{
"trx_id": "",
"block": 0,
"trx_in_block": 0,
"op_in_trx": 0,
"virtual_op": 0,
"timestamp": "",
"op": [
"vote",
{
"voter": "user1",
"author": "user2",
"permlink": "UUID",
"weight": 0
}
]
}
]
]
The request
var response = await restClient.Execute<List<List<Models.Responses.AccountHistory.Transaction>>>(request);
Transaction.CS
public class Transaction
{
public string trx_id { get; set; }
public long block { get; set; }
public long trx_in_block { get; set; }
public long op_in_trx { get; set; }
public long virtual_op { get; set; }
//Etc..
}
I'm trying to get a nested array of transactions deserialized, the int value is not something I have any practical use for. I'm looking for a way to ignore the integer and only parse the objects.
Error
Unhandled Exception: Newtonsoft.Json.JsonSerializationException: Error converting value 0 to type 'Models.Responses.AccountHistory.Transaction'. Path '[0][0]', line 1, position 3. occurred