fix the struct type for []Type

This commit is contained in:
astaxie 2014-09-05 00:09:35 +08:00
parent 61e13f70be
commit e667c0fdaa
1 changed files with 7 additions and 1 deletions

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 {
if isBasicType(realType) {
mp.Type = "[]" + realType
} else {
mp.Type = "array"
mp.Items = make(map[string]string)
mp.Items["$ref"] = realType
}
} else {
mp.Type = realType
}