Return custom JSON response using Workflow and API Gateway

Hi,
I start by defining my need. Currently, i created an API gateway to execute a workflow.
I setup the gateway as followings:
Admin Area > Integration Gateway > Filter List > Postfiltering > Add filter > JSON response
I arrived to that perfectly :grin:. However, the gap is to return the JSON response. It’s always an empty JSON i.e., {} :roll_eyes:.
Consequently, i did some research to understand the cause of the problem, leading me to the file in

pkg/apigw/filter/postfilter.go

exactly in Merge function. Besides all that i went to apigw table in params column. where i just removed input attribute from params value. For instance:

{"input":"{\"target\":\"data\", \"expr\":\"data\"}"}

became

{\"target\":\"data\", \"expr\":\"data\"}

As a result the gateway returns me the response now :star_struck:

My questions are:
Is my configuration valid? and there is a bug or i just misconfigured my postfilter for JSON response? if yes, how to do it correctly?
Thanks

1 Like