From fd7742863d1bcd788d179a2cea1aa4bab559f139 Mon Sep 17 00:00:00 2001 From: astaxie Date: Wed, 17 Aug 2016 08:02:21 +0800 Subject: [PATCH] urlReplace all the paths --- g_docs.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/g_docs.go b/g_docs.go index 71be086..b8c06da 100644 --- a/g_docs.go +++ b/g_docs.go @@ -219,6 +219,7 @@ func analisysNSInclude(baseurl string, ce *ast.CallExpr) string { if len(rootapi.Paths) == 0 { rootapi.Paths = make(map[string]*swagger.Item) } + rt = urlReplace(rt) rootapi.Paths[rt] = item } } @@ -338,7 +339,7 @@ func parserComments(comments *ast.CommentGroup, funcName, controllerName, pkgpat if len(e1) < 1 { return errors.New("you should has router infomation") } - routerPath = urlReplace(e1[0]) + routerPath = e1[0] if len(e1) == 2 && e1[1] != "" { e1 = strings.SplitN(e1[1], " ", 2) HTTPMethod = strings.ToUpper(strings.Trim(e1[0], "[]"))