mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 23:59:26 +03:00
Make source folder configurable
This commit is contained in:
parent
3a29c598cc
commit
92c108839c
@ -22,6 +22,7 @@ final class Configuration implements ConfigurationInterface
|
||||
$treeBuilder
|
||||
->root('nelmio_api_doc')
|
||||
->children()
|
||||
->scalarNode('source_folder')->defaultValue('%kernel.root_dir%/../src')->end()
|
||||
->arrayNode('routes')
|
||||
->info('Filter the routes that are documented')
|
||||
->addDefaultsIfNotSet()
|
||||
|
@ -41,6 +41,9 @@ final class NelmioApiDocExtension extends Extension
|
||||
}
|
||||
if (class_exists(Swagger::class)) {
|
||||
$loader->load('swagger_php.xml');
|
||||
|
||||
$swaggerPHPDescriber = $container->getDefinition('nelmio_api_doc.describers.swagger_php');
|
||||
$swaggerPHPDescriber->replaceArgument(0, $config['source_folder']);
|
||||
}
|
||||
if (interface_exists(ParamInterface::class)) {
|
||||
$loader->load('fos_rest.xml');
|
||||
|
@ -62,6 +62,7 @@ class TestKernel extends Kernel
|
||||
|
||||
// Filter routes
|
||||
$c->loadFromExtension('nelmio_api_doc', [
|
||||
'source_folder' => '%kernel.root_dir%',
|
||||
'routes' => [
|
||||
'path_patterns' => ['^/api(?!/admin)'],
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user