Skip to content

Commit 5a3bacd

Browse files
NGSTACK-1017 move features configuration nodes under parent array node named features
1 parent 49a90b5 commit 5a3bacd

2 files changed

Lines changed: 29 additions & 20 deletions

File tree

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ Configuration (config/packages/api_platform_extras.yaml):
44

55
```yaml
66
api_platform_extras:
7-
http_cache: { enabled: false }
8-
schema_decoration: { enabled: false }
9-
simple_normalizer: { enabled: false }
10-
jwt_refresh: { enabled: false }
11-
iri_template_generator: { enabled: false }
7+
features:
8+
http_cache: { enabled: false }
9+
schema_decoration: { enabled: false }
10+
simple_normalizer: { enabled: false }
11+
jwt_refresh: { enabled: false }
12+
iri_template_generator: { enabled: false }
13+
schema_processor: { enabled: false }
1214
```
1315
1416
Enable features by setting the corresponding flag to true.

src/DependencyInjection/Configuration.php

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Symfony\Component\Config\Definition\ConfigurationInterface;
99
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
1010

11-
final class Configuration implements ConfigurationInterface
11+
final readonly class Configuration implements ConfigurationInterface
1212
{
1313
public function __construct(private ExtensionInterface $extension) {}
1414

@@ -19,20 +19,27 @@ public function getConfigTreeBuilder(): TreeBuilder
1919

2020
$rootNode
2121
->children()
22-
->arrayNode('http_cache')
23-
->canBeEnabled()
24-
->end()
25-
->arrayNode('schema_decoration')
26-
->canBeEnabled()
27-
->end()
28-
->arrayNode('simple_normalizer')
29-
->canBeEnabled()
30-
->end()
31-
->arrayNode('jwt_refresh')
32-
->canBeEnabled()
33-
->end()
34-
->arrayNode('iri_template_generator')
35-
->canBeEnabled()
22+
->arrayNode('features')
23+
->children()
24+
->arrayNode('http_cache')
25+
->canBeEnabled()
26+
->end()
27+
->arrayNode('schema_decoration')
28+
->canBeEnabled()
29+
->end()
30+
->arrayNode('simple_normalizer')
31+
->canBeEnabled()
32+
->end()
33+
->arrayNode('jwt_refresh')
34+
->canBeEnabled()
35+
->end()
36+
->arrayNode('iri_template_generator')
37+
->canBeEnabled()
38+
->end()
39+
->arrayNode('schema_processor')
40+
->canBeEnabled()
41+
->end()
42+
->end()
3643
->end()
3744
->end();
3845

0 commit comments

Comments
 (0)