From 75758d3b1b8a2a0320d875879de291f9f43a4b78 Mon Sep 17 00:00:00 2001 From: Erayd Date: Thu, 16 Mar 2017 15:28:19 +1300 Subject: [PATCH] Reset errors prior to validation --- src/JsonSchema/Validator.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/JsonSchema/Validator.php b/src/JsonSchema/Validator.php index 9f44e512..d479103c 100644 --- a/src/JsonSchema/Validator.php +++ b/src/JsonSchema/Validator.php @@ -37,6 +37,10 @@ class Validator extends BaseConstraint */ public function validate(&$value, $schema = null, $checkMode = null) { + // reset errors prior to validation + $this->reset(); + + // set checkMode $initialCheckMode = $this->factory->getConfig(); if ($checkMode !== null) { $this->factory->setConfig($checkMode);