private function configureRouter(ArrayNodeDefinition $root)
 {
     $root->addDefaultsIfNotSet();
     $root->treatNullLike(['endpoints' => []]);
     /** @var ArrayNodeDefinition $proto */
     $endpoints = $root->children()->arrayNode('endpoints');
     $proto = $endpoints->prototype('array');
     $proto->append((new ScalarNodeDefinition('path'))->isRequired()->example('/')->cannotBeEmpty()->info('Endpoint URI'));
     $proto->append((new ArrayNodeDefinition('resources'))->beforeNormalization()->ifNull()->then(function () {
         return [];
     })->ifString()->then(function ($v) {
         return [$v];
     })->end()->prototype('scalar')->end()->example('rpc.yml')->info('Route definitions'));
     $proto->append(new VariableNodeDefinition('defaults'));
     $proto->append((new VariableNodeDefinition('context'))->beforeNormalization()->ifString()->then(function ($v) {
         return [$v];
     })->end()->defaultValue(['Default'])->info('Endpoint-wide context')->example(['Default']));
     $endpoints->useAttributeAsKey('name');
     $proto->addDefaultsIfNotSet();
 }