-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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! |
2f7bd21
to
7965469
Compare
I added a test case |
friendly ping @mtarld as you are deeply involved in the serializer component, thanks! |
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?
7965469
to
0f3de45
Compare
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`.
0f3de45
to
4a728f7
Compare
Thank you @andersonamuller. |
When denormalizing properties with a plain
object
type without a class theObjectNormalizer
would fail with aTypeError
.