justinrainbow/json-schema — pull request #111 by daarond (2014-09-24 23:37:58+00:00)
Title: added property callback mechanism

Registered properties, when encountered by the validator, fires the callback function.

Usage:
$validator = new JsonSchema\Validator();
$validator->register_property('db_uniqueness',function($key, $element, $schema, $path, $i){
// callback magick here

// callback determines there are errors, so return them
return array($key=>'random error 1', $key=>'specific error');
});
$validator->check($obj, $schema);