I want to use the response-transformer plugin to add a bit of slightly more complex JSON than just "foo" : “bar” to a response. Specifically, I want to be able to add the following:
"servers": [
{
"url": "/route"
}
],
I suspected it wouldn’t work, but tried this:
curl -X POST http://localhost:8001/services/myapi/plugins --data "name=response-transformer" --data "config.add.json=servers:[{url:/route}]"
Sure enough, everything after the colon was treated as a string to be set as the value for “servers”:
"servers": "[{url:/route}]",
Is this even doable with this plugin?