mirror of
https://github.com/beego/bee.git
synced 2025-05-13 08:01:26 +00:00
support field comment if not defined description
swaggergen support field comment if not defined description tag
This commit is contained in:
parent
cbb523325d
commit
99a25a316a
@ -1187,6 +1187,8 @@ func parseStruct(imports []*ast.ImportSpec, st *ast.StructType, k string, m *swa
|
|||||||
}
|
}
|
||||||
if desc := stag.Get("description"); desc != "" {
|
if desc := stag.Get("description"); desc != "" {
|
||||||
mp.Description = desc
|
mp.Description = desc
|
||||||
|
} else {
|
||||||
|
mp.Description = strings.ReplaceAll(field.Comment.Text(), "\n", "")
|
||||||
}
|
}
|
||||||
|
|
||||||
if example := stag.Get("example"); example != "" && !isObject && !isSlice {
|
if example := stag.Get("example"); example != "" && !isObject && !isSlice {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user