{
  "openapi": "3.1.1",
  "info": {
    "title": "Roundify Public API",
    "description": "Roundify public read-only API.\n\nThese endpoints expose only tournaments that an enabled club publishes or that the operator explicitly publishes through the versioned global catalog. They never import, refresh, mutate, or generate narratives. Chess-Results remains the original published source; consumers must respect the organizer's publication authorization.\n\nResponses use JSON. Club catalog endpoints permit anonymous cross-origin GET requests. Cache validators are included where documented.\n\nFor API access, support, or authorization questions, email [api@roundify.org](mailto:api@roundify.org).",
    "contact": {
      "name": "Thomas Claudius Thomsen",
      "email": "api@roundify.org"
    },
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://roundify.org/"
    }
  ],
  "paths": {
    "/api/clubs/{slug}/tournaments": {
      "get": {
        "tags": [
          "ClubTournaments"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClubCatalogResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClubCatalogResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClubCatalogResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/clubs/{slug}/tournaments/{id}": {
      "get": {
        "tags": [
          "ClubTournaments"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TournamentResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TournamentResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TournamentResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/clubs/{slug}/tournaments/{id}/standings": {
      "get": {
        "tags": [
          "ClubTournaments"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CurrentStandingsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CurrentStandingsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CurrentStandingsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/clubs/{slug}/tournaments/{id}/rounds/{round}": {
      "get": {
        "tags": [
          "ClubTournaments"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "round",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RoundResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoundResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoundResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/clubs/{slug}/tournaments/{id}/live": {
      "get": {
        "tags": [
          "ClubTournaments"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LiveRoundResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveRoundResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveRoundResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/tournaments": {
      "get": {
        "tags": [
          "PublicTournaments"
        ],
        "parameters": [
          {
            "name": "tag",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicTournamentSummaryResponse"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicTournamentSummaryResponse"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicTournamentSummaryResponse"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/tournaments/{id}": {
      "get": {
        "tags": [
          "PublicTournaments"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTournamentDetailResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTournamentDetailResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTournamentDetailResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/tournaments/{id}/standings": {
      "get": {
        "tags": [
          "PublicTournaments"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicStandingsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicStandingsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicStandingsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/tournaments/{id}/rounds/{round}": {
      "get": {
        "tags": [
          "PublicTournaments"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "round",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRoundResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRoundResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRoundResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/tournaments/{id}/live": {
      "get": {
        "tags": [
          "PublicTournaments"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRoundResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRoundResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRoundResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/tournaments/{id}/recaps": {
      "get": {
        "tags": [
          "PublicTournaments"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "language",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "es"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRecapsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRecapsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRecapsResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ClubCatalogResponse": {
        "required": [
          "clubId",
          "slug",
          "name",
          "tournaments"
        ],
        "type": "object",
        "properties": {
          "clubId": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "tournaments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClubTournamentSummaryResponse"
            }
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "logoPath": {
            "type": [
              "null",
              "string"
            ]
          },
          "websiteUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultLanguage": {
            "type": [
              "null",
              "string"
            ]
          },
          "timeZone": {
            "type": [
              "null",
              "string"
            ]
          },
          "brandColor": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ClubTournamentSummaryResponse": {
        "required": [
          "tournament",
          "tags",
          "displayOrder"
        ],
        "type": "object",
        "properties": {
          "tournament": {
            "$ref": "#/components/schemas/TournamentSummaryResponse"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "displayOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "CurrentStandingsResponse": {
        "required": [
          "tournamentId",
          "tournamentName",
          "afterRound",
          "lastUpdatedAt",
          "tieBreakLabels",
          "rows"
        ],
        "type": "object",
        "properties": {
          "tournamentId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "tournamentName": {
            "type": "string"
          },
          "afterRound": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "lastUpdatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "tieBreakLabels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StandingRowResponse"
            }
          }
        }
      },
      "GameResponse": {
        "required": [
          "boardNumber",
          "whitePlayerNumber",
          "blackPlayerNumber",
          "result",
          "rawResult",
          "provisionalPoints",
          "firstSeenAt",
          "lastSeenAt",
          "resultChangedAt"
        ],
        "type": "object",
        "properties": {
          "boardNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The positive board number within the round.",
            "format": "int32"
          },
          "whitePlayerNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The tournament-local white player number, when assigned.",
            "format": "int32"
          },
          "blackPlayerNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The tournament-local black player number, when assigned.",
            "format": "int32"
          },
          "result": {
            "description": "The normalized result, serialized as a string enum.",
            "$ref": "#/components/schemas/GameResult"
          },
          "rawResult": {
            "type": [
              "null",
              "string"
            ],
            "description": "The unmodified source result text, when available."
          },
          "provisionalPoints": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "The source-published provisional points for an unfinished game, when applicable.",
            "format": "double"
          },
          "firstSeenAt": {
            "type": "string",
            "description": "When this board was first retrieved.",
            "format": "date-time"
          },
          "lastSeenAt": {
            "type": "string",
            "description": "When this board was most recently retrieved.",
            "format": "date-time"
          },
          "resultChangedAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the normalized result was first published or last corrected.",
            "format": "date-time"
          }
        },
        "description": "A board pairing or unpaired entry within a round."
      },
      "GameResult": {
        "enum": [
          "Pending",
          "WhiteWin",
          "Draw",
          "BlackWin",
          "Bye",
          "WhiteForfeitWin",
          "BlackForfeitWin",
          "DoubleForfeit",
          "Unplayed",
          "Adjourned",
          "Unknown"
        ]
      },
      "LiveGameRow": {
        "required": [
          "boardNumber",
          "white",
          "black",
          "result",
          "resultText",
          "resultChangedAt"
        ],
        "type": "object",
        "properties": {
          "boardNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The source board number.",
            "format": "int32"
          },
          "white": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The white player, or `null` for an unpaired entry.",
                "$ref": "#/components/schemas/LivePlayer"
              }
            ]
          },
          "black": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The black player, or `null` for an unpaired entry.",
                "$ref": "#/components/schemas/LivePlayer"
              }
            ]
          },
          "result": {
            "description": "The normalized result, serialized as a string enum.",
            "$ref": "#/components/schemas/GameResult"
          },
          "resultText": {
            "type": "string",
            "description": "The result text suitable for display."
          },
          "resultChangedAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the result was first published or last corrected.",
            "format": "date-time"
          }
        },
        "description": "A display-ready live game."
      },
      "LivePlayer": {
        "required": [
          "sourcePlayerNumber",
          "name",
          "rating",
          "title",
          "federation"
        ],
        "type": "object",
        "properties": {
          "sourcePlayerNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The tournament-local player identifier.",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "description": "The player display name."
          },
          "rating": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The player rating, when available.",
            "format": "int32"
          },
          "title": {
            "type": [
              "null",
              "string"
            ],
            "description": "The player title, when available."
          },
          "federation": {
            "type": [
              "null",
              "string"
            ],
            "description": "The player federation, when available."
          }
        },
        "description": "A player display value embedded in the live projection."
      },
      "LiveRoundResponse": {
        "required": [
          "tournamentId",
          "tournamentName",
          "roundNumber",
          "totalRounds",
          "lastUpdatedAt",
          "isComplete",
          "games",
          "status"
        ],
        "type": "object",
        "properties": {
          "tournamentId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The Chess-Results tournament ID.",
            "format": "int64"
          },
          "tournamentName": {
            "type": "string",
            "description": "The tournament display name."
          },
          "roundNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The actual newest round with published pairings.",
            "format": "int32"
          },
          "totalRounds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The published total number of rounds, when available.",
            "format": "int32"
          },
          "lastUpdatedAt": {
            "type": "string",
            "description": "When this round was most recently retrieved.",
            "format": "date-time"
          },
          "isComplete": {
            "type": "boolean",
            "description": "Whether every published game has a final result."
          },
          "games": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LiveGameRow"
            },
            "description": "Display-ready games by board."
          },
          "status": {
            "description": "The derived tournament publication status at response time.",
            "$ref": "#/components/schemas/TournamentStatus"
          }
        },
        "description": "The latest published round with player display values resolved."
      },
      "PlayerResponse": {
        "required": [
          "sourcePlayerNumber",
          "startingRank",
          "fideId",
          "name",
          "title",
          "rating",
          "federation",
          "club"
        ],
        "type": "object",
        "properties": {
          "sourcePlayerNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The tournament-local player identifier.",
            "format": "int32"
          },
          "startingRank": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The published starting rank, when available.",
            "format": "int32"
          },
          "fideId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The published FIDE ID, when available.",
            "format": "int64"
          },
          "name": {
            "type": "string",
            "description": "The player display name."
          },
          "title": {
            "type": [
              "null",
              "string"
            ],
            "description": "The player title, when available."
          },
          "rating": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The player rating, when available.",
            "format": "int32"
          },
          "federation": {
            "type": [
              "null",
              "string"
            ],
            "description": "The player federation, when available."
          },
          "club": {
            "type": [
              "null",
              "string"
            ],
            "description": "The player club, when available."
          }
        },
        "description": "A player as published within one tournament."
      },
      "PublicGameResponse": {
        "required": [
          "board",
          "white",
          "black",
          "result",
          "resultText",
          "isBye",
          "resultChangedAt"
        ],
        "type": "object",
        "properties": {
          "board": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "white": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicPlayerResponse"
              }
            ]
          },
          "black": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicPlayerResponse"
              }
            ]
          },
          "result": {
            "type": "string"
          },
          "resultText": {
            "type": "string"
          },
          "isBye": {
            "type": "boolean"
          },
          "resultChangedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "PublicPlayerResponse": {
        "required": [
          "sourcePlayerNumber",
          "name",
          "rating",
          "title",
          "federation",
          "club"
        ],
        "type": "object",
        "properties": {
          "sourcePlayerNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "rating": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "federation": {
            "type": [
              "null",
              "string"
            ]
          },
          "club": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PublicRecapResponse": {
        "required": [
          "kind",
          "round",
          "headline",
          "preview",
          "paragraphs"
        ],
        "type": "object",
        "properties": {
          "kind": {
            "type": "string"
          },
          "round": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "headline": {
            "type": "string"
          },
          "preview": {
            "type": [
              "null",
              "string"
            ]
          },
          "paragraphs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PublicRecapsResponse": {
        "required": [
          "tournamentId",
          "language",
          "items"
        ],
        "type": "object",
        "properties": {
          "tournamentId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "language": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicRecapResponse"
            }
          }
        }
      },
      "PublicRoundResponse": {
        "required": [
          "tournamentId",
          "roundNumber",
          "isComplete",
          "lastScrapedAt",
          "lastSourceChangeAt",
          "games",
          "unpairedPlayers"
        ],
        "type": "object",
        "properties": {
          "tournamentId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "roundNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isComplete": {
            "type": "boolean"
          },
          "lastScrapedAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastSourceChangeAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "games": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicGameResponse"
            }
          },
          "unpairedPlayers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicUnpairedPlayerResponse"
            }
          }
        }
      },
      "PublicStandingRowResponse": {
        "required": [
          "rank",
          "sourcePlayerNumber",
          "name",
          "title",
          "rating",
          "club",
          "points",
          "tieBreakValues"
        ],
        "type": "object",
        "properties": {
          "rank": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "sourcePlayerNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "rating": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "club": {
            "type": [
              "null",
              "string"
            ]
          },
          "points": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "tieBreakValues": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PublicStandingsResponse": {
        "required": [
          "tournamentId",
          "afterRound",
          "lastScrapedAt",
          "tieBreakLabels",
          "rows"
        ],
        "type": "object",
        "properties": {
          "tournamentId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "afterRound": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "lastScrapedAt": {
            "type": "string",
            "format": "date-time"
          },
          "tieBreakLabels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicStandingRowResponse"
            }
          }
        }
      },
      "PublicTournamentDetailResponse": {
        "required": [
          "id",
          "name",
          "location",
          "startDate",
          "endDate",
          "status",
          "currentRound",
          "totalRounds",
          "playerCount",
          "lastScrapedAt",
          "lastSourceChangeAt",
          "sourceUrl",
          "availableRounds",
          "tags"
        ],
        "type": "object",
        "properties": {
          "id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "location": {
            "type": [
              "null",
              "string"
            ]
          },
          "startDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "status": {
            "type": "string"
          },
          "currentRound": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalRounds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "playerCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "lastScrapedAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastSourceChangeAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "sourceUrl": {
            "type": "string"
          },
          "availableRounds": {
            "type": "array",
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PublicTournamentSummaryResponse": {
        "required": [
          "id",
          "name",
          "location",
          "startDate",
          "endDate",
          "status",
          "currentRound",
          "totalRounds",
          "playerCount",
          "lastScrapedAt",
          "lastSourceChangeAt",
          "tags"
        ],
        "type": "object",
        "properties": {
          "id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "location": {
            "type": [
              "null",
              "string"
            ]
          },
          "startDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "status": {
            "type": "string"
          },
          "currentRound": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalRounds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "playerCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "lastScrapedAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastSourceChangeAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PublicUnpairedPlayerResponse": {
        "required": [
          "sourcePlayerNumber",
          "name"
        ],
        "type": "object",
        "properties": {
          "sourcePlayerNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "RoundResponse": {
        "required": [
          "roundNumber",
          "firstScrapedAt",
          "lastScrapedAt",
          "lastSourceChangeAt",
          "isComplete",
          "games"
        ],
        "type": "object",
        "properties": {
          "roundNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The source round number.",
            "format": "int32"
          },
          "firstScrapedAt": {
            "type": "string",
            "description": "When the round was first retrieved.",
            "format": "date-time"
          },
          "lastScrapedAt": {
            "type": "string",
            "description": "When the round was most recently retrieved.",
            "format": "date-time"
          },
          "lastSourceChangeAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "When meaningful round data last changed.",
            "format": "date-time"
          },
          "isComplete": {
            "type": "boolean",
            "description": "Whether every published game has a final result."
          },
          "games": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameResponse"
            },
            "description": "Games, identified by board number."
          }
        },
        "description": "A stored tournament round and its games."
      },
      "StandingRowResponse": {
        "required": [
          "rank",
          "sourcePlayerNumber",
          "name",
          "title",
          "internationalRating",
          "nationalRating",
          "gender",
          "type",
          "group",
          "federation",
          "club",
          "points",
          "tieBreakValues"
        ],
        "type": "object",
        "properties": {
          "rank": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "sourcePlayerNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "internationalRating": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "nationalRating": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "gender": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "group": {
            "type": [
              "null",
              "string"
            ]
          },
          "federation": {
            "type": [
              "null",
              "string"
            ]
          },
          "club": {
            "type": [
              "null",
              "string"
            ]
          },
          "points": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "tieBreakValues": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "TournamentResponse": {
        "required": [
          "externalId",
          "sourceUrl",
          "name",
          "location",
          "federation",
          "organizer",
          "tournamentDirector",
          "chiefArbiter",
          "deputyChiefArbiter",
          "arbiters",
          "timeControl",
          "tournamentType",
          "ratingCalculation",
          "fideEventId",
          "averageRating",
          "averageAge",
          "pairingProgram",
          "sourceLastUpdated",
          "sourceCreator",
          "startDate",
          "endDate",
          "totalRounds",
          "currentRound",
          "trackingEnabled",
          "refreshIntervalSeconds",
          "nextRefreshAt",
          "createdAt",
          "lastScrapedAt",
          "lastSourceChangeAt",
          "players"
        ],
        "type": "object",
        "properties": {
          "externalId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "The Chess-Results tournament ID.",
            "format": "int64"
          },
          "sourceUrl": {
            "type": "string",
            "description": "The source tournament URL."
          },
          "name": {
            "type": "string",
            "description": "The tournament name published by the source."
          },
          "location": {
            "type": [
              "null",
              "string"
            ],
            "description": "The published location, when available."
          },
          "federation": {
            "type": [
              "null",
              "string"
            ],
            "description": "The published federation, when available."
          },
          "organizer": {
            "type": [
              "null",
              "string"
            ],
            "description": "The published organizer, when available."
          },
          "tournamentDirector": {
            "type": [
              "null",
              "string"
            ],
            "description": "The published tournament director, when available."
          },
          "chiefArbiter": {
            "type": [
              "null",
              "string"
            ],
            "description": "The published chief arbiter, when available."
          },
          "deputyChiefArbiter": {
            "type": [
              "null",
              "string"
            ],
            "description": "The published deputy chief arbiter, when available."
          },
          "arbiters": {
            "type": [
              "null",
              "string"
            ],
            "description": "The published arbiters, when available."
          },
          "timeControl": {
            "type": [
              "null",
              "string"
            ],
            "description": "The published time control, when available."
          },
          "tournamentType": {
            "type": [
              "null",
              "string"
            ],
            "description": "The published tournament type, when available."
          },
          "ratingCalculation": {
            "type": [
              "null",
              "string"
            ],
            "description": "The published rating calculation, when available."
          },
          "fideEventId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The published FIDE event ID, when available.",
            "format": "int64"
          },
          "averageRating": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The published average rating, when available.",
            "format": "int32"
          },
          "averageAge": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The published average age, when available.",
            "format": "int32"
          },
          "pairingProgram": {
            "type": [
              "null",
              "string"
            ],
            "description": "The published pairing program, when available."
          },
          "sourceLastUpdated": {
            "type": [
              "null",
              "string"
            ],
            "description": "The source's published last-update value, when available."
          },
          "sourceCreator": {
            "type": [
              "null",
              "string"
            ],
            "description": "The source's published creator or last uploader, when available."
          },
          "startDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "The published start date, when available.",
            "format": "date"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "The published end date, when available.",
            "format": "date"
          },
          "totalRounds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The published number of rounds, when available.",
            "format": "int32"
          },
          "currentRound": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The newest round with published pairings, when available.",
            "format": "int32"
          },
          "trackingEnabled": {
            "type": "boolean",
            "description": "Whether scheduled refreshes are enabled."
          },
          "refreshIntervalSeconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "The scheduled refresh interval, when tracking is configured.",
            "format": "int32"
          },
          "nextRefreshAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "The next scheduled refresh time, when tracking is enabled.",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "description": "When this local tournament snapshot was first created.",
            "format": "date-time"
          },
          "lastScrapedAt": {
            "type": "string",
            "description": "When the source was most recently fetched.",
            "format": "date-time"
          },
          "lastSourceChangeAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "When meaningful tournament source data last changed.",
            "format": "date-time"
          },
          "players": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlayerResponse"
            },
            "description": "Players identified by their tournament-local source player number."
          }
        },
        "description": "A stored tournament and its tournament-local player directory."
      },
      "TournamentStatus": {
        "enum": [
          "Imported",
          "Upcoming",
          "Live",
          "ResultsPending",
          "AwaitingNextRound",
          "UpdateDelayed",
          "Complete"
        ]
      },
      "TournamentSummaryResponse": {
        "required": [
          "tournamentId",
          "name",
          "location",
          "startDate",
          "endDate",
          "playerCount",
          "currentRound",
          "totalRounds",
          "trackingEnabled",
          "lastScrapedAt",
          "status"
        ],
        "type": "object",
        "properties": {
          "tournamentId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "location": {
            "type": [
              "null",
              "string"
            ]
          },
          "startDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "playerCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "currentRound": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalRounds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "trackingEnabled": {
            "type": "boolean"
          },
          "lastScrapedAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string"
          }
        },
        "description": "A lightweight tournament value for collection views."
      }
    }
  },
  "tags": [
    {
      "name": "ClubTournaments"
    },
    {
      "name": "PublicTournaments"
    }
  ]
}