I have to build out a somewhat complex JSON file.
I'm using the JsonGenerator object to build out the root structure which includes a array of submissions. I could build out the entire file with the JsonGenerator functions, but this will be tedious and unmaintainable due to the json complexity.
I have decided to
- store the submission json template in a text file
- load the text file into a string variable
- pass the required data into the json string variable.
- I then want to load the filled out json string variable into a JsonParser object
- and finally load the JsonParser object into the JsonGenerator object submission array using the AddItemObject function
I'm struggling a bit with the AddItemObject function.
Is it possible to add a json object to a json array using the AddItemObject function?