Skip to content

Commit 3a43069

Browse files
Enhance yaml-xml serialization groups configuration doc
1 parent b91388f commit 3a43069

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

core/getting-started.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,26 @@ resources:
196196
pagination_items_per_page: 25 # optional
197197
```
198198
199+
And tell your configuration how to load it:
200+
201+
```yaml
202+
# api/config/packages/api_platform.yaml
203+
api_platform:
204+
mapping:
205+
paths: ['%kernel.project_dir%/config/api_platform']
206+
```
207+
208+
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).
209+
210+
You might also need to update your framework configuration with this:
211+
212+
``` yaml
213+
# api/config/packages/framework.yaml
214+
framework:
215+
serializer:
216+
enabled: true
217+
```
218+
199219
**You're done!**
200220

201221
You now have a fully featured API exposing your entities.

0 commit comments

Comments
 (0)