From dc11cdd02bc6655951acca7f206e5c8620b84327 Mon Sep 17 00:00:00 2001 From: momala454 Date: Tue, 13 Jun 2023 11:48:54 +0200 Subject: [PATCH] Update Items.php --- src/Schema/Keywords/Items.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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')); }