> ## 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 bang cung function nhu json.decode.

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

  ## Đối số

  <ParamField path={"json"} type={"string"} required>
    JSON string de parse. Function doc argument nay bang string type checking.
  </ParamField>

  <ParamField path={"options"} type={"DecodeOptions"}>
    Optional decode options. boolean dat useNull. table co the dat useNull va maxDepth.
  </ParamField>

  ## Giá trị trả về

  <ResponseField name={"decoded"} type={"any"}>
    Decoded value. JSON objects va arrays tro thanh tables voi JSON type markers, strings tro thanh Lua strings, numbers tro thanh Lua numbers, booleans tro thanh booleans, va null tro thanh json.null tru khi useNull la false.
  </ResponseField>

  ## Kiểu

  ### DecodeOptions

  Kiểm soát hành vi phân tích cú pháp JSON.

  | Name       | Type      | Required | Mô tả                                                                   |
  | ---------- | --------- | -------- | ----------------------------------------------------------------------- |
  | `useNull`  | `boolean` | No       | Biểu thị JSON null bằng giá trị null của thư viện thay vì con số không. |
  | `maxDepth` | `integer` | No       | Đặt độ sâu lồng tối đa, được kẹp từ 1 đến 4096.                         |

  ## Ví dụ

  Parse JSON bang cung function duoc json.decode su dung.

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