processConfiguration(new Configuration(), $configs); $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.xml'); // Filter routes $routeCollectionBuilder = $container->getDefinition('nelmio_api_doc.describers.route.filtered_route_collection_builder'); $routeCollectionBuilder->replaceArgument(0, $config['routes']['path_patterns']); // Import services needed for each library $loader->load('nelmio_apidoc.xml'); if (class_exists(DocBlockFactory::class)) { $loader->load('php_doc.xml'); } if (class_exists(Swagger::class)) { $loader->load('swagger_php.xml'); } if (interface_exists(ParamInterface::class)) { $loader->load('fos_rest.xml'); } $bundles = $container->getParameter('kernel.bundles'); // ApiPlatform support if (isset($bundles['ApiPlatformBundle']) && class_exists('ApiPlatform\Core\Documentation\Documentation')) { $loader->load('api_platform.xml'); } } }