Hello all,
I’m trying to use the XMLtoJSON policy where I’m facing difficulty converting an empty XML node to empty string or as JSON null
Input XML:
<Root>
<Code>A</Code>
<Desc/>
<Exm>A8SAI38</Exm>
</Root>
I’m using the XMLtoJSON policy with below options:
<Options>
<RecognizeNumber>true</RecognizeNumber>
<RecognizeBoolean>true</RecognizeBoolean>
<RecognizeNull>true</RecognizeNull>
<NullValue>NULL</NullValue>
<TextNodeName>TEXT</TextNodeName>
<StripLevels>1</StripLevels>
</Options>
Actual:
{
"Code": "A",
"Desc": "NULL",
"Exm": "A8SAI38"
}
Expected:
{
"Code": "A",
"Desc": null,
"Exm": "A8SAI38"
}
OR
{
"Code": "A",
"Desc": "",
"Exm": "A8SAI38"
}
How can I achieve this?
@dchiesa1 @sidd-harth @API-Evangelist