You are not logged in.
I'll try to be brief, and on the spot.
So, this is what I have:
var
fVFSystems: TObjectDictionary<string, TVFSContainer>;
I also call these 2 methods, to make sure mORMot knows the necessary classes:
TJSONSerializer.RegisterClassForJSON(TVFSContainer);
TJSONSerializer.RegisterClassForJSON(TObjectDictionary<string, TVFSContainer>);
Then I call:
MyJSONString := ObjectToJSON(fVFSystems, [woHumanReadable]);
And yet, after the above call, MyJSONString still contains an empty JSON { }.
What am I doing wrong?
Offline
Such kind of generic class are not directly supported.
They are not value objects, and would need a dedicated code for each kind.
For instance, each kind of dictionary would need to be declared.
The only solution is to register your custom serialization for the specific type.
See http://synopse.info/files/html/api-1.18 … SERIALIZER
and http://synopse.info/files/html/Synopse% … ml#TITL_52
Offline