How to validate json files for ci/cd pipeline integration
- Step 1Manual pre-check before committing — Paste modified JSON files here before git commit to catch syntax errors locally. A syntax error found here is faster to fix than one caught by CI after a push.
- Step 2Diagnose a CI JSON validation failure — Copy the failing JSON file content from the CI build log and paste it here. The validator shows the exact error position, which is often missing or unclear in CI error output.
- Step 3Add JSON validation to CI with ajv-cli — Install: npm install --save-dev ajv-cli. Add a CI step: npx ajv validate -s schema.json -d data/*.json. This validates both syntax and schema conformance for all JSON data files.
- Step 4Validate JSON manifests in a bash CI script — Use Python or jq: find . -name '*.json' | xargs -I{} sh -c 'python3 -m json.tool {} > /dev/null || echo "Invalid JSON: {}"'. This validates all JSON files in the repository and lists any that fail.
Frequently asked questions
How do I add JSON validation to GitHub Actions?+
Add a step to your workflow: - name: Validate JSON files; run: find . -name '*.json' -not -path './node_modules/*' | xargs -I{} python3 -m json.tool {} > /dev/null. This fails the workflow if any JSON file has a syntax error. For schema validation, use ajv-cli with a schema file.
What is the difference between JSON syntax validation and JSON schema validation?+
Syntax validation checks that the file is valid JSON (no unclosed brackets, no trailing commas, correct value types). Schema validation checks that the data structure and values conform to a defined JSON Schema — required fields present, string lengths within limits, enum values valid. Run syntax validation first; schema validation only makes sense on syntactically valid JSON.
Is the configuration JSON transmitted to JAD Apps?+
No. Validation runs entirely in your browser. Configuration files, schema files, and infrastructure JSON are never transmitted to JAD Apps servers.
Privacy first
Conversion runs locally in your browser. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.