I have no time nor the will to learn swagger, so i wrote this. The aim is to have the least learning curve required to document my API with Swagger.
- Copy
base-template
folder into your API doc repository - Create
collection
definition yaml, file name must becollection.yaml
- Create
API
definition yaml, format your file name as the followingapi_*.yaml
- Within the repository, create a main go file that generates swagger output
package main
import (
swaggeneration "github.com/husentoding/swag-generation"
)
func main() {
builder := swaggeneration.Init("path to base-template", "path to collection.yaml and api_*.yaml")
builder.Generate("path to the swagger output")
}
- Run your main go file
base-template provided here is a very basic swagger implementation, feel free to update the base-template to your liking. Syntax is written in golang text/template format.
represent the config for your collections.
config documentation WIP
represent the config for one API.
config documentation WIP
- Installation and run through terminal