-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[Serializer] Fix support of plain object types denormalization #52804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Can you please add test case to avoid further regressions? Thank you! |
I added a test case |
|
friendly ping @mtarld as you are deeply involved in the serializer component, thanks! |
mtarld
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd do instead:
if (Type::BUILTIN_TYPE_OBJECT === $builtinType && null !== $class) {By doing that, it'll fallback to:
if (('is_'.$builtinType)($data)) {And IMHO, it might be better to handle a raw object as a builtin type. WDYT?
Makes sense, I have pushed the change. |
When denormalizing properties with a plain `object` type without a class the `ObjectNormalizer` would fail with a `TypeError`.
|
Thank you @andersonamuller. |
When denormalizing properties with a plain
objecttype without a class theObjectNormalizerwould fail with aTypeError.