I’m trying to convert a XML payload to a JSON payload in my request flow, but even though in trace I can see that it goes through the policy, it doesn’t convert the payload.
The call:
curl -X POST \
[https://{{url}}](https://{{url}}) \
-H 'apikey: j7VTDGijDuhyDiFrqy1qjSfvO9NJldHG' \
-H 'authorization: Bearer CVfw1Ahm02OATzDdR9D3Agjk5eGR' \
-H 'cache-control: no-cache' \
-H 'content-type: application/xml' \
-H 'postman-token: 0981c824-5900-99df-e403-5ba8c861ad60' \
-d '<agreement_id>
9740
</agreement_id>'
My Policy:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XMLToJSON async="false" continueOnError="false" enabled="true" name="xml-to-json">
<DisplayName>xml to json</DisplayName>
<Properties/>
<Format>yahoo</Format>
<OutputVariable>request</OutputVariable>
<Source>request</Source>
</XMLToJSON>
I send the following XML:
<agreement_id>
{{agreement_id}}
</agreement_id>
And I expect it to be converted to:
{
"agreementId": {{agreement_id}}
}