An easy-to-use PHP Json Schema Validator on top of opis/json-schema.
use Ixnode\PhpJsonSchemaValidator\Validator;
$data = '[1, 2, 3]';
$schema = [
'type' => 'object'
];
$validator = new Validator(new Json($data), new Json($schema));
$valid = $validator->validate();
// (bool) true
composer require ixnode/php-json-schema-validator
vendor/bin/php-json-schema-validator -V
php-json-schema-validator 0.1.0 (12-31-2022 15:51:08) - Björn Hempel <bjoern@hempel.li>
git clone git@github.com:ixnode/php-json-schema-validator.git && cd php-json-schema-validator
composer install
composer test
This tool is licensed under the MIT License - see the LICENSE file for details