scedel / validator
JSON validator for Scedel schema repositories
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/scedel/validator
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.