Skip to content

Commit

Permalink
Fixed apidoc index html bug
Browse files Browse the repository at this point in the history
  • Loading branch information
andeya committed Oct 9, 2017
1 parent aa2bef8 commit 0130327
Show file tree
Hide file tree
Showing 2 changed files with 201 additions and 188 deletions.
12 changes: 11 additions & 1 deletion apidoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,17 @@ func (s *swaggerFS) Open(name string) (http.File, error) {
}
b = bytes.Replace(b, []byte(`"/swagger.json"`), s.jsonPath, -1)
info, err := swagger.AssetInfo("swagger-ui/index.html")
return NewFile(b, info), err
if err != nil {
return nil, err
}
return NewFile(b, &FileInfo{
name: "apidoc/index.html",
size: int64(len(b)),
mode: info.Mode(),
modTime: info.ModTime(),
isDir: info.IsDir(),
sys: info.Sys(),
}), err
}
return f, err
}
Expand Down

0 comments on commit 0130327

Please sign in to comment.