Skip to content

Commit ab79d36

Browse files
authored
Merge pull request #3802 from deguif/lazy-load-command
Lazy load SwaggerCommand
2 parents fba4b1a + a9e108d commit ab79d36

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
*/
3434
final class SwaggerCommand extends Command
3535
{
36+
protected static $defaultName = 'api:swagger:export';
37+
3638
private $normalizer;
3739
private $resourceNameCollectionFactory;
3840
private $apiTitle;
@@ -67,8 +69,6 @@ public function __construct(NormalizerInterface $normalizer, ResourceNameCollect
6769
protected function configure()
6870
{
6971
$this
70-
->setName('api:openapi:export')
71-
->setAliases(['api:swagger:export'])
7272
->setDescription('Dump the OpenAPI documentation')
7373
->addOption('yaml', 'y', InputOption::VALUE_NONE, 'Dump the documentation in YAML')
7474
->addOption('spec-version', null, InputOption::VALUE_OPTIONAL, sprintf('OpenAPI version to use (%s)', implode(' or ', $this->swaggerVersions)), $this->swaggerVersions[0] ?? 2)

src/Bridge/Symfony/Bundle/Resources/config/swagger.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
<argument>null</argument>
5151
<argument>%api_platform.swagger.versions%</argument>
5252
<tag name="console.command" />
53+
<tag name="console.command" command="api:openapi:export" />
5354
</service>
5455

5556
</services>

0 commit comments

Comments
 (0)