{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/compatair-fr/json-schema/compatair-fr-changefeed-result-schema.json",
  "title": "ChangefeedResult",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/compatair-fr-openapi.yml#/components/schemas/ChangefeedResult",
  "allOf": [
    {
      "$ref": "#/$defs/PublicEnvelope"
    },
    {
      "type": "object",
      "required": [
        "changes"
      ],
      "properties": {
        "changes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ChangefeedEvent"
          }
        },
        "nextCursor": {
          "type": "string"
        }
      }
    }
  ],
  "$defs": {
    "ChangefeedEvent": {
      "type": "object",
      "required": [
        "id",
        "type",
        "version",
        "observed_at",
        "summary"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "enum": [
            "protocol",
            "method",
            "catalog",
            "evidence",
            "knowledge",
            "offers",
            "benchmark",
            "compatibility_impact"
          ]
        },
        "version": {
          "type": "string"
        },
        "observed_at": {
          "type": "string",
          "format": "date"
        },
        "summary": {
          "type": "string"
        },
        "breaking": {
          "type": "boolean"
        },
        "canonical_url": {
          "type": "string",
          "format": "uri"
        }
      },
      "additionalProperties": false
    },
    "PublicEnvelope": {
      "type": "object",
      "required": [
        "verdict",
        "verdict_scope",
        "verdict_schema_version",
        "canonical_url",
        "product_urls",
        "source_urls",
        "method_version",
        "catalog_version",
        "observed_at",
        "limitations",
        "next_actions"
      ],
      "properties": {
        "verdict": {
          "enum": [
            "information",
            "compatible",
            "compatible_with_limits",
            "incompatible",
            "insufficient_data"
          ]
        },
        "verdict_scope": {
          "enum": [
            "information",
            "request",
            "air_supply",
            "complete_air_system",
            "commercial_constraints"
          ]
        },
        "verdict_schema_version": {
          "const": "2.0.0"
        },
        "canonical_url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://compatair\\.fr/"
        },
        "product_urls": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://compatair\\.fr/"
          },
          "uniqueItems": true
        },
        "source_urls": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://"
          },
          "uniqueItems": true
        },
        "method_version": {
          "type": "string",
          "pattern": "^2026\\.[0-9]{2}$"
        },
        "catalog_version": {
          "type": "string",
          "minLength": 1
        },
        "observed_at": {
          "type": "string",
          "format": "date"
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "next_actions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}