scedel / validator
JSON validator for Scedel schema repositories
0.2.1
2026-02-18 16:30 UTC
Requires
- php: ^8.3
- scedel/schema: *
Requires (Dev)
- phpunit/phpunit: ^13.0
README
Validates JSON payloads against a SchemaRepository from scedel/schema.
RFC support
API
use Scedel\Validator\JsonValidator; $validator = new JsonValidator(); $errors = $validator->validate($json, $repository, 'Root');
validate() returns ValidationError[].
CLI
php scedel-validator/bin/validate-json.php '<json>' /absolute/path/schema.scedel
php scedel-validator/bin/validate-json.php --type Post payload.json /absolute/path/schema.scedel
If root type is omitted, validator uses:
Roottype, if present- the only type in repository
- otherwise returns an error with available types.