Are json comments supported in ABL

Posted by cverbiest on 31-Jul-2014 02:50

I found out that  read-json accepts /* */ style comments. see sample code

I'm using oe11.3.2.

Is this supported ?

AFAIK there is no standard comment mechanism in json. See also http://stackoverflow.com/questions/244777/can-i-comment-a-json-file

Sample code

define temp-table tRow no-undo
    field RowName as character
    field RowValue as character
    field RowCount  as integer
    .

define variable lchar as longchar no-undo initial '
~{"tRow":[
~{"RowName":"first","RowValue":"string","RowCount":"1"~},
~{"RowName":"second",/*"RowValue":"in comment",*/"RowCount":"2"~},
/*
~{"RowName":"third","RowValue":"string","RowCount":"3"~},
*/
~{"RowName":"fourth","RowValue":"fit the","RowCount":"4"~},

]~}
'.

temp-table tRow:read-json("longchar", lchar).
for each tRow:
    disp tRow.
end.

Posted by Brian K. Maher on 04-Aug-2014 14:55

Carl,

I heard back from development and this functionality is supported.  It was added in 10.2B02 and 11.0.  

I will submit a bug to get the documentation updated.

Sincerely, Brian Maher

All Replies

Posted by Brian K. Maher on 04-Aug-2014 14:22

Carl,

Just a quick update to let you know that I am checking with development on this but for now, given that this behavior is not documented, I would not rely on it working in the future.

Sincerely, Brian Maher

Posted by Brian K. Maher on 04-Aug-2014 14:55

Carl,

I heard back from development and this functionality is supported.  It was added in 10.2B02 and 11.0.  

I will submit a bug to get the documentation updated.

Sincerely, Brian Maher

This thread is closed