Blob Blame History Raw
// Handler creates http.Handler with routing matching OpenAPI spec.
func Handler(si ServerInterface) http.Handler {
  return HandlerFromMux(si, chi.NewRouter())
}

// HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler {
{{if .}}wrapper := ServerInterfaceWrapper{
        Handler: si,
    }
{{end}}
{{range .}}r.Group(func(r chi.Router) {
  r.{{.Method | lower | title }}("{{.Path | swaggerUriToChiUri}}", wrapper.{{.OperationId}})
})
{{end}}
  return r
}