I have a Stack of ids of unknown size(set dynamically during run) that i want to serialize but am unsure how to.
The format MUST match this:
"items":["<ITEM1 ID>", "<ITEM2 ID>"]
"items":["<ITEM1 ID>", "<ITEM2 ID>", "<ITEM3 ID>"]
"items":["<ITEM1 ID>", "<ITEM2 ID>", "<ITEM3 ID>", "<ITEM4 ID>"]
the full JSON request is as follows:
{"data":[{"Action":"<ACTION HERE>","sellInOnePiece":false,"items":["<ITEM1 ID>", "<ITEM2 ID>"],"requirements":[{"_tpl":"<ID HERE>","count":<COUNT HERE>,"level":0,"side":0,"onlyFunctional":false}]}],"tm":2}
The thing is, i dont know how many items there will be. It could be 1, it could be 100. How can i dynamically add the interior input of "items" based on the number of items in my stack?