I am having problem to validate json string. i am using below code
if jq -e . >/dev/null 2>&1 <<<"$json_string"; then
echo "Parsed JSON successfully and got something other than false/null"
else
echo "Failed to parse JSON, or got false/null"
fi
This does not work for json_string={"fruit":{"name":"app. this still shows Parsed JSON successfully and got something other than false/null where as the json string is incomplete.