You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/mapping/serializer.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,18 @@ use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter
68
68
$autoMapper = AutoMapper::create(nameConverter: new CamelCaseToSnakeCaseNameConverter());
69
69
```
70
70
71
+
It also supports the `Symfony\Component\Serializer\Attribute\SerializedName` attribute.
72
+
73
+
```php
74
+
use Symfony\Component\Serializer\Attribute\SerializedName;
75
+
76
+
class Source
77
+
{
78
+
#[SerializedName('nested')]
79
+
public $nestedProperty;
80
+
}
81
+
```
82
+
71
83
[More information on the Name converters](https://symfony.com/doc/current/components/serializer.html#converting-property-names-when-serializing-and-deserializing)
0 commit comments