AnsweredAssumed Answered

Dynamic HTTP Route Assertion in Same Service

Question asked by siddharth-b on Oct 11, 2017
Latest reply on Oct 11, 2017 by Stephen_Hughes

Hi guys I am working on API Gateway 9.1

I have some queries regarding dynamic http route calls within same service..

 

I am making an HTTP call and getting JSON as response. I then use Evaluate JSON Path Expression Assertion & extract required zoo field.

Call 1 - https://abc.foo.com/getJson

Call 1 Response -

{

"zoo":"test2"

}

 

For example lets say the extracted json pre-fix variable is extractedZOO

 

Call 2 - https://abc.foo.com/${extractedZOO.result}

In one scenario I make a call 2 as above & I get the response

 

Till now everything works fine.

 

Now...In some cases the Call 1 Response will be like this(multiple ZOO fields) 2 or more than 2,

{

"zoo":"test2",

"zoo":"test3"

}

 

In this case I can use * (star)  in Evaluate JSON Path Expression Assertion to extract both values.

So now I need to make two HTTP Route for Call 2.

 

Can we dynamically make HTTP route assertions within a service, based on the Call 1 Response?

Ex: If I get 7 zoo fields in Call 1 Response, the service should make 7 Http Route Calls dynamically.by appending the extracted values in each call.

 

Can this be achieved?

 

Thanks

Outcomes