Skip to content

Go

go get github.com/rapi-doc/rapidoc-go
import rapidoc "github.com/rapi-doc/rapidoc-go"
mux := http.NewServeMux()
docs := rapidoc.Handler(rapidoc.Options{
SpecURL: "/openapi.json",
Attributes: map[string]any{"render-style": "focused"},
})
mux.Handle("/docs", docs)
mux.Handle("/docs/", docs)

The reference is at /docs. It is a plain net/http handler with no dependencies, so it also mounts on chi, Gin, Echo and Fiber, and next to Huma, whose /openapi.json it can read; the README has each of them. It does not generate the OpenAPI document: point SpecURL at the one your app serves, or pass the JSON as Spec. Needs Go 1.22 or later.