protected function runValidator(stdClass $data, stdClass $schema): void
    {
        $config = $this->getConfig();

        $validator = new Validator;
        $validator->validate($data, $schema, $config['validationMode']);

        if (!$validator->isValid()) {
            foreach ($validator->getErrors() as $error) {
                $this->errors[] = sprintf('[%s]: %s', $error['pointer'], $error['message']);
            }

            throw new JsonValidationException('Failed to validate json data against the schema.');
        }
    }