From 7e605092312175f0c6946236ba72772d53bd9059 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Thu, 25 Aug 2016 19:32:39 +0300 Subject: [PATCH] Separate and add @Description with @Summary params @Description -> is "descriptions" in swagger @Summary -> is "summary" in swagger this different options. --- g_docs.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/g_docs.go b/g_docs.go index 6c1e870..66cd973 100644 --- a/g_docs.go +++ b/g_docs.go @@ -354,7 +354,9 @@ func parserComments(comments *ast.CommentGroup, funcName, controllerName, pkgpat } else if strings.HasPrefix(t, "@Title") { opts.OperationID = controllerName + "." + strings.TrimSpace(t[len("@Title"):]) } else if strings.HasPrefix(t, "@Description") { - opts.Summary = strings.TrimSpace(t[len("@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{}