{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://spec.soustack.org/stacks/illustrated.schema.json",
  "title": "Illustrated Stack",
  "type": "object",
  "properties": {
    "images": {
      "type": "array",
      "items": { "$ref": "../defs/common.schema.json#/properties/uri" }
    },
    "videos": {
      "type": "array",
      "items": { "$ref": "../defs/common.schema.json#/properties/uri" }
    },
    "instructions": {
      "type": "array",
      "items": {
        "anyOf": [
          { "$ref": "#/$defs/illustratedStep" },
          { "$ref": "#/$defs/illustratedSection" }
        ]
      }
    }
  },
  "$defs": {
    "illustratedStep": {
      "allOf": [
        { "$ref": "../defs/entities.schema.json#/$defs/StepBase" },
        { "required": ["id"] }
      ]
    },
    "illustratedSection": {
      "type": "object",
      "properties": {
        "section": { "type": "string" },
        "steps": {
          "type": "array",
          "items": {
            "anyOf": [
              { "$ref": "#/$defs/illustratedStep" },
              { "$ref": "#/$defs/illustratedSection" }
            ]
          }
        },
        "metadata": { "type": "object", "additionalProperties": true }
      },
      "required": ["section", "steps"],
      "additionalProperties": false,
      "patternProperties": {
        "^x-": { "$ref": "../defs/common.schema.json#/properties/extensionLaneValue" }
      }
    }
  }
}
