{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.1x0.us/schemas/zone.json",
  "title": "BindConfigForge Zone",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "zone"
  ],
  "properties": {
    "zone": {
      "type": "string",
      "minLength": 1,
      "description": "DNS zone name."
    },
    "mixins": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "uniqueItems": true,
      "default": []
    },
    "type": {
      "type": "string",
      "minLength": 1
    },
    "zone_directory": {
      "type": "string",
      "minLength": 1
    },
    "zone_file": {
      "type": "string",
      "minLength": 1
    },
    "key_directory": {
      "type": "string",
      "minLength": 1
    },
    "inline_signing": {
      "type": "boolean"
    },
    "dnssec_policy": {
      "type": "string",
      "minLength": 1
    },
    "update_policy": {
      "$ref": "#/$defs/updatePolicy"
    },
    "allow_transfer": {
      "$ref": "#/$defs/allowTransfer"
    }
  },
  "$defs": {
    "updatePolicy": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/updatePolicyGrant"
      }
    },
    "updatePolicyGrant": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "grant"
      ],
      "properties": {
        "grant": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "key",
            "match"
          ],
          "properties": {
            "key": {
              "type": "string",
              "minLength": 1
            },
            "match": {
              "type": "string",
              "minLength": 1
            },
            "name": {
              "type": "string",
              "minLength": 1
            },
            "types": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          }
        }
      }
    },
    "allowTransfer": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    }
  }
}
