jsonDebug Reference
Module defined in `lua/common/jsonDebug.lua`. Debug variant of the SJSON parser that adds duplicate key detection. Structurally identical to `json.lua` but emits warnings when duplicate keys are found
Module defined in lua/common/jsonDebug.lua. Debug variant of the SJSON parser that adds duplicate key detection. Structurally identical to json.lua but emits warnings when duplicate keys are found in objects.
Exports
Functions
M.decode(si, context)
Parses a JSON/SJSON string with duplicate key warning support.
- Parameters:
si- string|nil - JSON string to parsecontext- string|nil - Context string included in warning messages (e.g., filename)
- Returns: table, table - Parsed Lua value and array of warning strings
Internal Notes
- Same parser as
json.luabut with addedjsonWarning()calls when duplicate keys are detected - Warnings include context, message, and approximate line number
- Used for validation/debugging, not for production parsing (slightly slower due to duplicate checks)
- Returns two values: the parsed data and an array of warning messages
json Reference
Module defined in `lua/common/json.lua`. High-performance SJSON (Simplified JSON) parser for Lua 5.1/LuaJIT. Supports standard JSON plus SJSON extensions: comments (`//`, `/* */`), unquoted keys, `=`
jsonPrettyEncoderCustom Reference
Module defined in `lua/common/jsonPrettyEncoderCustom.lua`. A customizable JSON pretty-printer with weighted key sorting and callback-controlled folding (inline vs expanded formatting).