I have added response body transformation for my sample API with a mock Body Transformation. My template transforms input JSON to XML format as output.
But when i hit the API , i still see un-transformed output without the template being applied. Please assist on the same.
Template Used:
{{.userid}}
{{.item1}}
{{.item2}}
{{.item3}}
Actual Mock Response:
{
“userid”: 1,
“item1”: “Welcome User1”,
“item2”: “You have 5 unread messages”,
“item3”: “You have 2 friend requests”
}
Could it be because of having a mock response for the API ?
I am using Dashboard and applied this transform on corresponding template container and updated API. Tests work for sample inputs. Somehow, it doesnt seem to reflect on my response.
Hang on, so this is a transform on top of a mock? If so, this won’t work, mocks are evaluated before response processors, they reply directly not via the response processing middleware - you will need to use a real proxied endpoint to get that to work.