--exit-status
argument. See https://stedolan.github.io/jq/manual/#Invokingjq$ echo '{valid: true}' | jq -e; echo $?
parse error: Invalid numeric literal at line 1, column 7
4
$ echo '{"valid": true}' | jq -e; echo $?
{
"valid": true
}
0
json_verify
which can be used for syntax checking JSON files.