diff --git a/src/Schema/Keywords/Items.php b/src/Schema/Keywords/Items.php index 51f1708f..475a102d 100644 --- a/src/Schema/Keywords/Items.php +++ b/src/Schema/Keywords/Items.php @@ -46,7 +46,7 @@ public function validate($data, CebeSchema $itemsSchema): void throw InvalidSchema::becauseDefensiveSchemaValidationFailed($e); } - if (! isset($this->parentSchema->type) || ($this->parentSchema->type !== 'array')) { + if (! isset($this->parentSchema->type) || ($this->parentSchema->type !== 'array' && (!is_array($this->parentSchema->type) || !in_array('array', $this->parentSchema->type, true)))) { throw new InvalidSchema(sprintf('items MUST be present if the type is array')); }