Best Practice - Swagger Import or Manual creation of Proxies ??

rk-muvva
Participant II

What is the best practice to create proxies in Apigee ? We have a swagger from our application that we can import however there will be lot of revisions to the swagger as the application is being incrementally developed. Is it better to create proxies manually rather than using the "Import from Swagger" option in Apigee ?

0 3 137
3 REPLIES 3

@Ravi M

The best practice is to use the swagger as per the API Design first approach to have a better consumer experience.

Can you be specific on the swagger changes.

1. If the swagger changes are related to the request/response models, it will not affect your API proxy.

However if the changes are w.r.t the routes or resources, the API proxy will need to be modified accordingly.

2. Do you have any customizations in your API proxy w.r.t each of the conditional flows created from the swagger?

If yes, it's better to do a one time swagger import to create the API proxy, manually add the customizations and modify the API proxy based on the swagger changes.

If you do not have any customizations it is better to import the swagger and create the proxy.

Have you checked the apigee swagger utility https://github.com/bharathkumarkn/Swagger-Utility

This is a executable jar utility, but you can customize it to read a preset configuration, package it and add it to your pipeline to build and deploy the proxy.

Thank You @Nagashree B , Our API back end is being built and we have let us say may be 5-6 API operations in the initial swagger that need Apigee Proxies. We plan to add more and make them available. If we import the initial version of swagger, how difficult is it to incorporate the new additions. Also we plan to add some shared flows and authorization etc.. though most of them could apply to all operations. My take is that we build proxies manually, add customized flows (shared flows) instead of relying on Swagger import. Is that the right approach ? Thanks again for taking time to answer the query.

@Ravi M,

As I understand, you require some agility in your API proxy. In an ideal process, the swagger should be able to capture all the api routes up front and the proxy can provide mock responses until the backend is ready.

For your question on the complexity to add new routes or resources, it's not that hard. When you import the swagger and build the proxy, each resource in the swagger will be created as a conditional flows. Essentially, you can manually add these conditional flows for the new routes at a later point in time.

Unless you have custom logic/ policies included for each conditional flows, I feel using the swagger is a clean way to generate the API proxy