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.106.5 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.100.2 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.98.36 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.98.19 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.98.13 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.98.11 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.98.10 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.98.7 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.98.6 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.98.1 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.95.70 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.95.63 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.95.60 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.95.52 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.95.50 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.95.47 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.95.42 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.95.40 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.95.34 helpers/vendor/justinrainbow/json-schema/demo/demo.php
dependabot-composer-0.95.0 helpers/vendor/justinrainbow/json-schema/demo/demo.php