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

> JSON string を parse し、Real default non-pretty JSON encoder output で re-encode します。

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

  ## 引数

  <ParamField path={"json"} type={"string"} required>
    Minifying の前に parse される JSON string。function はこの argument を string type checking で読みます。
  </ParamField>

  <ParamField path={"options"} type={"DecodeOptions"}>
    Input JSON の parsing 中に使われる optional decode options。boolean は useNull を設定します。table は useNull と maxDepth を設定できます。
  </ParamField>

  ## 戻り値

  <ResponseField name={"minified"} type={"string"}>
    Input の parsing と default encode options による re-encoding 後に生成される JSON string。
  </ResponseField>

  ## 型

  ### DecodeOptions

  JSON 解析動作を制御します。

  | Name       | Type      | Required | 説明                                               |
  | ---------- | --------- | -------- | ------------------------------------------------ |
  | `useNull`  | `boolean` | No       | nil の代わりにライブラリの null センチネルを使用して JSON null を表します。 |
  | `maxDepth` | `integer` | No       | ネストの最大の深さを 1 ～ 4096 の範囲で設定します。                   |

  ## 例

  Valid JSON を parse し、default compact JSON output で re-encode します。

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

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