I am having an isssue splitting the JSON for an object. I am initially reading an xml and then using XML parser to convert that to JSON document output.
I will try to explain the issue with example. Please note that the input is an xml file. It can have one or more than more DetailRecords as per the different xmls below.
Splitter logic is Json Path field set to - $Root.DetailRecord[*]
XML 1< HEADER> DEFAULT AUD Tanya F David M
XML 2< HEADER> DEFAULT AUD Tanya F
• When there are multiple records (Refer XML 1) : Splitter split both the records (DetailRecord) as expected and provide a flat structure with input schema Name and Gender.
• When there is 1 record (Refer XML 2) : Splitter behaves differently. It split the values rather than records and provide values Tanya, F under column splitvalue. So, the logic to transform the data breaks.
My aim is that, whether it is one sub record or more, it should detect that its an object and split it however here if its more then one then it converts it to object and if its one then it leaves that as string and thus I cannot dynamically change whether to use splitter or not and the pipeline fails it I use splitter and it has one record only.