Shamelessly stolen from here. Validate json using jq:

dude@build:~/custom_fs$ cat partition.json | jq empty
dude@build:~/custom_fs$