From 546f2f1146e1c8288dec54d644dd0cd86f1c0c28 Mon Sep 17 00:00:00 2001 From: Benson Yan Date: Sun, 25 Sep 2022 22:04:25 +0800 Subject: [PATCH] fix prefix not start with / --- generate/parser.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generate/parser.go b/generate/parser.go index 61066f8..478ff34 100644 --- a/generate/parser.go +++ b/generate/parser.go @@ -99,8 +99,10 @@ func applyGenerate(p *plugin.Plugin, host string, basePath string) (*swaggerObje func renderServiceRoutes(service spec.Service, groups []spec.Group, paths swaggerPathsObject, requestResponseRefs refMap) { for _, group := range groups { for _, route := range group.Routes { - path := group.GetAnnotation("prefix") + route.Path + if path[0] != '/' { + path = "/" + path + } parameters := swaggerParametersObject{} if countParams(path) > 0 {