From 0970c25bb921dec34c01b3b5f68724c5878371eb Mon Sep 17 00:00:00 2001 From: Artem Seleznev Date: Thu, 21 Aug 2025 11:40:20 +0300 Subject: [PATCH 1/2] Update context.go Signed-off-by: Artem Seleznev --- middleware/context.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/middleware/context.go b/middleware/context.go index 87c6ea38..a67a340c 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() } From 7cf6bcd94ef19d10969a4a78c70ca8d7321e2e86 Mon Sep 17 00:00:00 2001 From: Frederic BIDON Date: Wed, 10 Sep 2025 22:17:17 +0200 Subject: [PATCH 2/2] fixed the nil check Signed-off-by: Frederic BIDON --- middleware/context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/context.go b/middleware/context.go index a67a340c..f2cade3c 100644 --- a/middleware/context.go +++ b/middleware/context.go @@ -307,7 +307,7 @@ type contentTypeValue struct { // BasePath returns the base path for this API func (c *Context) BasePath() string { - if c.spec != nil { + if c.spec == nil { return "" } return c.spec.BasePath()