Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
OskarStark commentedNov 29, 2023
Can you please add test case to avoid further regressions? Thank you! |
andersonamuller commentedNov 29, 2023
I added a test case |
OskarStark commentedNov 30, 2023
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?
andersonamuller commentedDec 1, 2023
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`.
nicolas-grekas commentedDec 1, 2023
Thank you@andersonamuller. |
Uh oh!
There was an error while loading.Please reload this page.
When denormalizing properties with a plain
objecttype without a class theObjectNormalizerwould fail with aTypeError.