onryldz / x-superobject

Delphi Cross Platform Rapid JSON
316 stars 118 forks source link

Serialization, Pointer #105

Open rzaripov1990 opened 8 years ago

rzaripov1990 commented 8 years ago
type
  PmyTypeMessage = ^TmyTypeMessage;
  TmyTypeMessage = record
    message_id: integer;
    reply_to_message: PmyTypeMessage; // pointer to self
  end;

Json Data

'{"message_id":1,"reply_to_message":{"message_id":2,"reply_to_message":{"message_id":3,"reply_to_message":null}}}'

whether it is possible to use this approach?

vkrapotkin commented 8 years ago

Seems to be an infinite recursion Instead you can provide a fake property which will dereference a pointer