{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dns-coffee/json-schema/dns-coffee-zone-count-schema.json",
  "title": "ZoneCount",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dns-coffee-stats-api-openapi.yml#/components/schemas/ZoneCount",
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "description": "A URL to the JSON Schema for this object.",
      "format": "uri",
      "readOnly": true,
      "type": "string"
    },
    "history": {
      "description": "The zone's count history, one point per time bucket.",
      "items": {
        "$ref": "#/$defs/ZoneCounts"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "zone": {
      "description": "Zone name. Empty for the root zone.",
      "type": "string"
    }
  },
  "required": [
    "zone",
    "history"
  ],
  "type": "object",
  "$defs": {
    "ZoneCounts": {
      "additionalProperties": false,
      "properties": {
        "date": {
          "description": "Date of the point. On per-zone history (/zones/{zone}/history, /root) it is the newest import in the bucket; on /stats/internet and /stats/zones it is the first day of the week (Monday) or month.",
          "format": "date-time",
          "type": "string"
        },
        "domains": {
          "description": "Average domain count over the bucket.",
          "format": "int64",
          "type": "integer"
        },
        "moved": {
          "description": "Number of domains whose nameservers changed over the bucket.",
          "format": "int64",
          "type": "integer"
        },
        "new": {
          "description": "Number of domains added to the zone over the bucket.",
          "format": "int64",
          "type": "integer"
        },
        "old": {
          "description": "Number of domains removed from the zone over the bucket.",
          "format": "int64",
          "type": "integer"
        }
      },
      "required": [
        "date",
        "domains",
        "old",
        "moved",
        "new"
      ],
      "type": "object"
    }
  }
}