Registry / serialization / league-json-guard

league-json-guard

JSON →
library1.0.1phppackagistunverified

A validator for JSON using json-schema.

composer require league/json-guard
INSTALL
IMPORT
SIG · LEAGUE-JSON-GUARD
L
league-json-guard
serializationphpv1.0.1
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 League\JsonGuard\Validator;

Validate JSON data against a JSON Schema.

use League\JsonGuard\Validator; $schema = (object) ['type' => 'object', 'properties' => (object) ['name' => (object) ['type' => 'string']]]; $data = (object) ['name' => 'John']; $validator = new Validator($data, $schema); if ($validator->passes()) { echo 'Valid!'; }
Debug
Known issues
breakingRequires PHP 7.1+; older versions may not work.
fix
Upgrade to PHP 7.1 or later.
affects: <1.0.0
Upgrade
Version history
1.0.1latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
league-json-guard — pip install league-json-guard · libregistry