kiran
kiran

Reputation: 71

WSO2 APIM URL pattern mediation script

I am using WSO2 APIM v2.0.0 and working through a POC.

I managed to understand and use message mediation policies on in/out/fault flows. This mediation policy applies to the entire API.

But I would like to use a mediation script for various URL pattern defined under the same API. enter image description here

I found the following in the gateway (Carbon) under resources. Are you able to guide me with a documentation of implementing this please. enter image description here

Thanks in advance.

Upvotes: 0

Views: 504

Answers (1)

Bee
Bee

Reputation: 12512

You can't engage mediation sequences per URL pattern. But you can for in sequence and out sequence separately.

In your case, you can read request path within a mediation sequence like below and implement your logic depending on that.

<property name="ApiName" scope="transport" expression="$ctx:REST_SUB_REQUEST_PATH"/> 

For more details, read this blog post.

Upvotes: 3

Related Questions