Automatically import REST APIs from GitHub / via API into API Manager?

147 Views Asked by At

Does the API Manager / Bluemix provide an interface (API, hook) to automatically update API definitions when I push Swagger 2.0 API definition changes to a GitHub repository?

1

There are 1 best solutions below

1
On BEST ANSWER

This is currently not possible. Your best bet is to manually re-import the Swagger using the GitHub raw URL every time you update it; however, doing this will require that you create a new API via the import, remove the old API, and then add the new to the same plan and re-deploy.

You can manually update by clicking the Update button in the API editor. It looks like this: Re-upload swagger button

Using this feature will automatically overwrite all changes you've manually made to the API, so it's recommended that you create a new API revision before uploading an updated Swagger doc.

If you plan to make manual changes to your API via the API Manager UI, then you may be better off making small updates by hand.

If you really need an automated approach, you may be able to write your own app / script that gets called any time the Swagger is updated in GitHub, and then can call the API Manager APIs to update the Swagger. This will likely be pretty complicated to set up.