1
0
mirror of https://github.com/beego/bee.git synced 2025-05-13 02:51:25 +00:00

g_docs.go

swaggergen support field comment if not defined description tag
This commit is contained in:
RuanSong 2021-04-02 18:28:51 +08:00 committed by GitHub
parent cbb523325d
commit fc19d2bb51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1187,6 +1187,8 @@ func parseStruct(imports []*ast.ImportSpec, st *ast.StructType, k string, m *swa
}
if desc := stag.Get("description"); desc != "" {
mp.Description = desc
}else{
mp.Description = field.Comment.Text()
}
if example := stag.Get("example"); example != "" && !isObject && !isSlice {