-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed as not planned
Closed as not planned
Copy link
Description
Symfony version(s) affected
7.2.3
Description
When trying to denormalize an array of data that may contain DateTimeInterface
, the DateTimeNormalizer
is called because it supportsNormalization
for the desired type. But if the input is already the desired type, there is nothing for it to do. It should not throw an error.
How to reproduce
Will respond tomorrow with a reproducer. Filing this before I forget.
Possible Solution
No response
Additional Context
symfony/src/Symfony/Component/Serializer/Normalizer/DateTimeNormalizer.php
Lines 101 to 103 in 5af84c0
if (!\is_string($data) || '' === trim($data)) { | |
throw NotNormalizableValueException::createForUnexpectedDataType('The data is either not an string, an empty string, or null; you should pass a string that can be parsed with the passed format or a valid DateTime string.', $data, ['string'], $context['deserialization_path'] ?? null, true); | |
} |