Validate all JSON files in your repository during CI/CD. Catch malformed JSON before it reaches production.
- uses: masstensor/json-validate-action@main
with:
files: '**/*.json'
strict: 'true'
exclude: 'node_modules/**,package-lock.json'| Input | Description | Default |
|---|---|---|
files |
Glob pattern for JSON files | **/*.json |
strict |
Fail workflow on invalid JSON | true |
exclude |
Patterns to exclude (comma-separated) | node_modules/**,package-lock.json,.git/** |
| Output | Description |
|---|---|
valid |
Number of valid files |
invalid |
Number of invalid files |
total |
Total files checked |
name: Validate JSON
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: masstensor/json-validate-action@main
with:
files: 'config/**/*.json'
strict: 'true'Need JSON validation in your app? Use our DevTools API:
curl -H "X-API-Key: YOUR_KEY" -X POST \
-d '{"input":"{\"a\":1}"}' \
https://api.fengdeagents.site/api/json/validateMIT