Skip to main content

Arguments

string
required
JSON string to parse. The function reads this argument with string type checking.
DecodeOptions
Optional decode options. A boolean sets useNull. A table can set useNull and maxDepth.

Returns

any
Decoded value. JSON objects and arrays become tables with JSON type markers, strings become Lua strings, numbers become Lua numbers, booleans become booleans, and null becomes json.null unless useNull is false.

Types

DecodeOptions

Controls JSON parsing behavior.

Example

Parse JSON with the same parsing behavior as json.decode.