{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/IPBlock",
  "title": "IPBlock",
  "type": "object",
  "description": "An IP block defined by a CIDR range with optional exceptions, used to allow or restrict traffic to or from specific IP ranges.",
  "required": [
    "cidr"
  ],
  "properties": {
    "cidr": {
      "type": "string",
      "description": "CIDR range to match. Examples: 192.168.1.0/24, 0.0.0.0/0, 2001:db8::/32.",
      "pattern": "^([0-9]{1,3}\\.){3}[0-9]{1,3}/[0-9]{1,2}$|^[0-9a-fA-F:]+/[0-9]{1,3}$"
    },
    "except": {
      "type": "array",
      "description": "CIDR ranges to exclude from the ipBlock. Must be within the cidr range.",
      "items": {
        "type": "string"
      }
    }
  }
}