Routing Policy


I have an REST API to be exposed on gateway. It consists of 4 resources and each will support GET , POST and PUT methods.
I have used swagger first approach and created REST descriptors using swagger definition. I see there are 4 REST descriptors created , there by having a separate invocation path for each resource.

I want to create a Single API on for all resources on API gateway. if that’s possible , i am wondering which routing policy to use so that appropriate resource gets invoked. I was looking at content and context based routing policies will help in this case and if its right way to do it.

Appreciate if someone can throw light on it.

Hi Shahed,
I am assuming you have 4 independent resources for which you are creating a API. If they are independent resources, the best possible option in REST is to have separate invocation path for each of them. This can be routed to the back end using straight through routing, if backend services are designed the same way.
However, if you are dealing with sub-resources, then you can create a single API with one invocation path and manage the routing to backend using routing policies - content, context or custom http header.