mirror of
https://github.com/beego/bee.git
synced 2024-11-22 15:10:54 +00:00
Merge pull request #245 from tnextday/develop
Use first NewNamespace prefix as swagger `BasePath`
This commit is contained in:
commit
55fc8e535c
@ -108,8 +108,13 @@ func generateDocs(curpath string) {
|
|||||||
for _, l := range stmt.Rhs {
|
for _, l := range stmt.Rhs {
|
||||||
if v, ok := l.(*ast.CallExpr); ok {
|
if v, ok := l.(*ast.CallExpr); ok {
|
||||||
// analisys NewNamespace, it will return version and the subfunction
|
// analisys NewNamespace, it will return version and the subfunction
|
||||||
|
if selName := v.Fun.(*ast.SelectorExpr).Sel.String(); selName != "NewNamespace" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
version, params := analisysNewNamespace(v)
|
version, params := analisysNewNamespace(v)
|
||||||
|
if rootapi.BasePath == "" && version != "" {
|
||||||
rootapi.BasePath = version
|
rootapi.BasePath = version
|
||||||
|
}
|
||||||
for _, p := range params {
|
for _, p := range params {
|
||||||
switch pp := p.(type) {
|
switch pp := p.(type) {
|
||||||
case *ast.CallExpr:
|
case *ast.CallExpr:
|
||||||
|
Loading…
Reference in New Issue
Block a user