📚 go-swagger-ui - Awesome Go Library for Third-party APIs

Go Gopher mascot for go-swagger-ui

Go library containing precompiled [Swagger UI](https://swagger.io/tools/swagger-ui/) for serving swagger json

🏷️ Third-party APIs
📂 Third-party APIs
0 stars
View on GitHub 🔗

Detailed Description of go-swagger-ui

go-swagger-ui

Documentation Go Report Card test MIT License

This repo provides go handlers for serving swagger.json and the Swagger UI.

Commonly used with grpc-gateway compiled swagger.

Usage

import (
	"github.com/esurdam/go-swagger-ui"
)

// Asset represents a AssetFn - compiled bindata swagger file
mux := swaggerui.NewServeMux(Asset, "swagger.json") // add swagger bindata asset

// /swagger.json serves json
// /swagger-ui serves the swagger-ui

With custom root:

import (
	"github.com/esurdam/go-swagger-ui"
)

// Asset represents a AssetFn - compiled bindata swagger file
mux := swaggerui.NewServeMuxWithRoot(Asset, "swagger.json", "/v1/auth") // add swagger bindata asset

// v1/auth/swagger.json serves json
// v1/auth/swagger-ui serves the swagger-ui

Updating UI

swagger directory contains auto-generated output.

  1. Add updated assets to //third_party/swagger-ui
  2. Run make build which will compile swagger into swagger/bindata.go