The util.JSON class / util.JSON methods |
Describes the record structure that can hold a given JSON data string.
util.JSON.proposeType( source STRING ) RETURNING result STRING
The util.JSON.proposeType() class method takes a JSON formatted string as parameter and generates the RECORD definition that corresponds to the source JSON string.
This method is useful to define a record variable that must hold the given JSON string.
IMPORT util MAIN DEFINE js STRING LET js='{ "cust_num":2735, "cust_name":"McCarlson", "orderids":[234,3456,24656,34561] }' DISPLAY util.JSON.proposeType( js ) END MAIN
Displays:
RECORD cust_num FLOAT, cust_name STRING, orderids DYNAMIC ARRAY OF FLOAT END RECORD