diff --git a/generate/swaggergen/g_docs.go b/generate/swaggergen/g_docs.go index 2f4cb9a..112b574 100644 --- a/generate/swaggergen/g_docs.go +++ b/generate/swaggergen/g_docs.go @@ -640,7 +640,17 @@ func parserComments(comments *ast.CommentGroup, funcName, controllerName, pkgpat opts.Produces = append(opts.Produces, ahtml) } } + } else if strings.HasPrefix(t, "@Security") { + if len(opts.Security) == 0 { + opts.Security = make([]map[string]swagger.Security, 0) + } + fullString := strings.TrimSpace(t[len("@Security"):]) + e := strings.SplitN(fullString, " ", 4) + newMap := make(map[string]swagger.Security) + newMap[e[0]] = swagger.Security{} + opts.Security = append(opts.Security, newMap) } + } } if routerPath != "" {