I have an object with some TObjectList <> fields that I am trying to encode as JSON using the SuperObject form.
TLogs = TObjectList<TLog>; TMyObject = class(TObject) private FLogs: TLogs; end;
Inside the SuperObjects code there is a ToClass procedure, iterating over the fields and adding them to the json result.
This loop checks the field type TRttiFields FieldType. If it is zero, it skips the object.
for f in Context.GetType(Value.AsObject.ClassType).GetFields do if f.FieldType <> nil then begin v := f.GetValue(value.AsObject); result.AsObject[GetFieldName(f)] := ToJson(v, index); end
My general field lists have FieldType from nil. Why?
How can I get SuperObject to serialize a list of objects?
Vegar source share