{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.sportsnip.com/schemas/v1/score_event.json",
  "title": "SportSnip score event (v1)",
  "description": "A change of score read from the scoreboard.",
  "type": "object",
  "required": [
    "id",
    "game_id",
    "side",
    "kind",
    "from",
    "to",
    "board_change_stream_s",
    "detected_at",
    "late",
    "confidence",
    "clip_id",
    "corrections",
    "cursor"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "game_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "side": {
      "enum": [
        "home",
        "away"
      ]
    },
    "kind": {
      "enum": [
        "try",
        "conversion",
        "penalty",
        "drop_goal",
        "converted_try",
        "score"
      ],
      "description": "converted_try: the clipper couldn't split try and conversion. score: a rise it couldn't name (e.g. +8)."
    },
    "from": {
      "type": "integer",
      "minimum": 0,
      "description": "That side's score before"
    },
    "to": {
      "type": "integer",
      "minimum": 0,
      "description": "That side's score after"
    },
    "board_change_stream_s": {
      "type": [
        "number",
        "null"
      ],
      "description": "Seconds from the start of the event's recording"
    },
    "detected_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "ISO 8601, UTC"
    },
    "late": {
      "type": "boolean"
    },
    "confidence": {
      "enum": [
        "board",
        "verified",
        "corrected"
      ]
    },
    "clip_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "corrections": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601, UTC"
          },
          "was": {
            "type": "object"
          },
          "now": {
            "type": "object"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "description": "Earlier values, oldest first. The fields above are always the latest."
    },
    "cursor": {
      "type": "string",
      "description": "Pass the response's next as since= to get only newer or changed rows"
    }
  }
}
