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: core/operations.md
+78Lines changed: 78 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -637,6 +637,84 @@ Or in XML:
637
637
It is mandatory to set the `method`, `path` and `controller` attributes. They allow API platform to configure the routing path and
638
638
the associated controller respectively.
639
639
640
+
#### Serialization Groups
641
+
642
+
You may want different serialization groups for your custom operations. Just configure the proper `normalization_context` and/or `denormalization_context`in your operation:
643
+
644
+
```php
645
+
<?php
646
+
// src/Entity/Book.php
647
+
648
+
use ApiPlatform\Core\Annotation\ApiResource;
649
+
use App\Controller\BookSpecial;
650
+
use Symfony\Component\Serializer\Annotation\Groups;
0 commit comments