ixnode / php-json-schema-validator
An easy-to-use PHP Json Schema Validator.
0.1.4
2023-09-16 21:42 UTC
Requires
- php: ^8.2
- ixnode/php-checker: ^0.1
- ixnode/php-container: ^0.1
- ixnode/php-exception: ^0.1
- ixnode/php-naming-conventions: ^0.1
- opis/json-schema: ^2.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.13
- ixnode/bash-version-manager: ^0.1.3
- phpmd/phpmd: ^2.13
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^9.5
- povils/phpmnd: ^3.0
- rector/rector: ^0.15.1
README
An easy-to-use PHP Json Schema Validator on top of opis/json-schema.
1. Usage
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
2. Installation
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>
3. Library development
git clone git@github.com:ixnode/php-json-schema-validator.git && cd php-json-schema-validator
composer install
composer test
4. License
This tool is licensed under the MIT License - see the LICENSE file for details