[#13936] - Json metadata exporter is unable to handle arrays of objects containing objects

Category:
Bug report
Priority:
Normal
Status:
New
Project: Severity:
Major
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:
0

There is a working minimal example attached.

Using this data:

firstName,lastName
john, carter
mary, ann
jack, thomas

this schema:
{
_type: 'array',
_children: {
_type: 'object',
firstName: 'value',
lastName: 'value'
}
}

and these paths in the text fields:
<property name="net.sf.jasperreports.export.json.path" value="firstName"/>
<property name="net.sf.jasperreports.export.json.path" value="lastName"/>

I get this correct output:
[
{
"firstName": "john",
"lastName": "carter"
},
{
"firstName": "mary",
"lastName": "ann"
},
{
"firstName": "jack",
"lastName": "thomas"
}
]

But, using the same data, with this schema (object inside object inside array):
{
_type: 'array',
_children: {
_type: 'object',
person: {
_type: 'object',
firstName: 'value',
lastName: 'value'
}
}
}

and these paths in the text fields:
<property name="net.sf.jasperreports.export.json.path" value="person.firstName"/>
<property name="net.sf.jasperreports.export.json.path" value="person.lastName"/>

I get this wrong Json output:
[
{"person":
{
"firstName": "john",
"lastName":"carter"
},
{
"firstName":"mary",
"lastName":"ann"
},
{
"firstName":"jack",
"lastName":"thomas"
}
}
]

AttachmentSize
Package icon minimal working example of the bug.2.93 KB
v6.14.0
JSON Metadata Exporter
gustavofarias's picture
Joined: May 22 2012 - 7:10am
Last seen: 1 week 3 days ago
Feedback
randomness