square brackets not appearing in json array with one record

One Star

square brackets not appearing in json array with one record

Hi, I am using tWriteJsonField and have an array that has only one record. The output from talend does not put square brackets around the array, please see below example:
Required output:
{"employees":}

Talend output:
{"employees":
    {"firstName":"John""lastName":"Doe"}}

Would request help on this.
Seventeen Stars

Re: square brackets not appearing in json array with one record

The problem here is Talend does not handle JSON internally.They do everything with XML.
Take a look in the documentation. There is a way to get an array by adding an @array attribute in the mapping configuration.
The other solution could be you use components which are dedicated to JSON without the workaround XML.
https://exchange.talend.com/#marketplaceproductoverview:gallery=marketplace%252F1&pi=marketplace%252...