diff --git a/JSON-Schema-Test-Suite b/JSON-Schema-Test-Suite index 1bd999a..b41167c 160000 --- a/JSON-Schema-Test-Suite +++ b/JSON-Schema-Test-Suite @@ -1 +1 @@ -Subproject commit 1bd999ac16bd8d3fdb5c44ef13a0759aefb4ab73 +Subproject commit b41167c7468403eaaf88f2b05f835dce16c8403f diff --git a/fastjsonschema/draft04.py b/fastjsonschema/draft04.py index e2d9c8a..43a08d5 100644 --- a/fastjsonschema/draft04.py +++ b/fastjsonschema/draft04.py @@ -206,13 +206,10 @@ def generate_not(self): means everything is invalid. """ not_definition = self._definition['not'] - if not_definition is True: + if not_definition is True or not_definition == {}: self.exc('{name} must not be there', rule='not') elif not_definition is False: return - elif not not_definition: - with self.l('if {}:', self._variable): - self.exc('{name} must NOT match a disallowed definition', rule='not') else: with self.l('try:', optimize=False): self.generate_func_code_block(not_definition, self._variable, self._variable_name)