
Json Validator
- 24 installs
- 84 repo stars
- Updated January 28, 2026
- aidotnet/moyucode
json-validator is a Claude Code skill that validates JSON files against a JSON Schema with detailed error reporting and formatting.
About
json-validator is a Claude Code skill that validates JSON files using a bundled Python script based on the jsonschema library. A developer uses it to check JSON syntax, validate against a JSON Schema with error reporting, and format or minify JSON. It is useful for verifying config and API payloads.
- Validates JSON syntax and against a JSON Schema
- Reports detailed errors
- Formats or minifies JSON
Json Validator by the numbers
- 24 all-time installs (skills.sh)
- Ranked #3,426 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
- Data as of Jul 28, 2026 (Skillselion catalog sync)
json-validator capabilities & compatibility
- Capabilities
- json validation · schema validation · json formatting
- Use cases
- testing
- Pricing
- Free
What json-validator says it does
Validate JSON files against JSON Schema with detailed error reporting and formatting.
python scripts/json_validator.py data.json --schema schema.json
npx skills add https://github.com/aidotnet/moyucode --skill json-validatorAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 24 |
|---|---|
| repo stars | ★ 84 |
| Last updated | January 28, 2026 |
| Repository | aidotnet/moyucode ↗ |
What it does
Validate a JSON file against a schema and format or minify it.
When should I use this skill?
A developer needs to validate JSON or check it against a schema.
What you get
The developer gets a validation result with detailed errors and optional formatting.
By the numbers
- 4 modes: validate syntax, validate against schema, format, minify
Files
JSON Validator Tool
Description
Validate JSON files against JSON Schema with detailed error reporting and formatting.
Trigger
/json-validatecommand- User needs to validate JSON
- User wants schema validation
Usage
# Validate JSON syntax
python scripts/json_validator.py data.json
# Validate against schema
python scripts/json_validator.py data.json --schema schema.json
# Format JSON
python scripts/json_validator.py data.json --format --output formatted.json
# Minify JSON
python scripts/json_validator.py data.json --minifyTags
json, validate, schema, format, lint
Compatibility
- Codex: ✅
- Claude Code: ✅
#!/usr/bin/env python3
"""
JSON Validator Tool
Based on: https://github.com/python-jsonschema/jsonschema
Usage:
python json_validator.py data.json
python json_validator.py data.json --schema schema.json
python json_validator.py data.json --format
"""
import argparse
import json
import sys
from pathlib import Path
def validate_json(filepath):
"""Validate JSON syntax."""
try:
with open(filepath, 'r', encoding='utf-8') as f:
data = json.load(f)
return True, data, None
except json.JSONDecodeError as e:
return False, None, f"Line {e.lineno}, Col {e.colno}: {e.msg}"
except Exception as e:
return False, None, str(e)
def validate_schema(data, schema_path):
"""Validate JSON against schema."""
try:
from jsonschema import validate, ValidationError
with open(schema_path, 'r') as f:
schema = json.load(f)
validate(instance=data, schema=schema)
return True, None
except ImportError:
return True, "jsonschema not installed, skipping schema validation"
except ValidationError as e:
return False, f"Schema error at {'/'.join(str(p) for p in e.path)}: {e.message}"
except Exception as e:
return False, str(e)
def main():
parser = argparse.ArgumentParser(description="Validate JSON files")
parser.add_argument('file', help='JSON file to validate')
parser.add_argument('--schema', '-s', help='JSON Schema file')
parser.add_argument('--format', '-f', action='store_true', help='Format output')
parser.add_argument('--minify', '-m', action='store_true', help='Minify output')
parser.add_argument('--output', '-o', help='Output file')
args = parser.parse_args()
valid, data, error = validate_json(args.file)
if not valid:
print(f"✗ Invalid JSON: {error}", file=sys.stderr)
sys.exit(1)
print(f"✓ Valid JSON syntax")
if args.schema:
valid, error = validate_schema(data, args.schema)
if not valid:
print(f"✗ Schema validation failed: {error}", file=sys.stderr)
sys.exit(1)
print(f"✓ Schema validation passed")
if args.format or args.minify:
indent = None if args.minify else 2
output = json.dumps(data, indent=indent, ensure_ascii=False)
if args.output:
with open(args.output, 'w', encoding='utf-8') as f:
f.write(output)
print(f"✓ Output saved to {args.output}")
else:
print(output)
if __name__ == "__main__":
main()