{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "multistep_form",
  "description": "Çok adımlı form; `presentation:\"page\"` ise tam sayfa form . İstemci anlık doğrular, sunucu (bot) yeniden doğrular.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "type",
    "version",
    "steps"
  ],
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "multistep_form"
      ]
    },
    "version": {
      "type": "integer",
      "enum": [
        1
      ]
    },
    "tone": {
      "type": "string",
      "enum": [
        "neutral",
        "success",
        "warning",
        "danger",
        "brand"
      ]
    },
    "brand_color": {
      "type": "string",
      "enum": [
        "mavi",
        "turuncu",
        "mor",
        "pembe",
        "altin",
        "yesil",
        "turkuaz"
      ]
    },
    "title": {
      "type": "string",
      "maxLength": 80
    },
    "presentation": {
      "type": "string",
      "enum": [
        "inline",
        "page"
      ]
    },
    "steps": {
      "type": "array",
      "minItems": 1,
      "maxItems": 10,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,31}$",
            "description": "form alanı/grup kimliği; `values` anahtarı"
          },
          "title": {
            "type": "string",
            "maxLength": 80,
            "minLength": 1
          },
          "fields": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,31}$",
                  "description": "form alanı/grup kimliği; `values` anahtarı"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "text",
                    "long_text",
                    "number",
                    "phone",
                    "email",
                    "date",
                    "time",
                    "datetime_range",
                    "single_choice",
                    "multi_choice",
                    "dropdown",
                    "slider",
                    "stepper",
                    "toggle",
                    "rating",
                    "nps",
                    "mood",
                    "location",
                    "photo",
                    "file"
                  ]
                },
                "label": {
                  "type": "string",
                  "maxLength": 60,
                  "minLength": 1
                },
                "required": {
                  "type": "boolean"
                },
                "placeholder": {
                  "type": "string",
                  "maxLength": 80
                },
                "hint": {
                  "type": "string",
                  "maxLength": 120
                },
                "value": {
                  "type": "string",
                  "maxLength": 2000,
                  "description": "geçerli değer (metin/sayı/tarih/saat dizgesi; toggle için \"true\"/\"false\")"
                },
                "values": {
                  "type": "array",
                  "minItems": 0,
                  "maxItems": 20,
                  "items": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "description": "multi_choice seçili değerler"
                },
                "options": {
                  "type": "array",
                  "minItems": 1,
                  "maxItems": 30,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "value": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_.:-]{1,64}$",
                        "description": "seçenek/öğe değeri; istemci bunu `inki_component_action.values` içinde geri gönderir"
                      },
                      "label": {
                        "type": "string",
                        "maxLength": 80,
                        "minLength": 1
                      }
                    },
                    "required": [
                      "value",
                      "label"
                    ]
                  }
                },
                "min": {
                  "type": "number",
                  "minimum": -1000000000.0,
                  "maximum": 1000000000.0
                },
                "max": {
                  "type": "number",
                  "minimum": -1000000000.0,
                  "maximum": 1000000000.0
                },
                "step": {
                  "type": "number",
                  "minimum": 1e-06,
                  "maximum": 1000000000.0
                },
                "min_length": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 4000
                },
                "max_length": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 4000
                },
                "error": {
                  "type": "string",
                  "maxLength": 200,
                  "description": "geçerli doğrulama hatası (bot yeniden gönderince gösterilir)"
                }
              },
              "required": [
                "id",
                "type",
                "label"
              ],
              "description": "form alanı; parola/kart no/CVV/OTP/seed türleri YOKTUR"
            }
          }
        },
        "required": [
          "id",
          "title",
          "fields"
        ]
      }
    },
    "current": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9
    },
    "back_label": {
      "type": "string",
      "maxLength": 30
    },
    "next_label": {
      "type": "string",
      "maxLength": 30
    },
    "submit_label": {
      "type": "string",
      "maxLength": 30
    }
  },
  "x-inki-eylem": [
    {
      "action": "change",
      "values": {
        "steps[].fields[].id": "yeni değer"
      }
    },
    {
      "action": "submit",
      "values": {
        "step": "steps[].id",
        "direction": "back|next|submit",
        "<alan id>": "tüm alan değerleri"
      }
    }
  ]
}
