I tried to use this tool. And it looks great, however the function 'Variant to JSON' fails with a variant inside an object. I made the following changes:
-Added support for Variant. By using 'Unwrap Variant'
-If a <Null> Variant is found, replace this with a Null-Cluster
-When Flattening the Cluster and number of elements is 0 then output '{}'
(note that without this change an empty cluster would flatten to '}')
This allowed me to have a cluster with optional variant Arguments flatten well:
into:
{"api_key":"xx","args":{"owner":"ton","repo_name":"repository","repo_type":"hg"},"id":915,"method":"create_repo"} (with args)
or
{"api_key":"xx","args":{},"id":378,"method":"get_users"} (no args)
I added a method for 'Object' to list all element names:
This will return the names of all the elements in an Object (Cluster), so you can scan them and retrieve them by name.
Ton