public function getValidator()
    {
        if (!isset($this->validator) && isset($this->configuration)) {
            // Initialize JSON validator.
            $resolver = $this->configuration->getResolver();
            if ($resolver && ($retriever = $resolver->getUriRetriever())) {
                $check_mode = JsonSchema\Validator::CHECK_MODE_NORMAL;
                $this->validator = new JsonSchema\Validator($check_mode, $retriever);
            }
        }

        return $this->validator;
    }