Remove blank element from json

Remove blank element from json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ cat ~/.jq

def remove_empty:
. | walk(
if type == "object" then
with_entries(
select(
.value != null and
.value != "" and
.value != [] and
.value != {}
)
)
else .
end
);