Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
Description
Description
Symfony\Component\Serializer\Normalize\PropertyNormalizer
is unable to construct object without any properties due to the check inPropertyNormalizer::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 toSymfony\Component\Serializer\Normalize\GetSetMethodNormalizer
)