Skip to content

Commit 13d0e34

Browse files
committed
Always use loose type checking for object check decision
The decision whether to check something as an object should always be made loosely, regardless of whether Constraint::CHECK_MODE_TYPE_CAST is set. Loosely checking here does not actually cast anything, but ensures that subvalues are still properly processed in assoc mode even when type casting is disabled.
1 parent 5afdb09 commit 13d0e34

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/JsonSchema/Constraints/UndefinedConstraint.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use JsonSchema\Uri\UriResolver;
1313
use JsonSchema\Entity\JsonPointer;
14+
use JsonSchema\Constraints\TypeCheck\LooseTypeCheck;
1415

1516
/**
1617
* The UndefinedConstraint Constraints
@@ -57,7 +58,7 @@ public function validateTypes(&$value, $schema = null, JsonPointer $path, $i = n
5758
}
5859

5960
// check object
60-
if ($this->getTypeCheck()->isObject($value)) {
61+
if (LooseTypeCheck::isObject($value)) {
6162
$this->checkObject(
6263
$value,
6364
isset($schema->properties) ? $this->factory->getSchemaStorage()->resolveRefSchema($schema->properties) : $schema,

0 commit comments

Comments
 (0)