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] AddAbstractNormalizer::IGNORED_GROUPS to make it possible to ignore groups during serialization#57166

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

Open
zim32 wants to merge3 commits intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromzim32:Serializer/IgnoredGroups

Conversation

zim32
Copy link

QA
Branch?7.2
Bug fix?no
New feature?yes
Deprecations?no
Issues-
LicenseMIT

This MR makes it possible to ignore some groups during serialization process.
Sometimes it is very handy to ignore some groups, f.e. when serializing response DTO's.

With currentIgnore attribute it is not possible to ignore some attribute in one context and leave attribute in another context.

With thish MR is it possible to do something like that:

class SomeClass {publicfunction__construct(publicreadonlyint$customerId,        #[Groups(['test-group','ignore'])]publicreadonlyint$token,    )    {    }}// For example I want to ignore `token` attribute when returning http response, but I want it to be present when serializing and saving to the database$this->serializer->serialize($someObject,'json',    [        AbstractNormalizer::IGNORED_GROUPS => ['ignore'],    ]);

valtzu reacted with thumbs up emoji
@fabpotfabpot modified the milestones:7.2,7.3Nov 20, 2024
@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

3 participants
@zim32@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp