I need to build the following json using groovy's JsonBuilder().
[
{
"date": "2017-12-08",
"dog": [
{
"name": "Joe",
"age": "1"
},
{
"name": "Bro",
"age": "2"
},
{
"name": "Doe",
"age": "3"
}
]
}
]
I cant get the array in the array, because of the date, it wants to always to put date not in the same level as dog array, but put it in { }, like:
[{
{
"date": "2017-12-08",
},
"dog": [
{
"name": "Joe",
"age": "1"
},
{
"name": "Bro",
"age": "2"
},
{
"name": "Doe",
"age": "3"
}
]
}
]