Apigee XMLtoJson policy TreatAsArray returning [ null ] instead of null value when no data.

So I have this field that can either be null or an array with one or multiple objects, when there's data it works as expected, however when there's no data or it's supposed to be null I get the following format:

	 "MyField": [
 null
 ],

Is there a way I can set this to just null instead of null inside brackets?

Thank you!

0 2 123
2 REPLIES 2

Not applicable

You can use javascript or java callout to do the same.

From what you describe, I would think the desired return array would be empty. But ... let's look a little closer.

Give me more details, please, with the specific policy configuration you used, and the specific inbound XML. Thanks.