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

> Faz parse de um JSON string usando a mesma 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 recebe parse. A function le este argument com string type checking.
  </ParamField>

  <ParamField path={"options"} type={"DecodeOptions"}>
    Optional decode options. Um boolean define useNull. Uma table pode definir useNull e maxDepth.
  </ParamField>

  ## Retornos

  <ResponseField name={"decoded"} type={"any"}>
    Decoded value. JSON objects e arrays viram tables com JSON type markers, strings viram Lua strings, numbers viram Lua numbers, booleans viram booleans, e null vira json.null a menos que useNull seja false.
  </ResponseField>

  ## Tipos

  ### DecodeOptions

  Controla o comportamento de análise JSON.

  | Name       | Type      | Required | Descrição                                                               |
  | ---------- | --------- | -------- | ----------------------------------------------------------------------- |
  | `useNull`  | `boolean` | No       | Representa JSON nulo com o sentinela nulo da biblioteca em vez de nulo. |
  | `maxDepth` | `integer` | No       | Define a profundidade máxima de aninhamento, fixada de 1 a 4096.        |

  ## Exemplo

  Parse JSON com a mesma 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>
