Closed
Description
I'm using 5.1 version.
<?php
use JsonSchema\Validator;
$validator = new Validator;
$data = (object)['key' => true];
$validator->validate(
$data,
(object)[
'type' => 'object',
'properties' => (object)[
'key' => (object)[
'type' => 'boolean'
]
]
]
);
var_dump($validator->isValid()); // true
$data = ['key' => true];
$validator->validate(
$data,
(object)[
'type' => 'object',
'properties' => (object)[
'key' => (object)[
'type' => 'boolean'
]
]
]
);
var_dump($validator->isValid()); // false
$data = (object)['key' => true];
$validator->validate(
$data,
(object)[
'type' => 'object',
'properties' => (object)[
'key' => (object)[
'type' => 'boolean'
]
]
]
);
var_dump($validator->isValid()); // false but should be true
There should be a way to clear the Validator status? Or that subsequent invocations of validate should not keep the original validation status.
Metadata
Metadata
Assignees
Labels
No labels