Skip to content

Commit fa172a3

Browse files
committed
Obey CHECK_MODE_EXCEPTIONS when validating schemas
1 parent 5618c3e commit fa172a3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/JsonSchema/Constraints/SchemaConstraint.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public function check(&$element, $schema = null, JsonPointer $path = null, $i =
7272
}
7373

7474
// validate schema
75-
$validator = new Validator(new Factory($schemaStorage, null, self::CHECK_MODE_TYPE_CAST));
75+
$checkMode = $this->factory->getConfig(self::CHECK_MODE_EXCEPTIONS) | self::CHECK_MODE_TYPE_CAST;
76+
$validator = new Validator(new Factory($schemaStorage, null, $checkMode));
7677
$validator->validate($validationSchema, $schemaStorage->getSchema($schemaSpec));
7778
if (!$validator->isValid()) {
7879
$validationErrors = array_map(function ($error) {

0 commit comments

Comments
 (0)