Skip to main content

参数

string
必填
要 parse 的 JSON string。function 使用 string type checking 读取这个 argument。
DecodeOptions
Optional decode options。boolean 设置 useNull。table 可以设置 useNull 和 maxDepth。

返回值

any
Decoded value。JSON objects 和 arrays 会变成带有 JSON type markers 的 tables,strings 变成 Lua strings,numbers 变成 Lua numbers,booleans 变成 booleans,null 会变成 json.null,除非 useNull 为 false。

类型

DecodeOptions

控制 JSON 解析行为。

示例

使用 json.decode 所用的相同 function parse JSON。