From ff931eb564fe11113f83063c6e11be528ac36fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Xavier=20de=20Guillebon?= Date: Wed, 28 Oct 2020 16:14:46 +0100 Subject: [PATCH] Lazy load remaining commands --- src/Bridge/Symfony/Bundle/Command/OpenApiCommand.php | 3 ++- src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Bridge/Symfony/Bundle/Command/OpenApiCommand.php b/src/Bridge/Symfony/Bundle/Command/OpenApiCommand.php index 6bc69f52a86..b89925b0c3d 100644 --- a/src/Bridge/Symfony/Bundle/Command/OpenApiCommand.php +++ b/src/Bridge/Symfony/Bundle/Command/OpenApiCommand.php @@ -29,6 +29,8 @@ */ final class OpenApiCommand extends Command { + protected static $defaultName = 'api:openapi:export'; + private $openApiFactory; private $normalizer; @@ -45,7 +47,6 @@ public function __construct(OpenApiFactoryInterface $openApiFactory, NormalizerI protected function configure() { $this - ->setName('api:openapi:export') ->setDescription('Dump the Open API documentation') ->addOption('yaml', 'y', InputOption::VALUE_NONE, 'Dump the documentation in YAML') ->addOption('output', 'o', InputOption::VALUE_OPTIONAL, 'Write output to file') diff --git a/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php b/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php index 02dfbe45006..ebb80d512fc 100644 --- a/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php +++ b/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php @@ -33,6 +33,8 @@ */ final class SwaggerCommand extends Command { + protected static $defaultName = 'api:swagger:export'; + private $normalizer; private $resourceNameCollectionFactory; private $apiTitle; @@ -67,7 +69,6 @@ public function __construct(NormalizerInterface $normalizer, ResourceNameCollect protected function configure() { $this - ->setName('api:swagger:export') ->setDescription('Dump the Swagger v2 documentation') ->addOption('yaml', 'y', InputOption::VALUE_NONE, 'Dump the documentation in YAML') ->addOption('spec-version', null, InputOption::VALUE_OPTIONAL, sprintf('OpenAPI version to use (%s)', implode(' or ', $this->swaggerVersions)), $this->swaggerVersions[0] ?? 2)