|
1 | 1 | # Upgrade Guide
|
2 | 2 |
|
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 |
4 | 27 |
|
5 | 28 | - New Resource metadata allowing to declare multiple Resources on a class: `ApiPlatform\Metadata\ApiResource`
|
6 | 29 | - Clarification of some properties within the ApiResource declaration
|
@@ -96,7 +119,7 @@ is the same as
|
96 | 119 | ])]
|
97 | 120 | ```
|
98 | 121 |
|
99 |
| -### Detailed metadata changes |
| 122 | +### Metadata changes |
100 | 123 |
|
101 | 124 | #### #[ApiResource]
|
102 | 125 |
|
@@ -132,7 +155,7 @@ class Book
|
132 | 155 |
|
133 | 156 | Will compute: `builtinTypes: ['string', Isbn::class]`
|
134 | 157 |
|
135 |
| -## Versions 2.7 and 3.0 |
| 158 | +### The `metadata_backward_compatibility_layer` flag |
136 | 159 |
|
137 | 160 | In 2.7 the `metadata_backward_compatibility_layer` flag is set to `true`.
|
138 | 161 | This means that all the legacy services will still work just as they used
|
|
0 commit comments