I'm kinda new with json. So I want to make an array value inside a value of an array like below.
{
"id": 0,
"title": "LEVEL",
"value": [10[2,3,5], 1]
}
But unfortunately It's not working. It gives me an error when I tried to read the data.
I want to know if it's possible to have an array inside an array value. Thank you.
}
Option2:
Option3:
I always advice people to create a class and generate json from it instead of trying to construct json from your head. It's easier if you do it this way and the generated json will always be valid and exaclty what you wanted.
This is what you want the json to look like:
Here is what the structure should look like:
Now, let's recreate what you have in that screenshot:
The generated Json result from
Debug.Log
:See how I generated the valid json by creating a data structure of what you have in your screenshot, then creating new instance of it. That's the best way to do this. If this is not exactly what you wanted then your image is wrong. You can easily modify the data structure to get what you want.