AnsweredAssumed Answered

Dynamic JSON Response

Question asked by siddharth-b on Oct 23, 2017
Latest reply on Nov 7, 2017 by siddharth-b

Hi guys I am using API Gateway 9.1 & I making multiple API calls from one Service. I need to mash up the response & send one JSON response. I can do that with Return Template Response to Executor Assertion.

 

Ex- I make two API calls & each call gives different responses,

Response of API Call1 :

{

"data":"1"

}

 

Response of API Call2 :

{

"data":"2"

}

So I can use Evalute JSON Assertion extract & form a response using Return Template Response to Executor Assertion.

 

But sometimes the Response of API Call2 can contain multiple fileds which needs to be updated in final response,

Sometimes Response of API Call2 :

{

"data":"2",

"data":"3",

"data":"4"

}

 

In this case how can I dynamically add the new fields to my response dynamically?

 

Thanks

Outcomes