$validator = new Validator();
$schema = (object) ['minLength' => 3];
$validator->dataValidation("abc", $schema);
PHP Fatal error: Uncaught Opis\JsonSchema\Exception\InvalidSchemaException: Schema must be an object or a boolean, NULL given in /home/etki/Workspace/ama-team.github.io/php/elasticsearch-schema/vendor/opis/json-schema/src/Validator.php:295
Stack trace:
#0 /home/etki/Workspace/ama-team.github.io/php/elasticsearch-schema/vendor/opis/json-schema/src/Validator.php(87): Opis\JsonSchema\Validator->validateSchema('abc', 'abc', Array, Array, Object(Opis\JsonSchema\Schema), NULL, Object(Opis\JsonSchema\ValidationResult))
#1 /home/etki/Workspace/ama-team.github.io/php/elasticsearch-schema/vendor/opis/json-schema/src/Validator.php(107): Opis\JsonSchema\Validator->schemaValidation('abc', Object(Opis\JsonSchema\Schema), 1, NULL)
As taken from readme:
Fast debugging has shown that
$schema->resolve()returns null becauseschema->idwas set tourn:5a4509dde8a0f#, but the required reference inschema->internalwasurn:/5a4509dde8a0f#(had extra slash).