recommerce / json-lib
Installs: 14 493
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 5
Forks: 0
Open Issues: 0
Requires
- justinrainbow/json-schema: 1.5.*
Requires (Dev)
- behat/behat: ^3.0
- codeclimate/php-test-reporter: dev-master
- humbug/humbug: ~1.0@dev
- pdepend/pdepend: ^2.0
- phing/phing: ^2.10
- phpmd/phpmd: ^2.2
- sebastian/phpcpd: ^2.0
- squizlabs/php_codesniffer: ^2.3
This package is not auto-updated.
Last update: 2023-03-17 08:29:55 UTC
README
Recommerce json-lib
This library provides json validation feature (based on justinrainbow/json-schema).
Installation with composer
composer require recommerce/json-lib:^0.0 composer update
Usage examples
Json file validation
use Recommerce\Json\Content\FileContent; use Recommerce\Json\Exception\JsonException; use Recommerce\Json\Validator; $jsonSchema = new FileContent('my-json-schema-file.json'); $jsonContent = new EncodedContent('{"attribute": "value"}'); try { $validator = new Validator($jsonSchema); $validator->validate($jsonContent); // throw exception on failure } catch (JsonException $e) { }