beego-swagger
Beego wrapper to automatically serve RESTful API documentation, created with Swagger 2.0.
This is simple implementation based on original http swagger: https://github.com/swaggo/http-swagger,
changed a bit for Beego web framework.
Usage
Start using it
- Add comments to your API source code, See Declarative Comments Format.
- Download Swag for Go by using:
$ go get github.com/swaggo/swag/cmd/swag
- Run the Swag in your Go project root folder which contains
main.go
file, Swag will parse comments and generate required files(docs
folder and docs/doc.go
).
$ swag init
4.Download beego-swagger by using:
$ go get -u github.com/dbohachev/beego-swagger
And import following in your code:
import "github.com/dbohachev/beego-swagger" // beego-swagger middleware
See "example" folder for example "classic" Beego API application.