I`m trying to generate JSON with structure like this:
"rows": [
{
"object": {
"id": "1"
},
"values": [
"111",
"reg text",
"11"
]
}
]
and here are the code:
.writeStartObject()
.writeStartArray("rows")
.writeStartObject() //here i can`t name the object
.write("id", "'1'@1000")
.writeEnd()
.writeStartArray() //here i can`t name the array
.write("fax")
.write("646 555-4567")
.writeEnd()
.writeEnd()
.writeEnd();
When i tried to add object & array headers inside the brackets, i got an exception "Illegal method during JSON generation, not valid in current context IN_ARRAY". How to generate JSON like mine?