Skip to content

Commit 7659563

Browse files
remove useless config and improve mapping need explaination
1 parent 245b387 commit 7659563

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

core/getting-started.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -196,27 +196,18 @@ resources:
196196
pagination_items_per_page: 25 # optional
197197
```
198198
199-
And tell your configuration how to load it:
199+
If and only if you are using the XML or the YAML, you need to tell API Platform configuration to load it:
200200
201201
```yaml
202202
# api/config/packages/api_platform.yaml
203203
api_platform:
204204
mapping:
205205
paths:
206-
- '%kernel.project_dir%/src/Entity'
207-
- '%kernel.project_dir%/config/api_platform'
206+
- '%kernel.project_dir%/src/Entity' # default configuration for annotations
207+
- '%kernel.project_dir%/config/api_platform' # yaml or xml directory configuration
208208
```
209209
210-
Note that the resources configuration only support the normalization / denormalization context definition in `yaml` and `xml`. To configure the groups of serialization for each attribute, you need to define your groups like you would usually on a standard Symfony project. See the [Symfony doc](https://symfony.com/doc/current/components/serializer.html#attributes-groups).
211-
212-
You might also need to update your framework configuration with this:
213-
214-
``` yaml
215-
# api/config/packages/framework.yaml
216-
framework:
217-
serializer:
218-
enabled: true
219-
```
210+
Note that the resources configuration only support the normalization / denormalization context definition in `YAML` and `XML`. To configure the groups of serialization for each attribute, you need to define your groups like you would usually on a standard Symfony project. See the [Symfony doc](https://symfony.com/doc/current/components/serializer.html#attributes-groups).
220211

221212
**You're done!**
222213

0 commit comments

Comments
 (0)