show structure of all levels of json with jq and bash -
how can list unique keys of json file levels , array attributes, path?
i found jq -s 'map(keys) | add | unique | sort' input.json, lists first level, , no paths.
if stream input in, give pairs of paths , values contained in input.
$ jq --stream 'select(length>1)[0]' input.json
so input this:
{ "foo": { "bar": 1 }, "biz": { "baz": 2 } }
you'd get:
[ "foo", "bar" ] [ "biz", "baz" ]
Comments
Post a Comment