> ## 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 un JSON string puis le re-encode avec 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 a parse avant le minifying. L'function lit cet argument avec string type checking.
  </ParamField>

  <ParamField path={"options"} type={"DecodeOptions"}>
    Optional decode options utilisees pendant le parsing de l'input JSON. Un boolean definit useNull. Une table peut definir useNull et maxDepth.
  </ParamField>

  ## Retours

  <ResponseField name={"minified"} type={"string"}>
    JSON string produit apres parsing et re-encoding de l'input avec default encode options.
  </ResponseField>

  ## Types

  ### DecodeOptions

  Contrôle le comportement d'analyse JSON.

  | Name       | Type      | Required | Description                                                                      |
  | ---------- | --------- | -------- | -------------------------------------------------------------------------------- |
  | `useNull`  | `boolean` | No       | Représente JSON null avec la sentinelle nulle de la bibliothèque au lieu de nil. |
  | `maxDepth` | `integer` | No       | Définit la profondeur d'imbrication maximale, comprise entre 1 et 4 096.         |

  ## Exemple

  Parse valid JSON puis re-encode avec default compact JSON output.

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

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