1
0
mirror of https://github.com/beego/bee.git synced 2024-12-22 20:20:49 +00:00

fix the struct type for []Type

This commit is contained in:
astaxie 2014-09-05 00:09:35 +08:00
parent 61e13f70be
commit e667c0fdaa

View File

@ -551,7 +551,13 @@ func getModel(str string) (pkgpath, objectname string, m swagger.Model, realType
mp := swagger.ModelProperty{}
// add type slice
if isSlice {
mp.Type = "[]" + realType
if isBasicType(realType) {
mp.Type = "[]" + realType
} else {
mp.Type = "array"
mp.Items = make(map[string]string)
mp.Items["$ref"] = realType
}
} else {
mp.Type = realType
}