Skip to content

Commit 315e3d1

Browse files
authored
docs(upgrade-guide): new metadata or upgrade? (#1528)
1 parent 43a8a10 commit 315e3d1

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

core/upgrade-guide.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
# Upgrade Guide
22

3-
## What Has Changed Between 2.6 And 2.7?
3+
## API Platform 2.7/3.0
4+
5+
### I want to try the new metadata system
6+
7+
Note that if you want to use the **new metadata system**, you need to set:
8+
9+
```yaml
10+
api_platform:
11+
metadata_backward_compatibility_layer: false
12+
```
13+
14+
This will be the default value in 3.0, in 2.7 it's left to `true` so that nothing breaks by updating.
15+
By doing so you won't get access to legacy services and this will probably break things on code using `api-platform/core:2.6`.
16+
17+
### I'm migrating from 2.6 and want to prepare for 3.0
18+
19+
1. Update the code to 2.7: `composer require api-platform/core:^2.7`
20+
2. Take care of the deprecations and update your code to the new interfaces, documented on this page.
21+
4. Use the [`api:upgrade-resource` command](#the-upgrade-command)
22+
3. Switch the `metadata_backward_compatibility_layer` flag to `false`
23+
24+
## Changes
25+
26+
### Summary of the changes between 2.6 And 2.7/3.0
427

528
- New Resource metadata allowing to declare multiple Resources on a class: `ApiPlatform\Metadata\ApiResource`
629
- Clarification of some properties within the ApiResource declaration
@@ -96,7 +119,7 @@ is the same as
96119
])]
97120
```
98121

99-
### Detailed metadata changes
122+
### Metadata changes
100123

101124
#### #[ApiResource]
102125

@@ -132,7 +155,7 @@ class Book
132155

133156
Will compute: `builtinTypes: ['string', Isbn::class]`
134157

135-
## Versions 2.7 and 3.0
158+
### The `metadata_backward_compatibility_layer` flag
136159

137160
In 2.7 the `metadata_backward_compatibility_layer` flag is set to `true`.
138161
This means that all the legacy services will still work just as they used

0 commit comments

Comments
 (0)