Skip to content

Commit

Permalink
Updating docs and deps, Opt In Configuration
Browse files Browse the repository at this point in the history
- Supported SF 5.x, bumped min sf requirement to 4.4

Signed-off-by: RJ Garcia <rj@stadiumgoods.com>
  • Loading branch information
RJ Garcia committed Dec 30, 2020
1 parent fee3a77 commit 878c537
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015-2017 BigHead Technology
Copyright (c) 2015-2020 RJ Garcia

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Install with composer at `krak/api-platform-extra`.

## Usage

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.

### MessageBusDataPersister

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

```yaml
api_platform_extra:
enable_constructor_deserialization: true
```

### Operation Resource Classes

This feature is controlled via the following configuration:
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"authors": [
{
"name": "RJ Garcia",
"email": "rj@bighead.net"
"email": "ragboyjr@icloud.com"
}
],
"autoload": {
Expand All @@ -24,10 +24,10 @@
},
"require": {
"api-platform/core": "^2.3",
"symfony/config": "^4.0",
"symfony/dependency-injection": "^4.0",
"symfony/http-kernel": "^4.0",
"symfony/yaml": "^4.0"
"symfony/config": "^4.4|^5.0",
"symfony/dependency-injection": "^4.4|^5.0",
"symfony/http-kernel": "^4.4|^5.0",
"symfony/yaml": "^4.4|^5.0"
},
"require-dev": {
"symfony/messenger": "^4.1",
Expand Down
17 changes: 6 additions & 11 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,23 @@

class Configuration implements ConfigurationInterface
{
/**
* Generates the configuration tree builder.
*
* @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
*/
public function getConfigTreeBuilder() {
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('api_platform_extra');
$treeBuilder = new TreeBuilder('api_platform_extra');

$rootNode = $treeBuilder->getRootNode();
$rootNode
->children()
->booleanNode('enable_message_bus_data_persister')
->defaultTrue()
->defaultFalse()
->end()
->booleanNode('enable_operation_resource_class')
->defaultTrue()
->defaultFalse()
->end()
->booleanNode('enable_constructor_deserialization')
->defaultTrue()
->defaultFalse()
->end()
->booleanNode('enable_overriding_annotation_property_metadata_factory')
->defaultTrue()
->defaultFalse()
->end()
->scalarNode('additional_swagger_path')
->defaultValue('%kernel.project_dir%/config/api_platform/swagger.yaml')
Expand Down

0 comments on commit 878c537

Please sign in to comment.