-
-
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
Added default_skip_when_empty option as config using the exclusionStrategy #1257
base: master
Are you sure you want to change the base?
Added default_skip_when_empty option as config using the exclusionStrategy #1257
Conversation
e0adc9d
to
25ca44d
Compare
Hi, thanks for the PR. I like the idea, but I'm not sure that works as expected. IMO it will skip all the props when enabled. To check it, can you please also add few props in |
@goetas , you were right. After adding the test tests/Fixtures/ObjectWithEmptyArrayAndHashNotAnnotated.php i realized where was the mistake. i came to this implementation, which seems cleaner in my view. I considering the:
Maybe there are any other ideas that i haven't thought about ? |
Hi @goetas Do you think we could go forward with this pull request, or are there any other concerns that i could fix ? Thanks! |
…ategy approach Updated documentation
Adjusted the tests for the expected behaviour
…also * Adapted the getExclusionStrategy (in the Context.php) to return DisjunctionExclusionStratgy interface so it could also accept calls to methods with other interfaces beside the ExclusionStrategyInterface * Null value could be eventually adapted also with this kind of Exclusion strategy
…Strategy * Removed unneeded @todo
a450158
to
4c230d2
Compare
Hi @goetas i've rebased the pull-request branch. I'll check if i can improve/lower the complexity reported for |
Extended the context to include the option to enable SkipWhenEmpty as a default behaviour for properties.
The ExclusionStrategy approach was used to enable this.
It is also related to schmittjoh/JMSSerializerBundle#789 And I will prepare a pull request for that repo. also when this will be merged