diff --git a/src/Symfony/Routing/ApiLoader.php b/src/Symfony/Routing/ApiLoader.php index f3abea05d35..de695329095 100644 --- a/src/Symfony/Routing/ApiLoader.php +++ b/src/Symfony/Routing/ApiLoader.php @@ -127,7 +127,10 @@ public function supports(mixed $resource, ?string $type = null): bool */ private function loadExternalFiles(RouteCollection $routeCollection): void { - $routeCollection->addCollection($this->fileLoader->load('docs.php')); + if ($this->docsEnabled || isset($this->formats['jsonld'])) { + $routeCollection->addCollection($this->fileLoader->load('docs.php')); + } + $routeCollection->addCollection($this->fileLoader->load('genid.php')); $routeCollection->addCollection($this->fileLoader->load('errors.php'));