marlonnardi / JsonToDelphi

generate delphi classes from json (Json To Delphi Class Generator / JSON Data Binding Tool FMX, VCL and uniGUI)
https://jsontodelphi.com
64 stars 25 forks source link

serialization sample for array #1

Closed gatscross closed 2 years ago

gatscross commented 4 years ago

Hello,

Thanks you for your library, Can you provide sample for serialization with array json? i made like this, but this get error AV.

procedure TfrmSampleUse.Button1Click(Sender: TObject);
var
  Root: TRootDTO;
begin
  Root := TRootDTO.Create;
  try
    Root.Menu.Id := 'file';
    Root.Menu.Value := 'file';
    Root.Menu.Popup.Menuitem[0].Onclick := 'OpenDoc()';
    Memo1.Text := Root.AsJson;
  finally
    Root.Free;
  end;
end;
marlonnardi commented 2 years ago

Fixed