1
0
mirror of https://github.com/beego/bee.git synced 2024-12-21 13:40:48 +00:00

add json tag like json:"xxx,string" support

This commit is contained in:
郭越洋 2020-07-29 16:29:06 +08:00
parent 6a2f44720e
commit 95009c02ba

View File

@ -1185,6 +1185,10 @@ func parseStruct(st *ast.StructType, k string, m *swagger.Schema, realTypes *[]s
mp.Example = str2RealType(example, realType)
}
if len(tagValues) == 2 && tagValues[1] == "string" {
mp.Type = "string"
}
m.Properties[name] = mp
}
if ignore := stag.Get("ignore"); ignore != "" {