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
I have entity Notification and when my entity contain some condition I want add additional groups for serializer, I create event serializer.pre_serialize for Notification and after check condition add additional groups in serialized context, but in response it's not works. Example I want add some nested to my Notification it would be some another Entity, example Question and this entity have some groups, and after set it when I create context SerializationContext::create() everything work, but when I try add additional group in serializer.pre_serialize it's not work
You can not edit the context once the serialization is started. The context should be immutable. In 2.x $attr->set will be removed (to avoid confusion as you are facing)
I have entity
Notification
and when my entity contain some condition I want add additional groups for serializer, I create eventserializer.pre_serialize
forNotification
and after check condition add additional groups in serialized context, but in response it's not works. Example I want add some nested to myNotification
it would be some another Entity, exampleQuestion
and this entity have some groups, and after set it when I create contextSerializationContext::create()
everything work, but when I try add additional group inserializer.pre_serialize
it's not workthis my entity
and another entity which I adding in event
but in response I have
but in response I have
why ?
The text was updated successfully, but these errors were encountered: