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

> Lua value, Real JSON encoder kullanilarak readable formatted JSON string olarak serializes edilir. json.pretty ayni function'a kayitlidir.

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

  ## Argümanlar

  <ParamField path={"value"} type={"any"} required>
    Encoded edilecek value. nil, booleans, numbers, strings, tables ve json.null dogrudan islenir. Unsupported Lua types, errorOnUnsupported true degilse null olarak encoded edilir.
  </ParamField>

  <ParamField path={"options"} type={"EncodeOptions"}>
    Optional encode options. json.encodePretty, json.encode ile ayni options degerlerini okur, sonra pretty degerini true yapar. options yoksa two-space indent kullanir. number, 0.16 araligina clamp edilen indent width ayarlar, string indent text ayarlar, table ise sortKeys, emptyTableAsArray, errorOnUnsupported, encodeInvalidNumbersAsNull, maxDepth ve indent ayarlayabilir.
  </ParamField>

  ## Dönüşler

  <ResponseField name={"json"} type={"string"}>
    Readable formatted JSON string. Encoding errors Luau errors olarak throw edilir.
  </ResponseField>

  ## Tipler

  ### EncodeOptions

  JSON serileştirmesini ve biçimlendirmesini kontrol eder.

  | Name                         | Type      | Required | Açıklama                                                               |
  | ---------------------------- | --------- | -------- | ---------------------------------------------------------------------- |
  | `pretty`                     | `boolean` | No       | Biçimlendirilmiş, çok satırlı JSON çıkışını etkinleştirir.             |
  | `sortKeys`                   | `boolean` | No       | Kodlamadan önce nesne anahtarlarını sıralar.                           |
  | `emptyTableAsArray`          | `boolean` | No       | Boş bir tabloyu nesne yerine dizi olarak kodlar.                       |
  | `errorOnUnsupported`         | `boolean` | No       | Desteklenmeyen değerleri değiştirmek yerine hata oluşturur.            |
  | `encodeInvalidNumbersAsNull` | `boolean` | No       | NaN'yi ve sonsuz sayıları JSON null olarak kodlar.                     |
  | `maxDepth`                   | `integer` | No       | 1'den 4096'ya kadar kenetlenmiş maksimum yuvalama derinliğini ayarlar. |
  | `indent`                     | `string`  | No       | 32 karakterle sınırlı girinti dizesini ayarlar.                        |

  ## Örnek

  JSON-compatible values degerlerini pretty output forced on ile readable formatted JSON olarak encode eder.

  ```lua theme={null}
  local text = json.encodePretty({
      name = "Real",
      version = 1,
      features = json.array({ "docs", "examples" }),
      missing = json.null,
  }, {
      sortKeys = true,
  })

  print(text)
  ```
</div>
