> ## 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 مع الحارس الفارغ للمكتبة بدلاً من صفر. |
  | `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>
