fix beego#2016

This commit is contained in:
astaxie 2016-08-17 23:48:38 +08:00
parent fd7742863d
commit 11571b4af2
1 changed files with 7 additions and 1 deletions

View File

@ -413,9 +413,15 @@ func parserComments(comments *ast.CommentGroup, funcName, controllerName, pkgpat
pp := strings.Split(p[2], ".")
typ := pp[len(pp)-1]
if len(pp) >= 2 {
cmpath, m, mod, realTypes := getModel(typ)
para.Schema = &swagger.Schema{
Ref: "#/definitions/" + typ,
Ref: "#/definitions/" + m,
}
if _, ok := modelsList[pkgpath+controllerName]; !ok {
modelsList[pkgpath+controllerName] = make(map[string]swagger.Schema, 0)
}
modelsList[pkgpath+controllerName][typ] = mod
appendModels(cmpath, pkgpath, controllerName, realTypes)
} else {
if typ == "string" || typ == "number" || typ == "integer" || typ == "boolean" ||
typ == "array" || typ == "file" {