21.2 JSON Encoding Functions
The functions described in this section are used to to encode lists, maps, or UDRs to JSON formatted strings.
jsonEncodeList
This function encodes a list to a JSON formatted string.
string jsonEncodeList ( list<any>list)
Parameter | Description |
---|---|
| The list to encode |
Returns | A JSON formatted string |
jsonEncodeMap
This function encodes a map to a JSON formatted string.
string jsonEncodeMap ( map<string,any> map)
Parameter | Description |
---|---|
| The map to encode |
Returns | A JSON formatted string |
jsonEncodeUdr
This function encodes a UDR to a JSON formatted string.
Info!
For cases where you would not want Big Integer or Big Decimal values to be converted into string, you can enable mz.apl.jsonencodeudr.ignore.bigint.convert
in EC Properties.
string jsonEncodeUdr (DRUDR udr, boolean serializeNulls) //optional
Parameter | Description |
---|---|
| The UDR to encode. |
boolean | (Optional) boolean to determine whether to serialise fields with null values. If no value is provided, it will serialise all null values by default. |
Returns | A JSON formatted string. |
Next: