-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Description
Symfony version(s) affected
7.1-RC1
Description
The Serializer component switched to the new TypeInfo component and now our serialization breaks:
Symfony\Component\TypeInfo\Exception\LogicException : Cannot get base type on "int|string" compound type.
How to reproduce
final readonly class AddToCart
{
/**
* @param array<string, string|int> $metadata
*/
public function __construct(
public string $cartId,
public array $metadata,
) {}
}
Symfony\Component\TypeInfo\Exception\LogicException : Cannot get base type on "int|string" compound type.
/Volumes/CS/www/cosmos/vendor/symfony/type-info/Type/UnionType.php:48
/Volumes/CS/www/cosmos/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:705
/Volumes/CS/www/cosmos/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:830
/Volumes/CS/www/cosmos/vendor/symfony/serializer/Normalizer/AbstractNormalizer.php:371
/Volumes/CS/www/cosmos/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:239
/Volumes/CS/www/cosmos/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:335
/Volumes/CS/www/cosmos/vendor/symfony/serializer/Serializer.php:238
/Volumes/CS/www/cosmos/vendor/symfony/serializer/Serializer.php:143
Possible Solution
No response
Additional Context
No response