Registry / serialization / opis-json-schema

opis-json-schema

JSON →
library2.6.0phppackagistunverified

A PHP implementation of JSON Schema validation.

composer require opis/json-schema
INSTALL
IMPORT
SIG · OPIS-JSON-SCHEMA
O
opis-json-schema
serializationphpv2.6.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 Opis\JsonSchema\Validator;

Validates a JSON object against a JSON Schema.

use Opis\JsonSchema\Validator; $validator = new Validator(); $result = $validator->validate(json_decode('{"name":"John"}'), json_decode('{"type":"object","properties":{"name":{"type":"string"}}}')); if ($result->isValid()) { echo "Valid"; } else { echo "Invalid"; }
Debug
Known issues
breakingPHP 8.1+ required for version 2.x
fix
Upgrade to PHP 8.1 or later, or use version 1.x for older PHP.
affects: >=2.0.0
Upgrade
Version history
2.6.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
8
Meta
2
Amazon
1
Resources
opis-json-schema — pip install opis-json-schema · libregistry