feat(exclusion): add new option "inheritedGroups" into GroupExclusionStrategy#1474
feat(exclusion): add new option "inheritedGroups" into GroupExclusionStrategy#1474Xen3r0 wants to merge 2 commits into
Conversation
scyzoryck
left a comment
There was a problem hiding this comment.
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 ? |
|
|
||
| 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.
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.
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_groupsin Context.php ?