Skip to content

Commit

Permalink
feat(config): allow to disable api platform support
Browse files Browse the repository at this point in the history
  • Loading branch information
r-pierre-viously committed Nov 19, 2024
1 parent 9411e9c commit 54d3a9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public function getConfigTreeBuilder(): TreeBuilder
->info('If true, `groups` passed to @Model annotations will be used to limit validation constraints')
->defaultFalse()
->end()
->booleanNode('api_platform_support')
->info('If false, the service declaration that support ApiPlatform will not be loaded even if ApiPlatform is detected in your installation')
->defaultTrue()
->end()
->arrayNode('cache')
->validate()
->ifTrue(function ($v) { return null !== $v['item_id'] && null === $v['pool']; })
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/NelmioApiDocExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public function load(array $configs, ContainerBuilder $container): void
}

// ApiPlatform support
if (isset($bundles['ApiPlatformBundle']) && class_exists('ApiPlatform\Documentation\Documentation')) {
if ($config['api_platform_support'] && isset($bundles['ApiPlatformBundle']) && class_exists('ApiPlatform\Documentation\Documentation')) {
$loader->load('api_platform.xml');
}

Expand Down

0 comments on commit 54d3a9b

Please sign in to comment.