Written by

~~ retired but not tired ~~
MOD
Question Robert Cemper · Mar 17, 2023

JSON mapping with XDATA

There is an example on JSON XDATA.
But it only describes Name mapping.

Is it possible to define somehow also a structural mapping
e..g an Array of Arrays Structure: without property names

[
     [12,33], [88,44]

Product version: IRIS 2022.3

Comments

André-Claude Gendron · Apr 12, 2023
ClassMethod GetContentJSON()
{
   set xData = ##class(%Dictionary.CompiledXData).%OpenId(..%ClassName(1) _ "||Content")  
   set jsonObj = [].%FromJSON(xData.Data)
   
   write jsonObj.%ToJSON()
}

XData Content [ MimeType = application/json ]
{
[[12,33], [88,44]]
}
0