mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-08 18:49:26 +03:00
Make documentation on demand configurable
This commit is contained in:
parent
6aac4a001e
commit
aa70018abe
@ -23,6 +23,7 @@ class Configuration implements ConfigurationInterface
|
||||
->root('nelmio_api_doc')
|
||||
->children()
|
||||
->scalarNode('name')->defaultValue('API documentation')->end()
|
||||
->booleanNode('on_demand')->defaultTrue()->end()
|
||||
->arrayNode('sandbox')
|
||||
->addDefaultsIfNotSet()
|
||||
->children()
|
||||
|
@ -34,9 +34,12 @@ class NelmioApiDocExtension extends Extension
|
||||
|
||||
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
||||
$loader->load('formatters.xml');
|
||||
$loader->load('request_listener.xml');
|
||||
$loader->load('services.xml');
|
||||
|
||||
if ($config['on_demand']) {
|
||||
$loader->load('request_listener.xml');
|
||||
}
|
||||
|
||||
if (isset($config['sandbox']['authentication'])) {
|
||||
$container->setParameter('nelmio_api_doc.sandbox.authentication', $config['sandbox']['authentication']);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user