Merge pull request #1074 from nelmio/twig

Remove SwaggerUI controller when TwigBundle is not registered
This commit is contained in:
Guilhem Niot 2017-08-28 21:33:51 +02:00 committed by GitHub
commit e78ee9bda5

View File

@ -88,6 +88,9 @@ final class NelmioApiDocExtension extends Extension implements PrependExtensionI
// ApiPlatform support
$bundles = $container->getParameter('kernel.bundles');
if (!isset($bundles['TwigBundle'])) {
$container->removeDefinition('nelmio_api_doc.controller.swagger_ui');
}
if (isset($bundles['ApiPlatformBundle']) && class_exists('ApiPlatform\Core\Documentation\Documentation')) {
$loader->load('api_platform.xml');
}