I need to have SwaggerUI that expose the routes that I have mapped on the KONG Api gateway. I am not sure if kong community version have the swagger plugin where it can auto generate schema?
I were trying to search to see if there is any plugin availble to export swagger, but it doesn't seem to be supported.
I totally get why you'd want a nice Swagger UI for your Kong API Gateway. Having interactive docs makes it way easier for developers to understand and test your APIs.
The good news is that while Kong doesn't have a built-in Swagger UI, you can actually roll your own with a bit of work.
Specifically, Kong's `/routes endpoint returns a list of all the configured routes. Each route includes the ID of the connected service.
You can then take those service IDs and make requests to /services/ to get more info on each individual service, like the URL it proxies to.
So the full workflow would be:
/routesto get all routes/services/<service-id>using each IDThe key is Kong's Admin API. This lets you pull all the details about your APIs, routes, services, etc. So you can use it to get the data you need to generate a Swagger spec - basically a JSON file that describes your API endpoints.
Once you have the spec, you can plug it into Swagger UI, which is an open source tool that turns those specs into great looking docs. You'll just need to host Swagger UI somewhere like a basic web server.
When a dev loads up your Swagger UI site, it'll read that spec and automatically generate the interactive documentation.