Registry / serialization / justinrainbow-json-schema

justinrainbow-json-schema

JSON →
library6.10.0phppackagistunverified

A library to validate a json schema.

composer require justinrainbow/json-schema
INSTALL
IMPORT
SIG · JUSTINRAINBOW-JSON
J
justinrainbow-json-schema
serializationphpv6.10.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Validator
use JsonSchema\Validator;

Validate JSON data against a JSON Schema

use JsonSchema\Validator; $validator = new Validator(); $data = json_decode('{"name":"John"}'); $schema = json_decode('{"type":"object","properties":{"name":{"type":"string"}}}'); $validator->validate($data, $schema); if (!$validator->isValid()) { echo 'Invalid'; }
Debug
Known issues
breakingBreaking change in v6: removed support for PHP <7.2 and changed error handling
fix
Update code to use new error format or stick with v5
affects: >=6.0.0
Upgrade
Version history
6.10.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
justinrainbow-json-schema — pip install justinrainbow-json-schema · libregistry