protected function getSwaggerDocumentation(): Swagger
    {
        if (!$this->cache instanceof Cache) {
            return \Swagger\scan($this->scanDir, $this->scanOptions);
        }

        return $this->cache->getOrSet($this->cacheKey, function () {
            return \Swagger\scan($this->scanDir, $this->scanOptions);
        }, $this->cacheDuration);
    }