{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/ringsaturn/xue/blob/main/docs/schemas/alerts-archive-line.schema.json",
  "title": "AlertsArchiveRecord",
  "description": "One line of alerts/archive/<YYYY>/<MM>/alerts.jsonl (docs/alerts.md section 12.2): an alert in force in some round of the month, once, as the month's last round that listed it published it. That network is the id's, that alert is the line of the same id, and that by is given for a replaced alert and only for one are the readers' own checks.",
  "type": "object",
  "required": ["id", "network", "first", "ended", "alert"],
  "properties": {
    "id": {"$ref": "alerts-line.schema.json#/$defs/AlertId"},
    "network": {"$ref": "alerts-archive-catalog.schema.json#/$defs/Network"},
    "first": {"description": "The first round of the month whose snapshot listed the alert.", "$ref": "alerts-archive-catalog.schema.json#/$defs/Round"},
    "ended": {
      "description": "Null while the alert was in force at the month's last round folded in; else the ended[] entry (docs/alerts.md section 7) that listed it.",
      "anyOf": [{"$ref": "#/$defs/Ended"}, {"type": "null"}]
    },
    "alert": {"description": "The alert's line (docs/alerts.md section 6), the object the round published.", "$ref": "alerts-line.schema.json"}
  },
  "$defs": {
    "Ended": {
      "description": "When and why the alert ended.",
      "type": "object",
      "required": ["time", "reason"],
      "properties": {
        "time": {"description": "The round whose ended[] listed the alert.", "$ref": "alerts-archive-catalog.schema.json#/$defs/Round"},
        "reason": {"$ref": "alerts-archive-catalog.schema.json#/$defs/EndedReason"},
        "by": {"description": "The successor of a replaced alert.", "$ref": "alerts-line.schema.json#/$defs/AlertId"}
      }
    }
  }
}
