after transition from xml to json Syntax array missing Follw attach.
Yes, that is the case in a raw transformation it is not possible to determine that a single xml element is expected to be an array when transformed to json. So simple transform can only transfer a single element as child json element not as an array.
There is an idea/enhancement request for the xml -> json transformation to use a json schema, to then be able to tell which resulting json elements should be an array:
For a simple case where there is only one such element that needs to be an array, it might be possible to write some assertion code with regex and xml path replace/delete to force one element to be an array. But the more complex case with many elements (perhaps identified by the "size" element in the xml structure it is not a realistic option.
An alternative perhaps simpler "Idea" to the one above would be to suggest the current assertion have an extra parameter that allows specification of list of JSON paths to be passed into the xml->json transformation assertion, and where matched they would generate a list even if only one element (and maybe option as well for when no elements are found).
Other than that currently would need a custom assertion (written in java) - or change of the code accepting the JSON result to be to handle single result as well as array result.
Cheers - Mark
If only has one node/element in the payload, how can I tell it's an array, or just a normal node.
if array size = 1 ,how to you tell the element is array?
Retrieving data ...