> ## 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

> Parsea un JSON string usando la misma function que json.decode.

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

  ## Argumentos

  <ParamField path={"json"} type={"string"} required>
    JSON string que se parsea. La function lee este argument con string type checking.
  </ParamField>

  <ParamField path={"options"} type={"DecodeOptions"}>
    Optional decode options. Un boolean define useNull. Una table puede definir useNull y maxDepth.
  </ParamField>

  ## Retornos

  <ResponseField name={"decoded"} type={"any"}>
    Decoded value. JSON objects y arrays se vuelven tables con JSON type markers, strings se vuelven Lua strings, numbers se vuelven Lua numbers, booleans se vuelven booleans, y null se vuelve json.null salvo que useNull sea false.
  </ResponseField>

  ## Tipos

  ### DecodeOptions

  Controla el comportamiento de análisis de JSON.

  | Name       | Type      | Required | Descripción                                                                   |
  | ---------- | --------- | -------- | ----------------------------------------------------------------------------- |
  | `useNull`  | `boolean` | No       | Representa JSON nulo con el centinela nulo de la biblioteca en lugar de nulo. |
  | `maxDepth` | `integer` | No       | Establece la profundidad máxima de anidamiento, sujeta de 1 a 4096.           |

  ## Ejemplo

  Parse JSON con la misma function usada por json.decode.

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