Hi,
I have a requirement to render a array of elements in a json template.
{
"userDetails":{
"name" : "{{name}}",
"age" : "{{age}}",
"address":[
{{#address}}
{
"street": "{{street}}",
"mobile": "{{mobile}}",
},
{{/address}}
]
}
}
Which gives the below output which is a invalid json.
{
"userDetails":{
"name" : "Raj",
"age" : "",
"address":[
{
"street": "SS",
"mobile": "8888888888888",
},
{
"street": "SS",
"mobile": "999999999999",
}, (The template needs to be generate without appending comma in the last element of an array)
]
}
}
Can you help me on this. Thanks in advance.