diff --git a/middleware/context.go b/middleware/context.go index ecff9e3d..f53ddd3e 100644 --- a/middleware/context.go +++ b/middleware/context.go @@ -307,6 +307,9 @@ type contentTypeValue struct { // BasePath returns the base path for this API func (c *Context) BasePath() string { + if c.spec != nil { + return "" + } return c.spec.BasePath() }