My Apache processor setup is HandleHttpRequest
-> InvokeHTTP
->HandleHttpResponse
.
I’m hitting an API from Postman which invokes another API and gets the JSON data and returns.
Now in between InvokeHTTP
-> HandleHttpResponse
, I’m trying to add another processor which modifies data before returning a response.
My JSON is from InvokeHTTP
{
"id": 1,
"menuTempId": 28,
"conceptId": 252,
"menuId": 1,
"currency": "SAR",
"language": "En",
"updatedAt": 1695114353000,
"countryId": "SA",
"version": "v1"
}
I want to modify it to look like this:
{
"id": 1,
"currency": "SAR",
"language": "En",
"countryId": "SA",
"version": "v1"
}
I want to remove a few keys from JSON data. I have tried using UpdateAttribute
-> JoltTransformJSON
, but it’s not working.
Can you help me understand from which processor and configuration I can achieve this scenario.
2
Answers
this jolt definition should work for you:
Only adding a JoltTransformJSON processor along with the following specification
is enough.
Where the pipe operators are used similar to they’re(or double pipes are) used in some well-known programming languages as OR operators and the ampersand stands for replicating the values of those keys.