mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-09 02:59:27 +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')
|
->root('nelmio_api_doc')
|
||||||
->children()
|
->children()
|
||||||
->scalarNode('name')->defaultValue('API documentation')->end()
|
->scalarNode('name')->defaultValue('API documentation')->end()
|
||||||
|
->booleanNode('on_demand')->defaultTrue()->end()
|
||||||
->arrayNode('sandbox')
|
->arrayNode('sandbox')
|
||||||
->addDefaultsIfNotSet()
|
->addDefaultsIfNotSet()
|
||||||
->children()
|
->children()
|
||||||
|
@ -34,9 +34,12 @@ class NelmioApiDocExtension extends Extension
|
|||||||
|
|
||||||
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
||||||
$loader->load('formatters.xml');
|
$loader->load('formatters.xml');
|
||||||
$loader->load('request_listener.xml');
|
|
||||||
$loader->load('services.xml');
|
$loader->load('services.xml');
|
||||||
|
|
||||||
|
if ($config['on_demand']) {
|
||||||
|
$loader->load('request_listener.xml');
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($config['sandbox']['authentication'])) {
|
if (isset($config['sandbox']['authentication'])) {
|
||||||
$container->setParameter('nelmio_api_doc.sandbox.authentication', $config['sandbox']['authentication']);
|
$container->setParameter('nelmio_api_doc.sandbox.authentication', $config['sandbox']['authentication']);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user