1
0
mirror of https://github.com/beego/bee.git synced 2024-12-22 10:00:50 +00:00

Generate multipart/form-data consumer for API doc

This commit is contained in:
Hamid FzM 2017-08-16 14:47:07 +04:30 committed by GitHub
parent aae0cc4587
commit cdec05b5e3

View File

@ -44,6 +44,7 @@ const (
axml = "application/xml"
aplain = "text/plain"
ahtml = "text/html"
aform = "multipart/form-data"
)
var pkgCache map[string]struct{} //pkg:controller:function:comments comments: key:value
@ -675,6 +676,8 @@ func parserComments(f *ast.FuncDecl, controllerName, pkgpath string) error {
case "html":
opts.Consumes = append(opts.Consumes, ahtml)
opts.Produces = append(opts.Produces, ahtml)
case "form":
opts.Consumes = append(opts.Consumes, aform)
}
}
} else if strings.HasPrefix(t, "@Security") {