jsoninfo: in /plugins list plugin parameters as array entries
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 9 Mar 2016 13:37:06 +0000 (14:37 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 9 Mar 2016 13:38:26 +0000 (14:38 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/jsoninfo/src/olsrd_jsoninfo.c

index e2b4c24..3e4fb81 100644 (file)
@@ -999,9 +999,15 @@ void ipc_print_plugins(struct autobuf *abuf) {
 
       abuf_json_mark_array_entry(true, abuf);
       abuf_json_string(abuf, "plugin", plugin->name);
+
+      abuf_json_mark_object(true, true, abuf, "parameters");
       for (param = plugin->params; param; param = param->next) {
+        abuf_json_mark_array_entry(true, abuf);
         abuf_json_string(abuf, param->key, param->value);
+        abuf_json_mark_array_entry(false, abuf);
       }
+      abuf_json_mark_object(false, true, abuf, NULL);
+
       abuf_json_mark_array_entry(false, abuf);
     }
   }