delphimvcframework icon indicating copy to clipboard operation
delphimvcframework copied to clipboard

How to handle Master-Detail JSON response

Open jkellywilkerson opened this issue 5 years ago • 1 comments
trafficstars

Using the .AppendFromJSONArrayString TDataSet helper method causes error when the JSON string contains a JSONArray within a JSONArray. Similar to this array of Departments that contains Employees: [ { "Id":"{2F0940FF-8AD5-D884-B6EF-15D0B5F8F8BF}", "CompanyId":"{E3F049AC-8794-BE52-8E1C-909D5B06259F}", "DeptName":"Accounting", "Employees":[ {},{},{} **List of Employees here ] }, { "Id":"{809B5467-DC32-4B23-873A-FAE02517400B}", "CompanyId":"{E3F049AC-8794-BE52-8E1C-909D5B06259F}", "DeptName":"Engineering", "Employees":[ {},{},{} **List of Employees here ]} ]

It could be that TFDMemTable doesn't support the created dataset. If so, what would be a way to handle that scenario.

Thanks,

Kelly.

jkellywilkerson avatar Jul 14 '20 18:07 jkellywilkerson

Can you produce a selfcontained example project?

danieleteti avatar Aug 19 '20 10:08 danieleteti