Custom Serialization
Dapr uses JSON serialization and thus (complex) type information is lost when sending/receiving data.
This works for any type that we have full ownership over, however, it doesn’t work for classes from libraries or PHP itself. For that, you need to register a custom serializer with the DI container:
<?php
// in config.php
{
public function serialize(mixed $value,\Dapr\Serialization\ISerializer $serializer) : mixed
{
}
return [