I am doing some very simple script mediation as a test to see if I can change the payload being returned by my server.
My unmediated payload comes out as:
Just in case someone has the same issue, I managed to get mine working.
I had to do a workaround method:
property name="JSONPayload" expression="json-eval($.)"
var pl_string = mc.getProperty("JSONPayload");
var pl = JSON.parse(pl_string);
getPayloadJSON().I know it's a hacked together method, but none of the other ways were working for me so I tried this one.
Some information in case anyone wants to debug it:
I'm using API Manager 1.7.
I set the message builders and formatters to these: Builder class = "org.apache.synapse.commons.json.JsonStreamBuilder" Formatter class = "org.apache.synapse.commons.json.JsonStreamFormatter"