https://github.com/ixnode/php-json-schema-validator
PHP Json Schema Validator
https://github.com/ixnode/php-json-schema-validator
Last synced: 8 months ago
JSON representation
PHP Json Schema Validator
- Host: GitHub
- URL: https://github.com/ixnode/php-json-schema-validator
- Owner: ixnode
- License: mit
- Created: 2022-12-31T19:36:13.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-07T22:04:30.000Z (over 1 year ago)
- Last Synced: 2024-12-27T01:41:39.284Z (over 1 year ago)
- Language: PHP
- Size: 85 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP Json Schema Validator
[](https://github.com/ixnode/php-json-schema-validator/releases)
[](https://github.com/ixnode/php-json-schema-validator/releases)

[](https://www.php.net/supported-versions.php)
[](https://phpstan.org/user-guide/rule-levels)
[](https://phpunit.de)
[](https://www.php-fig.org/psr/psr-12/)
[](https://github.com/phpmd/phpmd)
[](https://github.com/rectorphp/rector)
[](https://github.com/ixnode/php-json-schema-validator/blob/master/LICENSE)
> An easy-to-use PHP Json Schema Validator on top of [opis/json-schema](https://github.com/opis/json-schema).
## 1. Usage
```php
use Ixnode\PhpJsonSchemaValidator\Validator;
```
```php
$data = '[1, 2, 3]';
$schema = [
'type' => 'object'
];
$validator = new Validator(new Json($data), new Json($schema));
$valid = $validator->validate();
// (bool) true
```
## 2. Installation
```bash
composer require ixnode/php-json-schema-validator
```
```bash
vendor/bin/php-json-schema-validator -V
```
```bash
php-json-schema-validator 0.1.0 (12-31-2022 15:51:08) - Björn Hempel
```
## 3. Library development
```bash
git clone git@github.com:ixnode/php-json-schema-validator.git && cd php-json-schema-validator
```
```bash
composer install
```
```bash
composer test
```
## 4. License
This tool is licensed under the MIT License - see the [LICENSE](/LICENSE) file for details