RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Debug DrawingGPU Mesh StructsImGui FFIMath Structs (FFI)FFI C DefinitionsPID ControllersCSV LibraryDelay LineDequeDevelopment UtilitiesEvent ReferenceExtension SystemSignal FiltersGraph PathfindingUI BridgeInput Filter Constants2D Bilinear InterpolationIntrospectionJBeam Pretty PrinterJSON AST ParserSJSON ParserJSON Debug ParserJSON Pretty PrinterK-D Tree (2D Boxes)K-D Tree (3D)K-D Tree (3D)Lua SerializerC++/Lua BindingLua CoreLua ProfilerMath LibraryParticlesQuadtreeSettingsTCP ServerTimer SchedulerUtility Library

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

JSON Debug Parser

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

See Also

  • cdefDebugDraw Reference - Related reference
  • cdefGpuMesh Reference - Related reference
  • cdefImgui Reference - Related reference
  • Common Libraries Overview - Guide

SJSON Parser

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, `=`

JSON Pretty Printer

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 NotesSee Also