diff --git a/jsv4.php b/jsv4.php index f6d0246..07eece5 100644 --- a/jsv4.php +++ b/jsv4.php @@ -274,6 +274,11 @@ private function checkObject() { } } } + foreach ($this->data as $key => &$subValue) { + if (isset($checkedProperties[$key]) == false){ + $this->fail(JSV4_INVALID_TYPE, "/$key", "/$key", "Object has invalid key: {$key}"); + } + } } if (isset($this->schema->additionalProperties)) { $additionalProperties = $this->schema->additionalProperties;