Skip to content

Commit 6dce921

Browse files
author
Mathieu Rochette
committed
fix bug when applying defaults
1 parent 93f0060 commit 6dce921

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/JsonSchema/Constraints/UndefinedConstraint.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,11 @@ protected function applyDefaultValues(&$value, $schema, $path)
252252
$this->appliedDefaults[] = $currentProperty;
253253
}
254254
}
255-
} elseif (isset($schema->items) && LooseTypeCheck::isArray($value)) {
255+
} elseif (
256+
isset($schema->items) &&
257+
LooseTypeCheck::isObject($schema->items) &&
258+
LooseTypeCheck::isArray($value)
259+
) {
256260
// $value is an array, and items are defined - treat as plain array
257261
foreach ($schema->items as $currentItem => $itemDefinition) {
258262
if (

0 commit comments

Comments
 (0)