[progress Communities] [progress Openedge Abl] Include Empty Tables In The Output Of...

  • Thread starter Thread starter onnodehaan
  • Start date Start date
Status
Not open for further replies.
O

onnodehaan

Guest
When writing a dasaset with empty tables to JSON or XML, there are omitted. I have a dataset, that I want to serialize to JSON. Here is a simplified definition: define temp-table ttMain no-undo serialize-name 'main':U field Id as character field Name as character. define temp-table ttSub no-undo serialize-name 'sub':U field Id as character field IdMain as character field Name as character. define dataset dsMain for ttMain, ttSub data-relation drMain for ttMain, ttSub relation-fields (ttMain.Id, ttSub.IdMain) nested. This dataset contains one parent table. And one child table. I populate the parent table, but leave the child table empty. Current result I than write it out to JSON, which gives me the following: {"dsMain": { "main": [ { "Id": "123", "NAME": "name" } ] }} Expected result My problem is, that I'm missing the Sub table. I would have expected the result to be: {"dsMain": { "main": [ { "Id": "123", "NAME": "name", "sub" : [ ] } ] }} I strongly feel this should be an extra option for the write-json and write-xml methods. Because now i'm losing essential information in my JSON. Or perhaps an option on a temp-table "serialize-empty" or something down that lines

Continue reading...
 
Status
Not open for further replies.
Back
Top