Layer7 API Management

  • 1.  Dynamic HTTP Route Assertion in Same Service

    Posted Oct 11, 2017 06:42 PM

    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



  • 2.  Re: Dynamic HTTP Route Assertion in Same Service
    Best Answer

    Broadcom Employee
    Posted Oct 11, 2017 07:00 PM

    Good afternoon,

     

    I would recommend that you use the run assertion for each item (Question with Run Assertions for Each Item Assertion ) that is a looping mechanism to act against a multiple part context variable.

     

    Sincerely,

     

    Stephen Hughes

    Director, CA Support