diff --git a/README.md b/README.md index 9ede5a7..d67ead1 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md index 3e602e3..a39c300 100644 --- a/UPGRADE-3.0.md +++ b/UPGRADE-3.0.md @@ -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 = [];