augusthur/json-respector

A respect/validation instances creator from JSON Schemas

dev-master 2019-10-30 15:26 UTC

This package is not auto-updated.

Last update: 2024-04-28 12:14:23 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

A Validator which transforms JSON Schemas to respect/validation instances.

Supported Rules

Draft 6

Install

Via Composer

$ composer require augusthur/json-respector

Usage

// Create the Validator Service instance
$validation = new Augusthur\JsonRespector\ValidatorService();

// Generate a Respect Validator instance from a JSON schema string
$v = $validation->fromSchema('{"type": "string", "minLength": 3}');

// Returns true
$v->validate('abcde');

// To use the plain Respect Validator use start()
// Returns true
$validation->start()->numeric()->validate(123);

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, just use the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.