From 36d86d924a1f971fa2be565024386147de6eb606 Mon Sep 17 00:00:00 2001 From: kenny Date: Mon, 19 Dec 2016 20:05:03 +0800 Subject: [PATCH] fix the bug that fail to generate swagger doc's summary --- g_docs.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/g_docs.go b/g_docs.go index bff0d5e..7e6646c 100644 --- a/g_docs.go +++ b/g_docs.go @@ -455,11 +455,11 @@ func parserComments(comments *ast.CommentGroup, funcName, controllerName, pkgpat HTTPMethod = "GET" } } else if strings.HasPrefix(t, "@Title") { - opts.OperationID = controllerName + "." + strings.TrimSpace(t[len("@Title"):]) + title := strings.TrimSpace(t[len("@Title"):]) + opts.OperationID = controllerName + "." + title + opts.Summary = title } else if strings.HasPrefix(t, "@Description") { opts.Description = strings.TrimSpace(t[len("@Description"):]) - } else if strings.HasPrefix(t, "@Summary") { - opts.Summary = strings.TrimSpace(t[len("@Summary"):]) } else if strings.HasPrefix(t, "@Success") { ss := strings.TrimSpace(t[len("@Success"):]) rs := swagger.Response{}