From 3ccffe087e7dbca0d7bf46801f7e29696fd4f069 Mon Sep 17 00:00:00 2001 From: tnextday Date: Thu, 18 Aug 2016 21:30:57 +0800 Subject: [PATCH] update swagger array items define --- g_docs.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/g_docs.go b/g_docs.go index dc7be88..3199e13 100644 --- a/g_docs.go +++ b/g_docs.go @@ -603,17 +603,17 @@ func getModel(str string) (pkgpath, objectname string, m swagger.Schema, realTyp // add type slice if isSlice { mp.Type = "array" - mp.Properties = make(map[string]swagger.Propertie) if isBasicType(realType) { typeFormat := strings.Split(sType, ":") - mp.Properties["items"] = swagger.Propertie{ + mp.Items = []swagger.Propertie{{ Type: typeFormat[0], Format: typeFormat[1], - } + }} + } else { - mp.Properties["items"] = swagger.Propertie{ + mp.Items = []swagger.Propertie{{ Ref: "#/definitions/" + realType, - } + }} } } else { if isBasicType(realType) {