ixnode/php-json-schema-validator

An easy-to-use PHP Json Schema Validator.

0.1.4 2023-09-16 21:42 UTC

This package is auto-updated.

Last update: 2024-11-17 00:24:18 UTC


README

Release PHP PHPStan PHPUnit PHPCS PHPMD Rector - Instant Upgrades and Automated Refactoring LICENSE

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