return policies errors as xml

Dear Apigee members

is there a way to return policies errors as xml not as json, it's by default return as json.

0 3 150
3 REPLIES 3

Probably you could use a DefaultFaultRule to run a JSONToXML policy.

Check the docs.

https://docs.apigee.com/api-platform/fundamentals/fault-handling#creatingfaultrules-creatingadefault...

thanks Dino 🙂 , I'll check this solution

Not applicable

You can set the continue on error to true in the policy and add raise fault policy with the condition of the policy fail to true. In raise fault policy you can set the custom payload with content type of application/xml

The other option is what @dino has suggested.