mirror of
https://github.com/beego/bee.git
synced 2024-11-24 18:30:53 +00:00
Merge pull request #468 from hamidfzm/master
Generate multipart/form-data consumer for API doc
This commit is contained in:
commit
fbbb713465
@ -44,6 +44,7 @@ const (
|
|||||||
axml = "application/xml"
|
axml = "application/xml"
|
||||||
aplain = "text/plain"
|
aplain = "text/plain"
|
||||||
ahtml = "text/html"
|
ahtml = "text/html"
|
||||||
|
aform = "multipart/form-data"
|
||||||
)
|
)
|
||||||
|
|
||||||
var pkgCache map[string]struct{} //pkg:controller:function:comments comments: key:value
|
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":
|
case "html":
|
||||||
opts.Consumes = append(opts.Consumes, ahtml)
|
opts.Consumes = append(opts.Consumes, ahtml)
|
||||||
opts.Produces = append(opts.Produces, ahtml)
|
opts.Produces = append(opts.Produces, ahtml)
|
||||||
|
case "form":
|
||||||
|
opts.Consumes = append(opts.Consumes, aform)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if strings.HasPrefix(t, "@Security") {
|
} else if strings.HasPrefix(t, "@Security") {
|
||||||
|
Loading…
Reference in New Issue
Block a user