Skip to content

Commit

Permalink
Resolve property definition subschemas before checking for a default
Browse files Browse the repository at this point in the history
  • Loading branch information
erayd committed Feb 13, 2018
1 parent 0bcf3eb commit 91f5891
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/JsonSchema/Constraints/UndefinedConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ protected function applyDefaultValues(&$value, $schema, $path)
if (isset($schema->properties) && LooseTypeCheck::isObject($value)) {
// $value is an object or assoc array, and properties are defined - treat as an object
foreach ($schema->properties as $currentProperty => $propertyDefinition) {
$propertyDefinition = $this->factory->getSchemaStorage()->resolveRefSchema($propertyDefinition);
if (
!LooseTypeCheck::propertyExists($value, $currentProperty)
&& property_exists($propertyDefinition, 'default')
Expand Down

0 comments on commit 91f5891

Please sign in to comment.