mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Add exceptions in the upgrading command to warn about the requirement to run it on 2.x (#1501)
This commit is contained in:
parent
92dfcc41a4
commit
2c504cdd98
@ -12,7 +12,7 @@ for your APIs.
|
||||
|
||||
## Migrate from 2.x to 3.0
|
||||
|
||||
[To migrate from 2.x to 3.0, just follow our guide.](https://github.com/nelmio/NelmioApiDocBundle/blob/master/UPGRADE-3.0.md)
|
||||
[To migrate from 2.x to 3.0, follow our guide.](https://github.com/nelmio/NelmioApiDocBundle/blob/master/UPGRADE-3.0.md)
|
||||
|
||||
## Installation
|
||||
|
||||
|
@ -44,6 +44,14 @@ class SwaggerDocblockConvertCommand extends ContainerAwareCommand
|
||||
{
|
||||
$views = explode(',', $input->getOption('views'));
|
||||
|
||||
if (!$this->getContainer()->has('nelmio_api_doc.extractor.api_doc_extractor')) {
|
||||
if (!$this->getContainer()->has('nelmio_api_doc.controller.swagger_ui')) {
|
||||
throw new \RuntimeException('NelmioApiDocBundle is not installed. Please run `composer require nelmio/api-doc-bundle`.');
|
||||
} else {
|
||||
throw new \RuntimeException('This command only works with NelmioApiDocBundle 2.x installed while version 3.x is currently installed. Please downgrade to 2.x to execute this command and bump your constraint only after its execution.');
|
||||
}
|
||||
}
|
||||
|
||||
$extractor = $this->getContainer()->get('nelmio_api_doc.extractor.api_doc_extractor');
|
||||
|
||||
$apiDocs = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user