check-jsonschema "Invalid JSON" parse error in CI
check-jsonschema could not even parse the file as JSON, so validation never started. A trailing comma, a comment, or single quotes makes the JSON invalid.
What this error means
check-jsonschema prints "Failed to parse ...: Invalid JSON" with a line and column, and exits non-zero before any schema check.
Error: Failed to parse config.json
Invalid JSON: Expecting property name enclosed in double quotes: line 4 column 3 (char 45)Common causes
A trailing comma or comment in strict JSON
JSON forbids trailing commas and comments; a leftover comma after the last item, or a // comment, breaks the parse.
Single quotes instead of double quotes
JSON strings and keys must use double quotes; single quotes produce "Expecting property name enclosed in double quotes".
How to fix it
Make the file valid JSON
- Go to the reported line:column.
- Remove trailing commas and comments; use double quotes for all strings and keys.
- Re-run check-jsonschema to confirm the parse succeeds.
# validate that it is even parseable first
python -m json.tool config.json > /dev/nullUse a JSON5/JSONC-aware source if comments are needed
If you need comments, keep them in a JSON5/JSONC source and emit strict JSON for validation instead of feeding comments to check-jsonschema.
How to prevent it
- Run
json.toolor a formatter to catch parse errors before CI. - Add the pre-commit
check-jsonhook to block invalid JSON. - Do not put comments or trailing commas in
.jsonfiles.