{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/merlonix-com/json-schema/merlonix-com-dns-check-schema.json",
  "title": "DnsCheck",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/merlonix-com-openapi.yml#/components/schemas/DnsCheck",
  "type": "object",
  "required": [
    "kind",
    "id",
    "tenant_id",
    "asset_id",
    "checked_at",
    "record_type",
    "resolver",
    "records_found",
    "drift_detected",
    "drift_summary",
    "status",
    "response_ms",
    "cname_observed",
    "cname_chain",
    "cname_target"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "dns"
      ]
    },
    "id": {
      "type": "integer"
    },
    "tenant_id": {
      "type": "string",
      "format": "uuid"
    },
    "asset_id": {
      "type": "string",
      "format": "uuid"
    },
    "checked_at": {
      "type": "string",
      "format": "date-time"
    },
    "record_type": {
      "type": "string"
    },
    "resolver": {
      "type": "string"
    },
    "records_found": {
      "description": "Resolved records — shape varies by record_type."
    },
    "drift_detected": {
      "type": "boolean"
    },
    "drift_summary": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "ok",
        "drift",
        "nxdomain",
        "servfail",
        "timeout",
        "error"
      ]
    },
    "response_ms": {
      "type": [
        "integer",
        "null"
      ]
    },
    "cname_observed": {
      "type": "boolean",
      "description": "Whether this check observed the CNAME delegation at all. False on any row written before 2026-08-19 — it does NOT mean the hostname publishes no CNAME."
    },
    "cname_chain": {
      "type": "array",
      "description": "Hops from the monitored hostname to the name that finally answered. Empty when observed and none is published.",
      "items": {
        "type": "object",
        "required": [
          "from",
          "to"
        ],
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          }
        }
      }
    },
    "cname_target": {
      "type": [
        "string",
        "null"
      ],
      "description": "The first hop target — the CNAME record published in the customer own zone, and the only hop delegation alerts key on."
    }
  }
}