diff --git a/src/JsonSchema/Constraints/CollectionConstraint.php b/src/JsonSchema/Constraints/CollectionConstraint.php index 18f0efd9..af009d91 100644 --- a/src/JsonSchema/Constraints/CollectionConstraint.php +++ b/src/JsonSchema/Constraints/CollectionConstraint.php @@ -64,6 +64,10 @@ public function check(&$value, $schema = null, JsonPointer $path = null, $i = nu */ protected function validateItems(&$value, $schema = null, JsonPointer $path = null, $i = null) { + if (is_array($schema->items) && array_key_exists('$ref', $schema->items)) { + $schema->items = $this->factory->getSchemaStorage()->resolveRefSchema((object) $schema->items); + } + if (is_object($schema->items)) { // just one type definition for the whole array