{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gajo-io/json-schema/gajo-io-route-template-request-schema.json",
  "title": "RouteTemplateRequest",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gajo-io-openapi.json#/components/schemas/RouteTemplateRequest",
  "type": "object",
  "required": [
    "name",
    "rules"
  ],
  "properties": {
    "name": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{2,100}$",
      "description": "2-100 characters: letters, digits, hyphens and underscores. Unique per account."
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Optional note. Omitting it on update clears it."
    },
    "rules": {
      "type": "array",
      "minItems": 1,
      "maxItems": 6,
      "description": "Device slots in this template; each `deviceType` may appear once. Include `Default` to catch unmatched devices.",
      "items": {
        "type": "object",
        "required": [
          "deviceType"
        ],
        "properties": {
          "deviceType": {
            "$ref": "#/$defs/DeviceSlot"
          }
        }
      }
    }
  },
  "$defs": {
    "DeviceSlot": {
      "type": "string",
      "enum": [
        "Android",
        "IOS",
        "Mobile",
        "Tablet",
        "Desktop",
        "Default"
      ],
      "description": "Device slot used by route templates and Device bindings. At redirect time OS-specific slots (`Android`, `IOS`) are matched first, then device classes (`Mobile`, `Tablet`, `Desktop`), then `Default` catches everything else."
    }
  }
}