2016-07-12 00:33:55 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
2016-12-29 12:09:26 +01:00
|
|
|
* This file is part of the NelmioApiDocBundle package.
|
2016-07-12 00:33:55 +02:00
|
|
|
*
|
2016-12-29 12:09:26 +01:00
|
|
|
* (c) Nelmio
|
2016-07-12 00:33:55 +02:00
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
2016-12-29 12:09:26 +01:00
|
|
|
namespace Nelmio\ApiDocBundle\DependencyInjection;
|
2016-07-12 00:33:55 +02:00
|
|
|
|
|
|
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
|
|
|
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
|
|
|
|
2016-11-30 15:04:53 +01:00
|
|
|
final class Configuration implements ConfigurationInterface
|
2016-07-12 00:33:55 +02:00
|
|
|
{
|
|
|
|
public function getConfigTreeBuilder()
|
|
|
|
{
|
|
|
|
$treeBuilder = new TreeBuilder();
|
2016-11-30 14:08:10 +01:00
|
|
|
$treeBuilder
|
2016-12-29 12:09:26 +01:00
|
|
|
->root('nelmio_api_doc')
|
2016-11-30 14:08:10 +01:00
|
|
|
->children()
|
2017-01-25 18:53:19 +01:00
|
|
|
->arrayNode('documentation')
|
|
|
|
->info('The documentation used as base')
|
|
|
|
->example(['info' => ['title' => 'My App']])
|
|
|
|
->prototype('variable')->end()
|
|
|
|
->end()
|
2016-11-30 14:08:10 +01:00
|
|
|
->arrayNode('routes')
|
|
|
|
->info('Filter the routes that are documented')
|
|
|
|
->addDefaultsIfNotSet()
|
|
|
|
->children()
|
|
|
|
->arrayNode('path_patterns')
|
2016-12-01 17:25:53 +01:00
|
|
|
->example(['^/api', '^/api(?!/admin)'])
|
2016-11-30 14:08:10 +01:00
|
|
|
->prototype('scalar')->end()
|
|
|
|
->end()
|
|
|
|
->end()
|
|
|
|
->end()
|
|
|
|
->end();
|
|
|
|
|
2016-07-12 00:33:55 +02:00
|
|
|
return $treeBuilder;
|
|
|
|
}
|
|
|
|
}
|