Skip to content

Commit 878c537

Browse files
author
RJ Garcia
committed
Updating docs and deps, Opt In Configuration
- Supported SF 5.x, bumped min sf requirement to 4.4 Signed-off-by: RJ Garcia <rj@stadiumgoods.com>
1 parent fee3a77 commit 878c537

4 files changed

Lines changed: 19 additions & 17 deletions

File tree

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015-2017 BigHead Technology
1+
Copyright (c) 2015-2020 RJ Garcia
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Install with composer at `krak/api-platform-extra`.
88

99
## Usage
1010

11+
By default all functionality provided by this library is *opt-in*, so you'll need to explicitly enable each feature in the config to make use of the features.
12+
1113
### MessageBusDataPersister
1214

1315
The message bus data persister is enabled by default and controlled via the following config:
@@ -90,6 +92,11 @@ The actual POST API request for this would look like:
9092
}
9193
```
9294

95+
```yaml
96+
api_platform_extra:
97+
enable_constructor_deserialization: true
98+
```
99+
93100
### Operation Resource Classes
94101

95102
This feature is controlled via the following configuration:

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"authors": [
1515
{
1616
"name": "RJ Garcia",
17-
"email": "rj@bighead.net"
17+
"email": "ragboyjr@icloud.com"
1818
}
1919
],
2020
"autoload": {
@@ -24,10 +24,10 @@
2424
},
2525
"require": {
2626
"api-platform/core": "^2.3",
27-
"symfony/config": "^4.0",
28-
"symfony/dependency-injection": "^4.0",
29-
"symfony/http-kernel": "^4.0",
30-
"symfony/yaml": "^4.0"
27+
"symfony/config": "^4.4|^5.0",
28+
"symfony/dependency-injection": "^4.4|^5.0",
29+
"symfony/http-kernel": "^4.4|^5.0",
30+
"symfony/yaml": "^4.4|^5.0"
3131
},
3232
"require-dev": {
3333
"symfony/messenger": "^4.1",

src/DependencyInjection/Configuration.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,23 @@
77

88
class Configuration implements ConfigurationInterface
99
{
10-
/**
11-
* Generates the configuration tree builder.
12-
*
13-
* @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
14-
*/
1510
public function getConfigTreeBuilder() {
16-
$treeBuilder = new TreeBuilder();
17-
$rootNode = $treeBuilder->root('api_platform_extra');
11+
$treeBuilder = new TreeBuilder('api_platform_extra');
1812

13+
$rootNode = $treeBuilder->getRootNode();
1914
$rootNode
2015
->children()
2116
->booleanNode('enable_message_bus_data_persister')
22-
->defaultTrue()
17+
->defaultFalse()
2318
->end()
2419
->booleanNode('enable_operation_resource_class')
25-
->defaultTrue()
20+
->defaultFalse()
2621
->end()
2722
->booleanNode('enable_constructor_deserialization')
28-
->defaultTrue()
23+
->defaultFalse()
2924
->end()
3025
->booleanNode('enable_overriding_annotation_property_metadata_factory')
31-
->defaultTrue()
26+
->defaultFalse()
3227
->end()
3328
->scalarNode('additional_swagger_path')
3429
->defaultValue('%kernel.project_dir%/config/api_platform/swagger.yaml')

0 commit comments

Comments
 (0)