From e667c0fdaa0620f1d66ab4106c225e1a77c29c88 Mon Sep 17 00:00:00 2001 From: astaxie Date: Fri, 5 Sep 2014 00:09:35 +0800 Subject: [PATCH] fix the struct type for []Type --- g_docs.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/g_docs.go b/g_docs.go index f0152b7..39cf85f 100644 --- a/g_docs.go +++ b/g_docs.go @@ -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 }