{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://compo.kluchna24.ru/poster_engine/figma_adapter.schema.json",
  "title": "COMPO Figma Scene Adapter",
  "type": "object",
  "additionalProperties": false,
  "required": ["adapter_id", "direction", "scene_ref", "mapping", "mutation_allowed", "review_required"],
  "properties": {
    "adapter_id": {"type": "string", "pattern": "^figma-adapter-[a-z0-9-]+$"},
    "direction": {"type": "string", "enum": ["import", "export"]},
    "scene_ref": {"type": "string", "pattern": "^scene://"},
    "mapping": {"type": "array", "items": {"$ref": "#/$defs/mapping"}},
    "warnings": {"type": "array", "items": {"type": "string"}},
    "mutation_allowed": {"const": false},
    "review_required": {"const": true}
  },
  "$defs": {
    "mapping": {
      "type": "object",
      "additionalProperties": false,
      "required": ["scene_node_ref", "figma_node_kind", "status"],
      "properties": {
        "scene_node_ref": {"type": "string"},
        "figma_node_kind": {"type": "string", "enum": ["FRAME", "TEXT", "RECTANGLE", "ELLIPSE", "VECTOR", "IMAGE", "GROUP", "UNKNOWN"]},
        "status": {"type": "string", "enum": ["mapped", "unmapped", "lossy", "unknown"]},
        "note": {"type": "string"}
      }
    }
  }
}
