summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-09-05 11:26:53 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-09-05 12:04:36 +0530
commit20215ff4bec7281babdab3255d80d587839476df (patch)
tree530ded55ede319d6a2e77875ebc355b48f69d65c
parent46525e3d52cfba3197f81d9afb29485ec4f7892a (diff)
OCLIP: Fix json print format
When value is null, ignore the result attribute Issue-ID: VNFSDK-304 Change-Id: Ifaeeb8f47fd7f8a7a1a6798b7dc7b3972a6d4abd Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
-rw-r--r--framework/src/main/java/org/onap/cli/fw/output/print/OnapCommandPrint.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/output/print/OnapCommandPrint.java b/framework/src/main/java/org/onap/cli/fw/output/print/OnapCommandPrint.java
index fd1ddbaf..614ef5d1 100644
--- a/framework/src/main/java/org/onap/cli/fw/output/print/OnapCommandPrint.java
+++ b/framework/src/main/java/org/onap/cli/fw/output/print/OnapCommandPrint.java
@@ -248,7 +248,8 @@ public class OnapCommandPrint {
JSONObject rowO = new JSONObject();
for (int j=0; j<titleRow.size(); j++) {
- rowO.put(titleRow.get(j).toString(), rows.get(i).get(j).toString());
+ if (rows.get(i).get(j) != null)
+ rowO.put(titleRow.get(j).toString(), rows.get(i).get(j).toString());
}
array.add(rowO);