One stray comma is enough to stop a service from starting. Before I restart anything after editing a JSON file, a quick parse check is cheap insurance.
jq empty config.json
empty is a filter that produces no output, so a good file gives you silence and exit code 0. A broken one gives a parse error with the line and column, and a non-zero exit code. A trailing comma shows up like this:
$ printf '{"a":1,}' | jq empty
jq: parse error: Expected another key-value pair at line 1, column 8
In a script it fits nicely before a restart:
jq empty config.json && docker compose restart app
The restart only happens if the file parses.
It checks syntax and nothing more. A misspelled key or a number where a string belongs passes happily. An empty file also passes, and so do two JSON values one after the other, which a strict parser would reject. If those matter, test for the shape you expect as well. Files with comments, which some programs allow in their config, will be reported as broken.
Further reading: jq manual