{
  "type": "object",
  "properties": {
    "severity": {
      "enum": [
        "critical",
        "warning",
        "routine"
      ],
      "description": "Classify a service outage as critical, degraded service as warning, and a healthy status update as routine."
    },
    "action": {
      "enum": [
        "page_on_call",
        "open_ticket",
        "log"
      ],
      "description": "The action selected by the routing rules."
    }
  },
  "required": [
    "severity",
    "action"
  ],
  "additionalProperties": false,
  "x-runtime": {
    "switch": {
      "on": {
        "path": "/severity"
      },
      "cases": [
        {
          "when": {
            "eq": "critical"
          },
          "then": {
            "properties": {
              "action": {
                "const": "page_on_call"
              }
            }
          }
        },
        {
          "when": {
            "in": [
              "critical",
              "warning"
            ]
          },
          "then": {
            "properties": {
              "action": {
                "const": "open_ticket"
              }
            }
          }
        }
      ],
      "default": {
        "properties": {
          "action": {
            "const": "log"
          }
        }
      }
    }
  }
}
