I want to extract Json array from json payload and build an xml request with the same number of blocks as json array contains. How to do that?
first, use the extract variable policy to get the json array and next on the same use json to xml policy to get the xml presentation.
You can extract either all of the JSON payload or some jsonpath derived subset into a flow variable using the ExtractVariables policy.
https://docs.apigee.com/api-platform/reference/policies/extract-variables-policy
Use a JSON online parser if you want to work on your jsonpath expression
The JSONtoXML policy converts any JSON, either the entire JSON payload or the result of the jsonpath expression to XML
https://docs.apigee.com/api-platform/reference/policies/json-xml-policy
There are handful of options if you need to transform the JSON considerably before converting it to XML. One of my favorite ways of manipulating JSON is here
Can you give a specific example?
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |