{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/livetennisapi-com/json-schema/livetennisapi-com-player-stoppage-schema.json",
  "title": "PlayerStoppage",
  "description": "One row of GET /players/{playerId}/stoppages — an in-match stoppage on one of the player's matches, or a match the player did not finish. Stoppage rows carry `score_at`, `duration_seconds` and `reason`; outcome rows carry `final_score` when a score row exists. Never inferred except `pause` (source_stated false).",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/livetennisapi-com-players-api-openapi.yml#/components/schemas/PlayerStoppage",
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "medical_timeout",
        "trainer_called",
        "toilet_break",
        "pause",
        "stoppage",
        "retirement",
        "walkover"
      ]
    },
    "at": {
      "type": "string",
      "format": "date-time",
      "description": "UTC instant of the stoppage (the source's own instant) or of the recorded outcome."
    },
    "match_id": {
      "type": "integer"
    },
    "tournament": {
      "type": [
        "string",
        "null"
      ]
    },
    "opponent": {
      "type": [
        "object",
        "null"
      ],
      "description": "The other side of the match; null when unknown.",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "score_at": {
      "type": "object",
      "description": "Stoppage rows only — the score at the stoppage.",
      "properties": {
        "sets": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "integer"
          }
        },
        "games": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        },
        "points": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "final_score": {
      "type": "object",
      "description": "Outcome rows only, when a score row exists — sets and games of the newest score row.",
      "properties": {
        "sets": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "games": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        }
      }
    },
    "attribution": {
      "type": "string",
      "enum": [
        "player",
        "match"
      ],
      "description": "`player` — the source named this player's side (or the result names them as the non-winner); `match` — the source stated the stoppage for the match without a side, so the row appears in both players' lists."
    },
    "duration_seconds": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Seconds to the matching end row; null when no end row was recorded and on outcome rows."
    },
    "source_stated": {
      "type": "boolean",
      "description": "True when a scorer, umpire, live-scoring state or result stated it; false only on `pause` (clock-inferred)."
    },
    "reason": {
      "type": "string",
      "description": "Stoppage rows only — the stated reason; `unknown` when only a flag reached us."
    }
  }
}