I'm trying to implement go-swagger but this error keep flashing. I'm using windows machine. I appreciate any help.
My implementation:
opts := middleware.RedocOpts{RedocURL: "/swagger.yaml"}
sh := middleware.Redoc(opts, nil)
getRouter.Handle("/docs", sh)
getRouter.Handle("/swagger.yaml", http.FileServer(http.Dir("./")))
My swagger definition:
// Package classification of Product API.
//
// Documentation for Product API
// Schemes: http
// BasePath: /
// version: 1.0.0
//
// Consumes:
// - application/json
//
// Produces:
// - application/json
// swagger:meta
Error message:
CodePudding user response:
The option of Redoc must be
SpecURL
opts := middleware.RedocOpts{SpecURL: "/swagger.yaml"}
instead of RedocURL
opts := middleware.RedocOpts{RedocURL: "/swagger.yaml"}