Exemplo n.º 1
0
 def evaluate(self, instance: JSON, scope: Scope) -> None:
     scope.annotate(instance, self.key, self.json.value)
     if self.validator is not None:
         try:
             self.validator(instance.value)
         except ValueError as e:
             scope.fail(instance, f'The instance is invalid against the "{self.json.value}" format: {e}')
     else:
         scope.noassert()
Exemplo n.º 2
0
 def evaluate(self, instance: JSON, scope: Scope) -> None:
     self.json.evaluate(instance, scope)
     scope.noassert()
Exemplo n.º 3
0
 def evaluate(self, instance: JSON, scope: Scope) -> None:
     scope.annotate(instance, self.key, self.json.value)
     scope.noassert()