Introduced a helper function to print empty JSON object.
Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
return vty_json_helper(vty, json, JSON_C_TO_STRING_NOSLASHESCAPE);
}
+void vty_json_empty(struct vty *vty)
+{
+ json_object *json = json_object_new_object();
+
+ vty_json(vty, json);
+}
+
/* Output current time to the vty. */
void vty_time_print(struct vty *vty, int cr)
{
*/
extern int vty_json(struct vty *vty, struct json_object *json);
extern int vty_json_no_pretty(struct vty *vty, struct json_object *json);
-
+extern void vty_json_empty(struct vty *vty);
/* post fd to be passed to the vtysh client
* fd is owned by the VTY code after this and will be closed when done
*/