RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

cdefDebugDraw ReferencecdefGpuMesh ReferencecdefImgui ReferencecdefMath Referencecdefs ReferencecontrolSystems Referencecsvlib ReferencedelayLine Referencedequeue ReferencedevUtils ReferenceEvent Referenceextensions Referencefilters Referencegraphpath Referenceguihooks ReferenceinputFilters ReferenceinterpolatedMap Referenceintrospection ReferencejbeamWriter Referencejson-ast Referencejson ReferencejsonDebug ReferencejsonPrettyEncoderCustom Referencekdtreebox2d Referencekdtreebox3d Referencekdtreepoint3d Referencelpack ReferenceluaBinding ReferenceluaCore ReferenceluaProfiler Referencemathlib Referenceparticles Referencequadtree Referencesettings ReferencetcpServer ReferencetimeEvents Referenceutils Reference

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API Referencecommon

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 parse
    • context - 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.lua but with added jsonWarning() 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).

On this page

ExportsFunctionsM.decode(si, context)Internal Notes