m_resp RECORD id CHAR(8), count SMALLINT, feasable BOOLEAN, route DICTIONARY OF RECORD name VARCHAR(40), arrival DECIMAL(6,1), distance DECIMAL(6,1) END RECORD END RECORD
IMPORT util DEFINE rec RECORD id STRING, count FLOAT, feasible BOOLEAN, route DICTIONARY OF RECORD name STRING, arrival FLOAT, distance FLOAT END RECORD END RECORD MAIN DEFINE js STRING LET js = '{ "id": "96gOMKS2", "count": 10, "feasible": true, "route": { "0": { "name": "LOC 1", "arrival": 0, "distance": 0 }, "1": { "name": "LOC 2", "arrival": 2, "distance": 1.2 }, "2": { "name": "LOC 3", "arrival": 4, "distance": 2.3 } }}' CALL util.JSON.parse(js, rec) DISPLAY util.JSON.format( util.JSON.stringify(rec) )END MAIN
RECORD id STRING, count FLOAT, feasible BOOLEAN, route RECORD 0 RECORD name STRING, arrival FLOAT, distance FLOAT END RECORD, 1 RECORD name STRING, arrival FLOAT, distance FLOAT END RECORD, 2 RECORD name STRING, arrival FLOAT, distance FLOAT END RECORD END RECORDEND RECORD
DEFINE x RECORD id STRING, count FLOAT, feasible BOOLEAN, route RECORD r0 RECORD ATTRIBUTES (json_name="0") name STRING, arrival FLOAT, distance FLOAT END RECORD, r1 RECORD ATTRIBUTES (json_name="1") name STRING, arrival FLOAT, distance FLOAT END RECORD, r2 RECORD ATTRIBUTES(json_name="2") name STRING, arrival FLOAT, distance FLOAT END RECORD END RECORDEND RECORD