Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Serializer] Raise correct exception in ArrayDenormalizer when called without a nested denormalizer #57646

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

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented Jul 4, 2024

Q A
Branch? 7.0
Bug fix? yes
New feature? no
Deprecations? no
Issues N/A
License MIT

The $denormalizer property is not nullable and will be uninitialized by default. Because of that, the check that makes sure that the ArrayDenormalizer is not used before setting a nested denormalizer will produce an obscure error instead of raising the proper exception.

… when it's called without a nested denormalizer
@xabbuh
Copy link
Member

xabbuh commented Jul 4, 2024

I wonder if adding the type without initialising it as null in #51069 wasn't a mistake at all as adding the type this way broke custom normalizers using the DenormalizerAwareTrait (and NormalizerAwareTrait as well).

@derrabus
Copy link
Member Author

derrabus commented Jul 4, 2024

Maybe. But correcting that mistake without a BC break is hard. I think we're good. 😓

@OskarStark OskarStark changed the title [Serializer] Raise correct exception in ArrayDenormalizer when it's called without a nested denormalizer [Serializer] Raise correct exception in ArrayDenormalizer when called without a nested denormalizer Jul 12, 2024
@xabbuh
Copy link
Member

xabbuh commented Jul 17, 2024

Thank you Alexander.

@xabbuh xabbuh merged commit a424932 into symfony:7.0 Jul 17, 2024
8 of 10 checks passed
This was referenced Jul 26, 2024
@derrabus derrabus deleted the bugfix/array-denormalizer-property branch September 19, 2024 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.