And the pkg is github.com/caicloud/nirvana/examples/openapi/api
Generate openapi_generated.go
go run ${GOPATH}/src/github.com/caicloud/nirvana/cmd/openapi-gen/main.go \
-i github.com/caicloud/nirvana/examples/openapi/pkg/api/v1 \
-p github.com/caicloud/nirvana/examples/openapi/api
Generate json file for swagger-ui server
go run main.go > swagger.json
You might need to embed code piece in main.go in your own project.
Check main.go for detail.
Serve your json file
python svr.py
Start your swagger-ui server
docker run -p 8080:8080 --rm swaggerapi/swagger-ui:v2.2.9
Go to http://127.0.0.1:8080/
Use http://127.0.0.1:8000/swagger.json instead of http://petstore.swagger.io/v2/swagger.json and Explore