justinrainbow/json-schema — Issue #7: Fatal error: Class 'JsonSchema\Constraints\Constraint' not found in Undefined.php
Author: roydekleijn
Created: 2012-01-28 13:17:20+00:00
State: open

Hi,

I try to do the following:

check(json_decode('{"state":"DF"}'), json_decode('{"type":"object","properties":{"state":{"type":"string","requires":"city"},"city":{"type":"string"}}}'));

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) {
$result = sprintf("[%s] %s\n", $error['property'], $error['message']);
return $result;
}
}
?>

But it says:
Fatal error: Class 'JsonSchema\Constraints\Constraint' not found in Constraints\Undefined.php on line 13

I hope you will have a solution for this.. As really like to use this validation method.

Kind regards