Skip to content

Commit 7fd031f

Browse files
committed
fix: upgrade guide for 3.4
1 parent c97f0f9 commit 7fd031f

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

core/upgrade-guide.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,52 @@
11
# Upgrade Guide
22

3+
## API Platform 3.4
4+
5+
Remove the `keep_legacy_inflector`, the `event_listeners_backward_compatibility_layer` and the `rfc_7807_compliant_errors` flag:
6+
7+
```diff
8+
api_platform:
9+
- event_listeners_backward_compatibility_layer: false
10+
- keep_legacy_inflector: false
11+
extra_properties:
12+
standard_put: true
13+
- rfc_7807_compliant_errors: true
14+
```
15+
16+
If you use a custom normalizer for validation exception use:
17+
18+
```yaml
19+
api_platform:
20+
validator:
21+
legacy_validation_exception: true
22+
```
23+
24+
Indeed, we will throw another validation class in API Platform 4 we will throw `ApiPlatform\Validator\Exception\ValidationException` instead of `ApiPlatform\Symfony\Validator\Exception\ValidationException`
25+
26+
It's really important to add the `use_symfony_listeners` flag, set to `true` if you use Symfony listeners or controllers:
27+
28+
```yaml
29+
api_platform:
30+
use_symfony_listeners: false
31+
```
32+
33+
The `keep_legacy_inflector` flag will be removed from API Platform 4, you need to fix your issues first. In API Platform 3.4, the Inflector is available as a service that you can configure through:
34+
35+
```yaml
36+
api_platform:
37+
inflector: api_platform.metadata.inflector
38+
```
39+
40+
Implement the `ApiPlatform\Metadata\InflectorInterface` if you need to tweak its behavior.
41+
42+
We added an `hydra_prefix` configuration as the `hydra:` prefix will be removed by default in API Platform 4:
43+
44+
```yaml
45+
api_platform:
46+
serializer:
47+
hydra_prefix: false
48+
```
49+
350
## API Platform 3.1/3.2
451

552
This is the recommended configuration for API Platform 3.2. We review each of these changes in this document.

0 commit comments

Comments
 (0)