Skip to content

Commit 038e505

Browse files
authored
Merge pull request #556 from mikemilano/serialization-yaml
Added serialization config to complete the YAML format example.
2 parents 6839cf2 + cdc551b commit 038e505

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

core/serialization.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,16 @@ App\Entity\Book:
118118
groups: ['write']
119119
```
120120

121+
```yaml
122+
# api/config/serialization/Book.yaml
123+
App\Entity\Book:
124+
attributes:
125+
name:
126+
groups: ['read', 'write']
127+
author:
128+
groups: ['write']
129+
```
130+
121131
In the previous example, the `name` property will be visible when reading (`GET`) the object, and it will also be available
122132
to write (`PUT/POST`). The `author` property will be write-only; it will not be visible when serialized responses are
123133
returned by the API.

0 commit comments

Comments
 (0)