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
When attempting to denormalize an array of data into a readonly object using the PropertyNormalizer within a Serializer, a \TypeError exception is thrown.
Given that the following flags are set in the context:
I would have expected a PartialDenormalizationException instead. Is this the intended behavior?
How to reproduce
I made a small boilerplate to reproduce the bug HERE
Possible Solution
To address the issue, we should wrap the code in a try/catch block that catches the \TypeError and rethrows it as an InvalidTypeException.
In my REPRODUCER, I added two tests to demonstrate the fix: one is a temporary workaround that I'm currently using, and the other represents the solution I believe should be the definitive fix.