Skip to content

Basic example is not working #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
etki opened this issue Dec 28, 2017 · 1 comment
Closed

Basic example is not working #2

etki opened this issue Dec 28, 2017 · 1 comment

Comments

@etki
Copy link

etki commented Dec 28, 2017

As taken from readme:

$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)

Fast debugging has shown that $schema->resolve() returns null because schema->id was set to urn:5a4509dde8a0f#, but the required reference in schema->internal was urn:/5a4509dde8a0f# (had extra slash).

@sorinsarca
Copy link
Member

Fixed in version 1.0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants