Merge pull request #122 from simpleton/bug/docs

make docs works when EnableDocs = false
This commit is contained in:
astaxie 2015-07-02 21:37:19 +08:00
commit f74078b69f
1 changed files with 17 additions and 15 deletions

View File

@ -55,6 +55,7 @@ var rootapi swagger.ResourceListing
var apilist map[string]*swagger.ApiDeclaration
func init() {
if beego.EnableDocs {
err := json.Unmarshal([]byte(Rootinfo), &rootapi)
if err != nil {
beego.Error(err)
@ -72,6 +73,7 @@ func init() {
v.BasePath = BasePath
beego.GlobalDocApi[strings.Trim(k, "/")] = v
}
}
}