{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "/schemas/3.1.2/core/registry-feed-response.json",
  "title": "Registry Feed Response",
  "description": "Response from GET /api/registry/feed and the `feed` event body from GET /api/registry/feed/stream. The events array contains cursor-ordered registry events; cursor is the value to pass on the next poll or stream reconnect. See specs/registry-change-feed.md.",
  "type": "object",
  "properties": {
    "events": {
      "type": "array",
      "items": {
        "$ref": "/schemas/3.1.2/core/registry-event.json"
      }
    },
    "cursor": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Pass this value as cursor on the next request to continue polling. Null only when the feed has no events and no prior cursor."
    },
    "has_more": {
      "type": "boolean",
      "description": "True when more events are immediately available after cursor."
    },
    "freshness": {
      "type": "object",
      "description": "Consumer-visible feed freshness metadata for the requested type filter.",
      "properties": {
        "generated_at": {
          "type": "string",
          "format": "date-time",
          "description": "Server timestamp when this feed page was generated."
        },
        "latest_event_created_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Newest event creation timestamp currently visible in the feed for the requested type filter. Null when no matching event exists inside retention."
        },
        "lag_seconds": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "description": "Seconds between generated_at and latest_event_created_at. Null when no matching event exists."
        },
        "retention_days": {
          "type": "integer",
          "minimum": 1,
          "description": "Number of days the registry retains feed cursors and events."
        }
      },
      "required": [
        "generated_at",
        "latest_event_created_at",
        "lag_seconds",
        "retention_days"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "events",
    "cursor",
    "has_more",
    "freshness"
  ],
  "additionalProperties": true
}
