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

> Parse для JSON string через ту же function, что json.decode.

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

  ## Аргументы

  <ParamField path={"json"} type={"string"} required>
    JSON string для parse. Function читает этот argument через string type checking.
  </ParamField>

  <ParamField path={"options"} type={"DecodeOptions"}>
    Optional decode options. boolean задает useNull. table может задавать useNull и maxDepth.
  </ParamField>

  ## Возвраты

  <ResponseField name={"decoded"} type={"any"}>
    Decoded value. JSON objects и arrays становятся tables с JSON type markers, strings становятся Lua strings, numbers становятся Lua numbers, booleans становятся booleans, а null становится json.null, если useNull не false.
  </ResponseField>

  ## Типы

  ### DecodeOptions

  Управляет поведением анализа JSON.

  | Name       | Type      | Required | Описание                                                                               |
  | ---------- | --------- | -------- | -------------------------------------------------------------------------------------- |
  | `useNull`  | `boolean` | No       | Представляет значение JSON null с нулевым контрольным значением библиотеки вместо nil. |
  | `maxDepth` | `integer` | No       | Устанавливает максимальную глубину вложенности от 1 до 4096.                           |

  ## Пример

  Parse JSON через ту же function, которую использует 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>
