Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[FrameworkBundle] Fix passingserializer.default_context option to normalizers#47637

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

Merged
nicolas-grekas merged 1 commit intosymfony:5.4fromwuchen90:fix-serializer
Sep 29, 2022

Conversation

@wuchen90
Copy link
Contributor

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
LicenseMIT

Thedefault_context config option underserializer of FrameworkBundle isn't taken into account when usingSymfony\Component\Serializer\Normalizer\ObjectNormalizer.
Maybe it's the case for other serializers but let's fix one at a time.

@wuchen90
Copy link
ContributorAuthor

Related to#47012

@nicolas-grekasnicolas-grekas changed the title[Serializer] FixObjectNormalizer that doesn't usedefault_context config option[FrameworkBundle] Fix passingserializer.default_context option to normalizersSep 28, 2022
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

(I fixed the other normalizers that had the same issue)

/cc@soyuka@dunglas

default_context:
enable_max_depth:true
# The option below is used in \Symfony\Bundle\FrameworkBundle\Tests\Functional\SerializerTest::testObjectNormalizerUsesDefaultContextConfigOption
# to assert that the `default_context` is taken into account in serializers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The test itself should be enough to spot any issue quickly so I'm not sure this is useful

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You're right.
Maybe do I need to change the test to take into account the other normalizers that have the same behavior with$defaultContext since@nicolas-grekas has fixed them too?

Copy link
Member

@nicolas-grekasnicolas-grekasSep 29, 2022
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

that'd be nice if you can yes !

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Done.
I changed the tests to target all normalizers and encoders that are taggedserializer.normalizer orserializer.encoder and that have the argument$defautContext in their constructor, the same as whatSerializerPass does.

@wuchen90wuchen90 changed the title[FrameworkBundle] Fix passingserializer.default_context option to normalizers[FrameworkBundle] Fix passingserializer.default_context option to normalizers and encodersSep 29, 2022
@wuchen90wuchen90 changed the title[FrameworkBundle] Fix passingserializer.default_context option to normalizers and encoders[FrameworkBundle] Fix passingserializer.default_context option to normalizersSep 29, 2022
@nicolas-grekas
Copy link
Member

Thank you@wuchen90.

@nicolas-grekasnicolas-grekas merged commita5f8bb2 intosymfony:5.4Sep 29, 2022
@wuchen90wuchen90 deleted the fix-serializer branchSeptember 29, 2022 10:07
This was referencedSep 30, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@chalasrchalasrchalasr approved these changes

+1 more reviewer

@HeahDudeHeahDudeHeahDude left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

5 participants

@wuchen90@nicolas-grekas@chalasr@HeahDude@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp