{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cliponit-app/json-schema/cliponit-app-keyframe-schema.json",
  "title": "Keyframe",
  "description": "Framing from time `t` (seconds **relative to the clip start**, before cuts) until the next keyframe. The first keyframe should be at t = 0. The number of zones must match the layout (vertical/spotlight/centered 1, split 2, trio 3, horizontal 0).",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cliponit-app-smart-api-openapi.yml#/components/schemas/Keyframe",
  "type": "object",
  "required": [
    "t",
    "layout",
    "zones"
  ],
  "properties": {
    "t": {
      "type": "number",
      "minimum": 0
    },
    "layout": {
      "$ref": "#/$defs/Layout"
    },
    "zones": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Zone"
      }
    },
    "ease": {
      "type": "string",
      "enum": [
        "cut",
        "smooth",
        ""
      ],
      "default": "cut",
      "description": "`cut` = hard switch; `smooth` = zones glide from the previous keyframe over the 0.6 s before `t` (same layout only)"
    }
  },
  "$defs": {
    "Layout": {
      "type": "string",
      "enum": [
        "vertical",
        "horizontal",
        "split",
        "trio",
        "spotlight",
        "centered"
      ],
      "description": "How source zones fill the output frame. `vertical`: 1 zone cropped to 9:16. `horizontal`: full frame (0 zones). `split`: 2 zones stacked (top, bottom). `trio`: 3 zones stacked. `spotlight`: 1 zone over a blurred full-frame background. `centered`: 1 square zone on a blue (#1e3a8a) background."
    },
    "Zone": {
      "type": "object",
      "required": [
        "x",
        "y",
        "w",
        "h"
      ],
      "description": "Rectangle of the SOURCE frame, fractions 0..1 (x+w ≤ 1, y+h ≤ 1). Its aspect should match the cell it fills (9:16 for vertical, 9:8 per cell in split, 1:1 for centered).",
      "properties": {
        "x": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "y": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "w": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 1
        },
        "h": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 1
        }
      }
    }
  }
}