From 9d8cb5439adef92fccaa0ffde4d630245d9239b5 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 21 Mar 2018 15:53:38 +0100 Subject: [PATCH] api-viewer: show full return info if available if we have extended information available about what a API call returns the show it. Just stringify the items and/or properties object and put it in
tags.

Signed-off-by: Thomas Lamprecht 
---
 api-viewer/PMGAPI.js | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/api-viewer/PMGAPI.js b/api-viewer/PMGAPI.js
index bcd703b..e4504af 100644
--- a/api-viewer/PMGAPI.js
+++ b/api-viewer/PMGAPI.js
@@ -189,15 +189,28 @@ Ext.onReady(function() {
 
 		if (info.returns) {
 
-		    var rtype = info.returns.type;
-		    if (!rtype && info.returns.items)
+                   var retinf = info.returns;
+                   var rtype = retinf.type;
+                   if (!rtype && retinf.items)
 			rtype = 'array';
 		    if (!rtype)
 			rtype = 'object';
 
-		    sections.push({
-			title: 'Returns: ' + rtype
-		    });
+                   var returnhtml;
+                   if (retinf.items) {
+                       returnhtml = '
items: ' + JSON.stringify(retinf.items, null, 4) + '
'; + } + + if (retinf.properties) { + returnhtml = returnhtml || ''; + returnhtml += '
properties:' + JSON.stringify(retinf.properties, null, 4);
+                   }
+
+		   sections.push({
+		       title: 'Returns: ' + rtype,
+		       bodyPadding: 10,
+		       html: returnhtml
+		   });
 		}
 
 		var permhtml = '';