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
IMO there is no way to add required data to JSON-serialized structure so deserializer would know about inheritance. This kind of (de)serialization is used e.g. in APIs and clients' won't send such kind of data - and they shouldn't because JSON structure should be fully explicit and deserializable without it ("natively" or with custom DenormalizerInterface implementation).
Symfony version(s) affected: 5.x and most likely earlier versions
Description
The
Serializer::serialize()
withJsonEncoder
don't care about child classes which causes issues when deserializing. See #33394How to reproduce
The wrapper should contain a
Fox
, not anAnimal
.The text was updated successfully, but these errors were encountered: