Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ixnode/php-json-schema-validator
PHP Json Schema Validator
https://github.com/ixnode/php-json-schema-validator
Last synced: 10 days 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 (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-16T21:43:00.000Z (about 1 year ago)
- Last Synced: 2024-09-18T05:03:13.009Z (about 2 months ago)
- Language: PHP
- Size: 73.2 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
[![Release](https://img.shields.io/github/v/release/ixnode/php-json-schema-validator)](https://github.com/ixnode/php-json-schema-validator/releases)
[![](https://img.shields.io/github/release-date/ixnode/php-json-schema-validator)](https://github.com/ixnode/php-json-schema-validator/releases)
![](https://img.shields.io/github/repo-size/ixnode/php-json-schema-validator.svg)
[![PHP](https://img.shields.io/badge/PHP-^8.2-777bb3.svg?logo=php&logoColor=white&labelColor=555555&style=flat)](https://www.php.net/supported-versions.php)
[![PHPStan](https://img.shields.io/badge/PHPStan-Level%20Max-brightgreen.svg?style=flat)](https://phpstan.org/user-guide/rule-levels)
[![PHPUnit](https://img.shields.io/badge/PHPUnit-Unit%20Tests-6b9bd2.svg?style=flat)](https://phpunit.de)
[![PHPCS](https://img.shields.io/badge/PHPCS-PSR12-brightgreen.svg?style=flat)](https://www.php-fig.org/psr/psr-12/)
[![PHPMD](https://img.shields.io/badge/PHPMD-ALL-364a83.svg?style=flat)](https://github.com/phpmd/phpmd)
[![Rector - Instant Upgrades and Automated Refactoring](https://img.shields.io/badge/Rector-PHP%208.2-73a165.svg?style=flat)](https://github.com/rectorphp/rector)
[![LICENSE](https://img.shields.io/github/license/ixnode/php-json-schema-validator)](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 [email protected]: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