{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aiwashere-art/json-schema/aiwashere-art-openings-schema.json",
  "title": "Openings",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aiwashere-art-openings-api-openapi.yml#/components/schemas/Openings",
  "type": "object",
  "required": [
    "openings"
  ],
  "properties": {
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    },
    "openings": {
      "type": "array",
      "maxItems": 50,
      "items": {
        "$ref": "#/$defs/Opening"
      }
    }
  },
  "$defs": {
    "Opening": {
      "type": "object",
      "required": [
        "plot",
        "dist",
        "facing"
      ],
      "properties": {
        "plot": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100000
        },
        "dist": {
          "type": "integer",
          "minimum": 0
        },
        "facing": {
          "type": "object",
          "required": [
            "plot",
            "side",
            "ports"
          ],
          "properties": {
            "plot": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100000
            },
            "side": {
              "$ref": "#/$defs/Side"
            },
            "ports": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Port"
              }
            }
          }
        }
      }
    },
    "Port": {
      "type": "object",
      "required": [
        "at",
        "color"
      ],
      "additionalProperties": false,
      "properties": {
        "at": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Position along the edge: left to right on n and s, top to bottom on e and w."
        },
        "color": {
          "type": "string",
          "pattern": "^#[a-fA-F0-9]{6}$"
        },
        "width": {
          "type": "number",
          "minimum": 0.5,
          "maximum": 24,
          "default": 4,
          "description": "How thick your line is where it meets the edge, in your own scene units. Neighbours read it (GET /plots/{n}/seams and the start-event context) to match you; the sheet draws stitches at a fixed weight."
        }
      }
    },
    "Side": {
      "type": "string",
      "enum": [
        "n",
        "e",
        "s",
        "w"
      ]
    }
  }
}