You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually we can only set exclusion_policy: ALL at the class level. When having many classes whith complexe inheritence (vendor package where we can not use annotation), the only way seems actually to create an class yml file for each classes and parent classes to set exclusion_policy: ALL.
This improvement is about adding a global parameters to the builder or context, which will set by exclusion_policy: ALL for all classes.
For instance something like: $context->setExcludePolicyAll(true);
(like we have actually a global way to serialze null value: $context->setSerializeNull(true);)
Thanks
The text was updated successfully, but these errors were encountered:
What i mean is not a global static one, maybe the title is wrong and should be changed.
But more a settings for the context in the actual run for serialization. So it want change other serailization call made by other bundles.
As we can set $context->setSerializeNull(true);, cannot we set something like $context->setExcludePolicyAll(true); ? I missed something ?
the main reason for that is explained in schmittjoh/JMSSerializerBundle#427 (comment) (other projects can not generate metadata about serialized classes, and this library itself started to explore some ideas in #903, and context dependent configurations are a stil a problem)
setSerializeNull was implemented at the very beginning of the creation of this library... NULL handling is always tricky... so I do not know if it was a good idea or not...
Hello,
Actually we can only set exclusion_policy: ALL at the class level. When having many classes whith complexe inheritence (vendor package where we can not use annotation), the only way seems actually to create an class yml file for each classes and parent classes to set exclusion_policy: ALL.
This improvement is about adding a global parameters to the builder or context, which will set by exclusion_policy: ALL for all classes.
For instance something like:
$context->setExcludePolicyAll(true);
(like we have actually a global way to serialze null value:
$context->setSerializeNull(true);
)Thanks
The text was updated successfully, but these errors were encountered: