Closed
Description
Symfony version(s) affected
7.x
Description
You cannot use the "webhook transport" service since the Serializer component is not installed. Try running "composer require symfony/serializer-pack".
A quick search shows that this line is the only place where the serializer is used in the webhook component.
To be fair I don't think this is a bug, however serializer is not really needed to encode the event payload since it's always array
, json_encode
is fine.
How to reproduce
Create a new SendWebhookMessage
then dispatch it without installing the serializer
Possible Solution
Remove SerializerInterface
and replace
$body = $this->serializer->serialize($event->getPayload(), 'json');
with
$body = \json_encode($event->getPayload());
Additional Context
No response