{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dmarc-examiner-com/json-schema/dmarc-examiner-com-report-statistics-schema.json",
  "title": "ReportStatistics",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dmarc-examiner-com-openapi.yaml#/components/schemas/ReportStatistics",
  "type": "object",
  "required": [
    "by_country",
    "by_asn",
    "by_result"
  ],
  "properties": {
    "by_country": {
      "type": "array",
      "description": "Records aggregated by country, sorted descending by count.",
      "items": {
        "type": "object",
        "required": [
          "country_code",
          "country",
          "count",
          "pass",
          "fail",
          "percentage"
        ],
        "properties": {
          "country_code": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2. Returns \"XX\" for unknown."
          },
          "country": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "pass": {
            "type": "integer"
          },
          "fail": {
            "type": "integer"
          },
          "percentage": {
            "type": "number",
            "format": "float",
            "description": "Share of total records this country represents (0–100, 1 decimal)."
          }
        }
      }
    },
    "by_asn": {
      "type": "array",
      "description": "Records aggregated by ASN, sorted descending by count.",
      "items": {
        "type": "object",
        "required": [
          "asn",
          "org",
          "count",
          "pass",
          "fail",
          "percentage"
        ],
        "properties": {
          "asn": {
            "type": "integer"
          },
          "org": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "pass": {
            "type": "integer"
          },
          "fail": {
            "type": "integer"
          },
          "percentage": {
            "type": "number",
            "format": "float"
          }
        }
      }
    },
    "by_result": {
      "type": "object",
      "required": [
        "pass",
        "fail",
        "total",
        "pass_rate"
      ],
      "properties": {
        "pass": {
          "type": "integer"
        },
        "fail": {
          "type": "integer"
        },
        "total": {
          "type": "integer"
        },
        "pass_rate": {
          "type": "number",
          "format": "float",
          "description": "Percentage of records passing both DKIM and SPF (0–100, 1 decimal)."
        }
      }
    }
  }
}