{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://vizcatalogue.dev/schema/rc.schema.json",
  "title": "Recipe spec: a fully determined page",
  "type": "object",
  "required": ["code", "name", "ovp_version", "dl", "canvas", "elements", "qa"],
  "properties": {
    "code": {"type": "string", "pattern": "^RC-[0-9]{3}$"},
    "name": {"type": "string", "minLength": 2},
    "ovp_version": {"type": "string", "pattern": "^[01]\\.[0-9]+$"},
    "dl": {"type": "string", "pattern": "^DL-[0-9]{2}$"},
    "canvas": {
      "type": "object",
      "required": ["width", "height"],
      "properties": {"width": {"type": "integer"}, "height": {"type": "integer"}}
    },
    "elements": {
      "type": "array",
      "minItems": 2,
      "items": {
        "type": "object",
        "required": ["type"],
        "properties": {
          "type": {"type": "string", "enum": ["title", "kpi_strip", "chip", "callout", "chart", "source", "big_number", "header_band", "exception_row", "stamp"]}
        }
      }
    },
    "qa": {"type": "array", "items": {"type": "string"}, "minItems": 1}
  }
}
