You are not logged in.
Hello everyone,
Today, during the mORMot2 migration process, I encountered an issue related to JSON serialization and deserialization. I observed a different behavior in mORMot2 compared to mORMot1. To replicate the problem, please note that custom reader and writer procedures are registered for a class, TBase. In mORMot1, all descendants of TBase (TChild = class(TBase)) were serialized and deserialized using these reader and writer procedure. However, this is no longer the case in mORMot2. I now need to register the same reader and writer methods for each descendant.
TJSONSerializer.RegisterClassForJSON(TBase);
TJSONSerializer.RegisterClassForJSON(TChild );
TRttiJson.RegisterCustomSerializerClass(TBase,
TBaseClassJSON.Reader, TBaseClassJSON.Writer);
//in mormot2 this is necessary
TRttiJson.RegisterCustomSerializerClass(TChild ,
TBaseClassJSON.Reader, TBaseClassJSON.Writer);
Is this an unintended issue or an intentional change in mORMot2? It would be beneficial if the behavior in mORMot2 aligns with that of mORMot1, as otherwise, I would need to register the same reader and writer methods separately for all my descendants.
Thanks in Advance
Offline
Hello Arnoud,
any news about this issue?
Regards
Sebastian
Offline