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