Is there any possibilty to add multiple API proxies in one Spec file?

sravanig231
Participant III

Hello team,

Is there any possibility to add multiple API proxies in one Specification file??Actually I created three API proxies and I want publish those API's in one product by defining single specification file. Is it possible or not.

Please help me out.

Thanks for your support.

Solved Solved
0 1 528
1 ACCEPTED SOLUTION

siddheshnaik
Participant II

Ideally, there should be single Swagger openapi spec for each proxy. We can not have single swagger for multiple proxies.

But Sometimes as per the requirement, we tend to break a single complex API proxy into multiple API proxies.
So If you have a common part of the base path in all above-connected API proxies, then we can club them single Swagger.

E.g.
API proxy 1:
Base Path: /basepath/proxy1

Resource path: /resource1

API proxy 2:
Base Path: /basepath/proxy2

Resource path: /resource2

So you can merge these API proxies in single swagger like:

basePath: /basepath

......
paths:

/proxy1/resource1:

...
/proxy2/resource2:

API calls happening from the Swagger spec are executed as per API proxy logic. So while calling path /basepath/proxy1/resource1, At API proxy resource will be /resource1 and the base path will be /basepath/proxy1.

Hope this helps.

View solution in original post

1 REPLY 1

siddheshnaik
Participant II

Ideally, there should be single Swagger openapi spec for each proxy. We can not have single swagger for multiple proxies.

But Sometimes as per the requirement, we tend to break a single complex API proxy into multiple API proxies.
So If you have a common part of the base path in all above-connected API proxies, then we can club them single Swagger.

E.g.
API proxy 1:
Base Path: /basepath/proxy1

Resource path: /resource1

API proxy 2:
Base Path: /basepath/proxy2

Resource path: /resource2

So you can merge these API proxies in single swagger like:

basePath: /basepath

......
paths:

/proxy1/resource1:

...
/proxy2/resource2:

API calls happening from the Swagger spec are executed as per API proxy logic. So while calling path /basepath/proxy1/resource1, At API proxy resource will be /resource1 and the base path will be /basepath/proxy1.

Hope this helps.