-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
Support for changing default policy #427
Conversation
👎 a third party bundle can't define which exclusion policy to use by default so this would create bugs. |
@GuilhemN can you elaborate a bit more? i was thinking to include schmittjoh/serializer#683 sooner of later... |
@goetas if you use a bundle that defines entities and depends on the jms serializer, it won't know the default policy and its entities won't be serialized as expected. |
but isn't an user choice the default exclusion strategy? are you worried that the user decides to use a too strict exclusion strategy that can create unexpected behaviors with other bundles that acts as plugins with the serializer? |
@goetas yes, that's it. Moreover these unexpected behaviors won't be easy to catch. |
I see your point. not sure what to do here then 😕 since i see also some advantages in it |
Maybe you can allow to configure this for each bundle, or in each file? |
currently this is a "per project feature" so can be enabled per any variation of the
if you mean "per entity", this is already possible per bundle, looks a bit weird.. if you are thinking something as https://symfony.com/doc/current/reference/configuration/assetic.html (per bundle enabler, i find is really weird in this case) |
I was thinking about the yaml configuration files, it could be possible to add something on top of it. But I don't know if that's worth it, and if it won't look hacky. Otherwise, as you proposed, you can configure this at the project level with a proper warning but it looks like a technical debt to me as it might break at any time. |
Closing, merging this will lead to unexpected behaviors since will be possible to change defaults at runtime. Third party libraries will not have a consistent default. thanks @GuilhemN for the hint :) |
For use with FOS rest bundle supporting defensive programming not exposing everything in services.