skip to Main Content

Is there a convenient way to create nested JSON in Delphi?

I'm creating a nested JSON object in Delphi using this code: var jo:TJsonObject; try jo := TJsonObject.Create; jo.AddPair('data', TJsonObject.Create); with jo.GetValue<TJsonObject>('data') do begin jo.AddPair('details', TJSONObject.Create); with jo.GetValue<TJsonObject>('details') do begin jo.AddPair('foo', 'bar'); end; end; finally FreeAndNil(jo); end; It works and produces…

VIEW QUESTION
Back To Top
Search