Skip to content

Commit 3777747

Browse files
committed
feature/do-not-load-docs-routes-if-docs-disabled
1 parent 1698120 commit 3777747

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Symfony/Routing/ApiLoader.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ public function supports(mixed $resource, ?string $type = null): bool
127127
*/
128128
private function loadExternalFiles(RouteCollection $routeCollection): void
129129
{
130-
$routeCollection->addCollection($this->fileLoader->load('docs.php'));
130+
if ($this->docsEnabled || isset($this->formats['jsonld'])) {
131+
$routeCollection->addCollection($this->fileLoader->load('docs.php'));
132+
}
133+
131134
$routeCollection->addCollection($this->fileLoader->load('genid.php'));
132135
$routeCollection->addCollection($this->fileLoader->load('errors.php'));
133136

0 commit comments

Comments
 (0)