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

[Serializer] Fix unexpected allowed attributes#52917

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
fabpot merged 1 commit intosymfony:5.4frommtarld:fix/allowed-attributes
Apr 8, 2024

Conversation

mtarld
Copy link
Contributor

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
IssuesFix#52673#49710
LicenseMIT

A more accurate approach than#52680

@mtarld
Copy link
ContributorAuthor

fabbot errors aren't related to that PR.

@mtarldmtarldforce-pushed thefix/allowed-attributes branch from6839596 to9a3d2beCompareDecember 6, 2023 17:39
Copy link
Member

@chalasrchalasr left a comment

Choose a reason for hiding this comment

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

As discussed at SymfonyCon, the information (access type) would better transit through a method parameter than a context option since the need is specific to the abstract method at hand

mtarld reacted with thumbs up emoji
@mtarldmtarldforce-pushed thefix/allowed-attributes branch 2 times, most recently from8f93524 toee9ccdeCompareDecember 12, 2023 13:27
@mtarld
Copy link
ContributorAuthor

Once this PR will be upmerged to 7.1, I'll create a new one to trigger the proper deprecations.

chalasr reacted with thumbs up emoji

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment
edited
Loading

Choose a reason for hiding this comment

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

The implementation fits the definition of a new feature to me: adding an argument on a constructor, and adding an argument on public/protected methods.
This should come with an@param annotation for methods, and this will yield a new deprecation.
Maybe another approach is possible? I don't know at all :)

@chalasr
Copy link
Member

That read/write mode do need to be passed throughout method calls to fix the bug at hand, so the plan here is to make it a parameter that's hidden at first on 5.4, then make it virtual on 7.1 and finally make it real on 8.0.
The only alternative I can think of is to put the info in$context instead.

@mtarld would that work conceptually and technically?

@mtarldmtarldforce-pushed thefix/allowed-attributes branch 2 times, most recently frome5df998 to46f78a9CompareFebruary 8, 2024 08:18
@mtarld
Copy link
ContributorAuthor

It appears that it works indeed, and it is much better thanks!

I'm wondering if we should make that read/write information explicit in 7.1, maybe a context value like here is enough (but it is less secure).

@fabpot
Copy link
Member

Thank you@mtarld.

@fabpotfabpot merged commit49e9184 intosymfony:5.4Apr 8, 2024
@mtarldmtarld deleted the fix/allowed-attributes branchApril 8, 2024 11:20
This was referencedApr 29, 2024
xabbuh added a commit to xabbuh/symfony that referenced this pull requestApr 30, 2024
The PropertyNormalizer does not handle a property info extractor. It lookslike the argument was accidentally added to instead of the ObjectNormalizerinsymfony#52917.
xabbuh added a commit to xabbuh/symfony that referenced this pull requestApr 30, 2024
The PropertyNormalizer does not handle a property info extractor. It lookslike the argument was accidentally added to instead of the ObjectNormalizerinsymfony#52917.
xabbuh added a commit to xabbuh/symfony that referenced this pull requestApr 30, 2024
The PropertyNormalizer does not handle a property info extractor. It lookslike the argument was accidentally added to instead of the ObjectNormalizerinsymfony#52917.
xabbuh added a commit to xabbuh/symfony that referenced this pull requestApr 30, 2024
The PropertyNormalizer does not handle a property info extractor. It lookslike the argument was accidentally added to instead of the ObjectNormalizerinsymfony#52917.
xabbuh added a commit to xabbuh/symfony that referenced this pull requestApr 30, 2024
The PropertyNormalizer does not handle a property info extractor. It lookslike the argument was accidentally added to instead of the ObjectNormalizerinsymfony#52917.
chalasr added a commit that referenced this pull requestMay 1, 2024
…or to the ObjectNormalizer (xabbuh)This PR was merged into the 5.4 branch.Discussion----------[FrameworkBundle] move wiring of the property info extractor to the ObjectNormalizer| Q             | A| ------------- | ---| Branch?       | 5.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        || License       | MITThe PropertyNormalizer does not handle a property info extractor. It looks like the argument was accidentally added to instead of the ObjectNormalizer in#52917.Commits-------518bc28 move wiring of the property info extractor to the ObjectNormalizer
derrabus added a commit that referenced this pull requestMay 2, 2024
… setters with optional args (HypeMC)This PR was merged into the 5.4 branch.Discussion----------[Serializer] Fix `GetSetMethodNormalizer` not working with setters with optional args| Q             | A| ------------- | ---| Branch?       | 5.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        |Fix#54784| License       | MITPrior to#52917 setters could have an optional argument or even multiple ones. This restores the previous behavior.Commits-------74bc0eb [Serializer] Fix `GetSetMethodNormalizer` not working with setters with optional args
@stloyd
Copy link
Contributor

Those changes generate a big performance drop in one of the projects I work with where we extensively use attributes on DTOs.

Comparing Serializer in version7.0.6 vs7.0.7:
Zrzut ekranu 2024-05-6 o 16 27 33
Zrzut ekranu 2024-05-6 o 16 27 17

@nicolas-grekas
Copy link
Member

Please open a dedicated issue if you want any follow up.

fabpot added a commit that referenced this pull requestJun 16, 2024
…peMC)This PR was merged into the 5.4 branch.Discussion----------[Serializer] Fix `ObjectNormalizer` with property path| Q             | A| ------------- | ---| Branch?       | 5.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        |Fix#54983| License       | MITCaused by#52917.The `ObjectNormalizer::isAllowedAttribute()` method doesn't work with property paths, this is an attempt to fix the problem.Commits-------3857545 [Serializer] Fix `ObjectNormalizer` with property path
symfonyaml pushed a commit to symfonyaml/symfony that referenced this pull requestOct 21, 2024
The PropertyNormalizer does not handle a property info extractor. It lookslike the argument was accidentally added to instead of the ObjectNormalizerinsymfony#52917.
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

@maxheliasmaxheliasmaxhelias approved these changes

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

@chalasrchalasrAwaiting requested review from chalasr

Assignees
No one assigned
Projects
None yet
Milestone
5.4
Development

Successfully merging this pull request may close these issues.

8 participants
@mtarld@chalasr@nesl247@fabpot@stloyd@nicolas-grekas@maxhelias@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp