-
-
Notifications
You must be signed in to change notification settings - Fork 586
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
feat(exclusion): add new option "inheritedGroups" into GroupExclusionStrategy #1474
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your fist contribution!
Could you also update documentation about exclusions about those changes, please?
If you need any help, feel free to catch me!
@scyzoryck @jdreesen can you review again please ? |
@@ -72,7 +72,13 @@ public function initialize(string $format, VisitorInterface $visitor, GraphNavig | |||
$this->metadataStack = new \SplStack(); | |||
|
|||
if (isset($this->attributes['groups'])) { | |||
$this->addExclusionStrategy(new GroupsExclusionStrategy($this->attributes['groups'])); | |||
$strategy = new GroupsExclusionStrategy($this->attributes['groups']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not
$context = // ... get the context somehow
$g = new GroupsExclusionStrategy(['a', 'b'], true);
$context->addExclusionStrategy($g);
?
In that way we do not need to add the enableInheritGroups
method in the context. Ideally the context should know the less possible about the various exclusion strategies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, i see, but i can't add 2 GroupsExclusionStrategy, one with inheritedGroups = false and an another one with inheritedGroups = true.
How can i configure this option with JMSerializerBundle for example ?
Thanks for you help
I like this because it introduces back #1071 in a backward compat way |
Questions :
inherited_groups
in Context.php ?