protected function checkBasePath(\SwaggerValidator\Common\Context $context)
    {
        if (!isset($this->basePath) || $this->basePath == '/') {
            $context->setBasePath(null);
            $context->setRequestPath($context->getDataValue());
            return $context;
        }

        if (substr($context->getDataValue(), 0, strlen($this->basePath)) != $this->basePath) {
            return $context->setValidationError(\SwaggerValidator\Common\Context::VALIDATION_TYPE_BASEPATH_ERROR, 'BasePath requested is not matching', __METHOD__, __LINE__);
        }

        $context->setBasePath($this->basePath);
        $context->setRequestPath(substr($context->getDataValue(), strlen($this->basePath)));

        return $context;
    }