From a9c1152c7497ba2244b8040935dd406236e44586 Mon Sep 17 00:00:00 2001 From: Shelby Sanders Date: Thu, 10 Jul 2014 05:07:43 -0700 Subject: [PATCH] Correct description of collections of object and nested --- public/lib/swagger.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/lib/swagger.js b/public/lib/swagger.js index 90c3a4d..daf31fd 100644 --- a/public/lib/swagger.js +++ b/public/lib/swagger.js @@ -395,7 +395,7 @@ this.refDataType = obj.items.$ref; } } - this.dataTypeWithRef = this.refDataType != null ? this.dataType + '[' + this.refDataType + ']' : this.dataType; + this.dataTypeWithRef = this.refDataType != null ? (this.dataType[0].toUpperCase() + this.dataType.substring(1, this.dataType.length) + ' of ' + this.refDataType) : this.dataType; if (obj.allowableValues != null) { this.valueType = obj.allowableValues.valueType; this.values = obj.allowableValues.values; @@ -537,7 +537,11 @@ listType = this.isListType(dataType); isPrimitive = ((listType != null) && models[listType]) || (models[dataType] != null) ? false : true; if (isPrimitive) { - return dataType; + if (listType != null) { + return 'Array of ' + listType; + } else { + return dataType; + } } else { if (listType != null) { return 'Array of ' + models[listType].getMockSignature();