hskrasek / jsonschema-input-validator
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/hskrasek/jsonschema-input-validator
Requires
- php: >=7.1
- league/json-guard: ^1.0
Requires (Dev)
- phpunit/phpunit: ^7.0
- squizlabs/php_codesniffer: ^3.2
This package is auto-updated.
Last update: 2025-09-25 02:31:58 UTC
README
This package provides a wrapper around JSON Guard, allowing you to get a ProblemDetails object representing any errors with the data being validated.
Install
Via Composer
$ composer require hskrasek/jsonschema-input-validator
Usage
<?php use HSkrasek\JSONSchema\Validator; $validator = new Validator($data, $schema); if ($validator->fails()) { $problemDetails = $validator->getProblemDetails(); // Render problem details somehow return json_encode($problemDetails); }
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email hunterskrasek@me.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.