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

> Parse JSON string แล้ว re-encode ด้วย Real default non-pretty JSON encoder output.

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

  ## Arguments

  <ParamField path={"json"} type={"string"} required>
    JSON string ที่ถูก parse ก่อน minifying. function อ่าน argument นี้ด้วย string type checking.
  </ParamField>

  <ParamField path={"options"} type={"DecodeOptions"}>
    Optional decode options ที่ใช้ระหว่าง parsing input JSON. boolean ตั้งค่า useNull. table ตั้งค่า useNull และ maxDepth ได้.
  </ParamField>

  ## Returns

  <ResponseField name={"minified"} type={"string"}>
    JSON string ที่สร้างหลัง parsing และ re-encoding input ด้วย default encode options.
  </ResponseField>

  ## Types

  ### DecodeOptions

  ควบคุมพฤติกรรมการแยกวิเคราะห์ JSON

  | Name | Type | Required | คำอธิบาย |
  | - | - | - | - |
  | `useNull` | `boolean` | No | แสดงถึง JSON null ด้วย null sentinel ของไลบรารีแทนที่จะเป็น nil |
  | `maxDepth` | `integer` | No | ตั้งค่าความลึกของการซ้อนสูงสุด โดยยึดไว้ตั้งแต่ 1 ถึง 4096 |

  ## ตัวอย่าง

  Parse valid JSON แล้ว re-encode ด้วย default compact JSON output.

  ```lua theme={null}
  local formatted = [[{
      "name": "Real",
      "enabled": true,
      "missing": null
  }]]

  print(json.minify(formatted, {
      useNull = true,
  }))
  ```
</div>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.