texthtml/json-validator

This package is abandoned and no longer maintained. No replacement package was suggested.

Validate json data with json-schema

v1.3.0 2022-04-08 14:05 UTC

This package is auto-updated.

Last update: 2024-10-26 15:01:32 UTC


README

$validator = \TH\JsonValidator\JsonValidator::create();
$data = json_decode($dataJsonString);
$validator->validate($data, (object)["\$ref" => "file://" . __DIR__."/data-schema.json"]));

$decoder = \TH\JsonValidator\JsonDecoder::create();
$data = $decoder->decode($dataJsonString, (object)["\$ref" => "file://" . __DIR__."/data-schema.json"]));