Skip to content

[Serializer] Fix serializer normalize attribute context #50015

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
Apr 14, 2023

Conversation

akalineskou
Copy link
Contributor

Q A
Branch? 6.2
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #...
License MIT
Doc PR symfony/symfony-docs#...

Before 6.2.8 property attribute#[Context(normalizationContext: [AbstractObjectNormalizer::SKIP_NULL_VALUES => true])] was working correctly

Before this PR #49525 updateData was using the $attributeContext but it got changed to using $context (which ignored the attribute context)

Fixed the testNormalizeUsesContextAttributeForPropertiesInConstructorWithSerializedPath test also since Context attribute class was never used in the file (the date was still in d-m-Y format when the format key was m-d-Y)

Would have ported it to 5.4, but it was not added in that branch.
Latest commit for this file in 5.4

$data = $this->updateData($data, $attribute, $attributeValue, $class, $format, $attributeContext);

@nicolas-grekas nicolas-grekas force-pushed the 6.2-serializer-context-fix branch from 7f6869d to 942a184 Compare April 14, 2023 08:14
@nicolas-grekas
Copy link
Member

Thank you @akalineskou.

@nicolas-grekas nicolas-grekas merged commit 531fb00 into symfony:6.2 Apr 14, 2023
@akalineskou akalineskou deleted the 6.2-serializer-context-fix branch April 14, 2023 10:44
@fabpot fabpot mentioned this pull request Apr 28, 2023
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.

3 participants