jsoninfo: in /plugins list plugin parameters as map entries
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 17 Mar 2016 16:29:25 +0000 (17:29 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 17 Mar 2016 16:31:57 +0000 (17:31 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/jsoninfo/src/olsrd_jsoninfo.c

index 0b73bea..92add87 100644 (file)
@@ -1004,14 +1004,11 @@ 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");
+      abuf_json_mark_object(true, false, abuf, "parameters");
       for (param = plugin->params; param; param = param->next) {
-        abuf_json_mark_array_entry(true, abuf);
-        abuf_json_string(abuf, "name", param->key);
-        abuf_json_string(abuf, "value", param->value);
-        abuf_json_mark_array_entry(false, abuf);
+        abuf_json_string(abuf, param->key, param->value);
       }
-      abuf_json_mark_object(false, true, abuf, NULL);
+      abuf_json_mark_object(false, false, abuf, NULL);
 
       abuf_json_mark_array_entry(false, abuf);
     }