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

> Bir JSON string degerini tek bir complete JSON value parse ederek validate eder. Success durumunda yalnizca true dondurur. Parse failure durumunda false ve parser error details dondurur.

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

  ## Argümanlar

  <ParamField path={"json"} type={"string"} required>
    Validate edilecek JSON string. Function bu argument degerini string type checking ile okur.
  </ParamField>

  <ParamField path={"options"} type={"DecodeOptions"}>
    Optional decode options. boolean useNull degerini ayarlar. table useNull ve maxDepth ayarlayabilir. maxDepth 1 ile 4096 arasinda clamp edilir.
  </ParamField>

  ## Dönüşler

  <ResponseField name={"valid"} type={"boolean"}>
    Tek bir complete JSON value parsing basariliysa true. protected parse block icinde parsing basarisiz olursa false.
  </ResponseField>

  <ResponseField name={"errorMessage"} type={"string | nil"}>
    Parse failure durumunda Error message. Message json.validate ile prefixed olur ve near-position suffix icerir. Bu return yalnizca failure durumunda vardir.
  </ResponseField>

  <ResponseField name={"errorPosition"} type={"number | nil"}>
    Parse failure durumunda parser tarafindan gelen Parser byte position. Bu return yalnizca failure durumunda vardir.
  </ResponseField>

  ## Tipler

  ### DecodeOptions

  JSON ayrıştırma davranışını kontrol eder.

  | Name       | Type      | Required | Açıklama                                                               |
  | ---------- | --------- | -------- | ---------------------------------------------------------------------- |
  | `useNull`  | `boolean` | No       | Nil yerine kütüphanenin null sentinel'i ile JSON null'u temsil eder.   |
  | `maxDepth` | `integer` | No       | 1'den 4096'ya kadar kenetlenmiş maksimum yuvalama derinliğini ayarlar. |

  ## Örnek

  Bir string degerinin tam olarak tek bir complete JSON value icerip icermedigini kontrol eder.

  ```lua theme={null}
  print(json.validate('{"value":42}'))

  local valid, message, position = json.validate('{"value":42 trailing')

  if not valid then
      warn(message, position)
  end
  ```
</div>
