[progress Communities] [progress Openedge Abl] Forum Post: Serialize Data-relations When...

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

onnodehaan

Guest
Good evening, I've a question. 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 would expected an empty array element for the "sub" table. Since I'm not having one, the external systems runs into errors, because of the missing JSON-node "sub". Question Am I right in thinking that this might be a bug in OpenEdge? Of at least something that should be improved? Or am I missing something, and can I use a switch, parameter or option to get my expected result? Regards, Onno (Please visit the site to view this file)

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