Sha256: 5a134aacfe58608414d4e01d0c39ecff60c82e46ce75219a26553896498bed9e

Contents?: true

Size: 532 Bytes

Versions: 42

Compression:

Stored size: 532 Bytes

Contents

<?php

require __DIR__ . '/../vendor/autoload.php';

$data = json_decode(file_get_contents('data.json'));

// Validate
$validator = new JsonSchema\Validator();
$validator->check($data, (object) array('$ref' => 'file://' . realpath('schema.json')));

if ($validator->isValid()) {
    echo "The supplied JSON validates against the schema.\n";
} else {
    echo "JSON does not validate. Violations:\n";
    foreach ($validator->getErrors() as $error) {
        echo sprintf("[%s] %s\n", $error['property'], $error['message']);
    }
}

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
dependabot-composer-0.119.0.beta1 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.113.19 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.112.1 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.111.57 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.111.56 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.111.52 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.111.50 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.111.25 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.111.17 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.111.15 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.110.13 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.108.11 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.108.8 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.107.47 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.107.39 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.107.36 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.107.28 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.107.14 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.106.12 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.106.11 helpers/vendor/justinrainbow/json-schema/demo/demo.php