From 58b5572fa8fe08248b57a356a76c3a14312abedd Mon Sep 17 00:00:00 2001 From: Zhenhua Hu Date: Thu, 2 Nov 2023 13:24:43 +0800 Subject: [PATCH] add code --- swagger/swagger.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/swagger/swagger.go b/swagger/swagger.go index 829fa14d..7ea7dba1 100644 --- a/swagger/swagger.go +++ b/swagger/swagger.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" "path" + "path/filepath" "sort" "strings" @@ -73,7 +74,7 @@ func Load(swaggerPath string) ([]ApiPath, error) { if exampleRef == nil { continue } - exampleList = append(exampleList, path.Clean(path.Join(swaggerPath, "..", exampleRef.(string)))) + exampleList = append(exampleList, path.Clean(path.Join(filepath.ToSlash(swaggerPath), "..", exampleRef.(string)))) } } }