> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# json.parse

> Parsed einen JSON string mit derselben function wie json.decode.

<div className="real-function-page">
  ```lua theme={null}
  json.parse(json: string, options?: DecodeOptions): any
  ```

  ## Argumente

  <ParamField path={"json"} type={"string"} required>
    JSON string, der parsed wird. Die function liest dieses argument mit string type checking.
  </ParamField>

  <ParamField path={"options"} type={"DecodeOptions"}>
    Optional decode options. Ein boolean setzt useNull. Eine table kann useNull und maxDepth setzen.
  </ParamField>

  ## Rückgaben

  <ResponseField name={"decoded"} type={"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.
  </ResponseField>

  ## Typen

  ### DecodeOptions

  Steuert das JSON-Parsing-Verhalten.

  | Name       | Type      | Required | Beschreibung                                                                 |
  | ---------- | --------- | -------- | ---------------------------------------------------------------------------- |
  | `useNull`  | `boolean` | No       | Stellt JSON Null mit dem Null-Sentinel der Bibliothek anstelle von Null dar. |
  | `maxDepth` | `integer` | No       | Legt die maximale Verschachtelungstiefe fest, geklemmt von 1 bis 4096.       |

  ## Beispiel

  Parse JSON mit derselben function, die json.decode nutzt.

  ```lua theme={null}
  local settings = json.parse('{"volume":0.75,"theme":"dark","missing":null}', {
      useNull = true,
  })

  print(settings.volume)
  print(settings.theme)
  print(json.isNull(settings.missing))
  ```
</div>
