Garry's Mod Wiki

util.JSONToTable

  table or nil util.JSONToTable( string json, boolean ignoreLimits = false, boolean ignoreConversions = false )

Description

Converts a JSON string to a Lua table.

See util.TableToJSON for the opposite function.

Colors will not have the color metatable.

Issue Tracker: 2407

Arguments

1 string json
The JSON string to convert.
2 boolean ignoreLimits = false
ignore the depth and breadth limits, use at your own risk!.
If this is false, there is a limit of 15,000 keys total.
3 boolean ignoreConversions = false
ignore string to number conversions for table keys.
if this is false, keys are converted to numbers wherever possible. This means using Player:SteamID64 as keys won't work.

Returns

1 table or nil
The table containing converted information. Returns nil on failure.