You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Symfony\Component\Serializer\Normalize\PropertyNormalizer is unable to construct object without any properties due to the check in PropertyNormalizer::supportsNormalization.
I don't see any reason to enforce this except for preventing programmers' errors, especially since the ObjectNormalizer does not impose such restrictions.
I can see legit use-cases in places like message queues where all required information is present in the message header and hence the body can be empty.
I'd suggest making this restriction in PropertyNormalizer optional as it removing it entirely could result in backward-incompatible change for very specific configurations (eg. someone might want to fallback to GetSetMethodNormalizer in case PropertyNormalizer fails)
(Similar situation applies to Symfony\Component\Serializer\Normalize\GetSetMethodNormalizer)