Skip to content

Can't deserialize previously normalized empty Email #53664

@hunhejj

Description

@hunhejj

Symfony version(s) affected

6.4.0

Description

When trying to deserialize an empty email I get the following exception:

Symfony\Component\Serializer\Exception\NotNormalizableValueException: The type of the "message" attribute for class "Symfony\Component\Mime\Email" must be one of "iterable", "string" ("null" given).

The exception trace is:

symfony/serializer/Exception/NotNormalizableValueException.php:32
symfony/serializer/Normalizer/AbstractObjectNormalizer.php:616
symfony/serializer/Normalizer/AbstractObjectNormalizer.php:382
symfony/serializer/Normalizer/MimeMessageNormalizer.php:107
symfony/serializer/Serializer.php:247

How to reproduce

Normalized data:

[
    'text' => null,
    'textCharset' => null,
    'html' => null,
    'htmlCharset' => null,
    'attachments' => [],
    'cachedBody' => null,
    'headers' => [],
    'body' => null,
    'message' => null,
]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions