We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
有时项目需要一些公共库给不同的项目使用, 如Models,但是如果这些公共库,不在当前项目的目录下时,生成文档时,会报Cannot find the object错误,生成的文档也找不到有关Models的说明。所以我对cmd\commands\generate\generate.go 文件里的GenerateCode方法做了处理。 代码示例: case "docs": f, err := os.Open(currpath + "\docs.conf") if err == nil { rd := bufio.NewReader(f) for { line, err := rd.ReadString('\n') line = strings.Trim(line, " \r\n") if len(line) > 0 { swaggergen.GenerateDocs(currpath + "\" + line) } if err != nil || err == io.EOF { break } } f.Close() } swaggergen.GenerateDocs(currpath) 这样处理后,只需在当前项目的根目录下加上docs.conf文件,在里面按行指定相对路径就可以生成Models的说明了。 docs.conf内容示例: ../xmodels ../xutils
The text was updated successfully, but these errors were encountered:
No branches or pull requests
有时项目需要一些公共库给不同的项目使用, 如Models,但是如果这些公共库,不在当前项目的目录下时,生成文档时,会报Cannot find the object错误,生成的文档也找不到有关Models的说明。所以我对cmd\commands\generate\generate.go 文件里的GenerateCode方法做了处理。
代码示例:
case "docs":
f, err := os.Open(currpath + "\docs.conf")
if err == nil {
rd := bufio.NewReader(f)
for {
line, err := rd.ReadString('\n')
line = strings.Trim(line, " \r\n")
if len(line) > 0 {
swaggergen.GenerateDocs(currpath + "\" + line)
}
if err != nil || err == io.EOF {
break
}
}
f.Close()
}
swaggergen.GenerateDocs(currpath)
这样处理后,只需在当前项目的根目录下加上docs.conf文件,在里面按行指定相对路径就可以生成Models的说明了。
docs.conf内容示例:
../xmodels
../xutils
The text was updated successfully, but these errors were encountered: