Esempio 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()
Esempio n. 2
0
 def evaluate(self, instance: JSON, scope: Scope) -> None:
     self.json.evaluate(instance, scope)
     scope.noassert()
Esempio n. 3
0
 def evaluate(self, instance: JSON, scope: Scope) -> None:
     scope.annotate(instance, self.key, self.json.value)
     scope.noassert()