Skip to main content

Argumente

string
erforderlich
JSON text zum Parsen. Der parser akzeptiert einen JSON value mit optional surrounding whitespace und wirft bei invalid syntax oder trailing non-whitespace characters.
DecodeOptions
Optional decode options. Ein boolean setzt useNull direkt. Eine table kann useNull und maxDepth setzen; maxDepth wird von 1 bis 4096 geclamped.

Rückgaben

any
Decoded value. JSON objects und arrays werden zu tables mit JSON type markers, strings zu Lua strings, numbers zu Lua numbers, booleans zu booleans, und null wird zu json.null, ausser useNull ist false.

Typen

DecodeOptions

Steuert das JSON-Parsing-Verhalten.

Beispiel

Decode JSON zu Lua values und erhalte JSON array, object und null markers.