README ¶ Update Swagger UI Download the latest Swagger UI dist from the official GitHub Releases page. Copy and overwrite the dist folder in swagger-ui module. Replace the url inside the swagger-initializer.js file by ./swagger_spec. Usage //go:embed api.yaml var apiSpec []byte func main() { http.Handle("/swagger-ui/", http.StripPrefix("/swagger-ui", swaggerui.Handler(apiSpec))) log.Fatal(http.ListenAndServe(":8080", nil)) } Reference https://medium.com/@ribice/serve-swaggerui-within-your-golang-application-5486748a5ed4 https://github.com/flowchartsman/swaggerui Expand ▾ Collapse ▴ Documentation ¶ Index ¶ func Handler(spec []byte) http.Handler Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Handler ¶ func Handler(spec []byte) http.Handler Handler returns a handler that will serve a self-hosted Swagger UI with given spec Types ¶ This section is empty. Source Files ¶ View all Source files swagger_ui.go Click to show internal directories. Click to hide internal directories.