Is it possible to convert a list of objects from json to an 2D array?
Data.json
{
"x": 6,
"y": 6,
"information": [
{
"x": 0,
"y": 0,
"info": "First item",
"info2": 1
},
{
"x": 1,
"y": 3,
"info": "Second item",
"info2": 3
},
{
"x": 3,
"y": 4,
"info": "Third item",
"info2": 2
}
]
}
The first x and y are the size of the 2D array. Is it possible to use the Custom JsonConverter to put the information list into this array based on the x and y of the info objects? I know that it could be possible to convert it first into a list and then without Json.net into an array, but would it be possible while deseriliazing?
"x": (\d+),\s+"y": (\d+),