RushikeshMarkad16 / swaggo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

swaggo

Swaggo autogenerates the api documentation from annotations from code

Installation :

go install github.com/swaggo/swag/cmd/swag@latest

go get -u github.com/swaggo/swag/cmd/swag
go get -u github.com/swaggo/http-swagger
go get -u github.com/alecthomas/template (optional) //only required to generate docs.go

Generate docs:

swag init : generates go,yaml,json files
Swag init -g : if annotations are not in main
swag init --outputTypes go,yaml : to generate specific files (here only go and yaml files will be generated)

Run the server and you can see docs at http://localhost:8080/swagger/index.html#/ (change port no accordingly)
OR
Copy paste the contents of generated docs/swagger.json file in https://editor.swagger.io/

Documentation:

You can explore more about swaggo at https://github.com/swaggo/swag

About


Languages

Language:Go 99.4%Language:Makefile 0.6%