Reputation: 71
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.
I found the following in the gateway (Carbon) under resources. Are you able to guide me with a documentation of implementing this please.
Thanks in advance.
Upvotes: 0
Views: 504
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