DecodeJSON (open)

Decodes a JSON string

Syntax

// Core function, no LOADLIB necessary

VARIANT FUNCTION DecodeJSON(STRING indata, RECORD translations, RECORD options)

Parameters

STRING indata

JSON-encoded value

RECORD translations

Mapping record (of the format [ cellname := "<jsonkey>", ... ]), to remap JSON keys that aren't valid cell names in HareScript.

RECORD options

Options

BOOLEAN allowcomments

Allow comments in the JSON

BOOLEAN alltostring

Return all flat values (numbers and bools) as strings

BOOLEAN wrapobjects

Wrap objects in a JSONObject and arrays in a JSONArray (translations are ignored)

Return value

VARIANT

Decoded JSON value