Christian Schiffler 5c12ff19de Allow configuration to be split on root key level.
We now allow to split the configuration on multiple files, each
containing one of the various root keys of the "documentation" entry.

This means, you may now split "documentation/*" out to own yml files and
import them.

NOTE: this only allows splitting of entries being a direct child of the
documentation entry, so splitting i.e. the info key over multiple files
will not work.
2017-08-08 19:43:01 +02:00

52 lines
1.6 KiB
PHP

<?php
/*
* This file is part of the NelmioApiDocBundle package.
*
* (c) Nelmio
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Nelmio\ApiDocBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
final class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$treeBuilder
->root('nelmio_api_doc')
->children()
->arrayNode('documentation')
->useAttributeAsKey('key')
->info('The documentation used as base')
->example(['info' => ['title' => 'My App']])
->prototype('variable')->end()
->end()
->arrayNode('routes')
->info('Filter the routes that are documented')
->addDefaultsIfNotSet()
->children()
->arrayNode('path_patterns')
->example(['^/api', '^/api(?!/admin)'])
->prototype('scalar')->end()
->end()
->end()
->end()
->arrayNode('models')
->addDefaultsIfNotSet()
->children()
->booleanNode('use_jms')->defaultFalse()->end()
->end()
->end()
->end();
return $treeBuilder;
}
}