Fix required struct tag

This commit is contained in:
John 2019-05-27 08:02:30 +08:00
parent 6a86284cec
commit f694778078
1 changed files with 1 additions and 1 deletions

View File

@ -1168,7 +1168,7 @@ func parseStruct(st *ast.StructType, k string, m *swagger.Schema, realTypes *[]s
name = ts[0]
}
}
if required := stag.Get("required"); required != "" {
if required := stag.Get("required"); strings.EqualFold(required, "true") {
m.Required = append(m.Required, name)
}
if desc := stag.Get("description"); desc != "" {