Reputation: 11966
I've searched internet but couldn't find a good solution. I'm looking for something that pretty specific - a golang copy of aiohttp_swagger
.
That is a Python package which does magical things. In the endpoint handler method, one write some comment code and it'll be automatically parsed and generates swagger documentation. When the server is up and running, a special URL /api/doc
handler will be inserted into the server where people can see it live.
I understand it's tied into the implementation of aiohttp
framework and the way Go is used, web framework is not as popular (not using one myself), but I still like that solution very much and would like to find something in the Go land.
So my question is a bit open I guess: is there an equivalent (or rough) of aiohttp_swagger
package in Go?
Upvotes: 1
Views: 1191
Reputation: 1179
go-swagger does it based on doc comments: https://goswagger.io/generate/spec.html
go-restful has a builder for creating swagger 2.0 documents: https://github.com/emicklei/go-restful-openapi
Upvotes: 1