{
  "openapi": "3.0.0",
  "info": {
    "title": "FairGame public tournament API",
    "description": "Read-only, unauthenticated access to published tournaments: organisations, tournaments, the full schedule and standings snapshot, match detail, announcements and the live match clock. Every response is JSON; list and snapshot responses carry an ETag and answer 304 to a matching If-None-Match.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://public-api.fairgame.is",
      "description": "Production"
    },
    {
      "url": "https://public-api.dev.fairgame.is",
      "description": "Development"
    }
  ],
  "paths": {
    "/public/tournaments": {
      "get": {
        "operationId": "listPublicTournamentDiscovery",
        "summary": "List public tournaments across all tenants.",
        "tags": [
          "Public"
        ],
        "x-fairgame-auth": "public",
        "responses": {
          "200": {
            "description": "List of public tournaments across all tenants.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTournamentDiscoveryResponse"
                }
              }
            }
          },
          "304": {
            "description": "Response is unchanged for the supplied ETag."
          }
        }
      }
    },
    "/public/tenants": {
      "get": {
        "operationId": "listPublicTenants",
        "summary": "List all tenants (public).",
        "tags": [
          "Public"
        ],
        "x-fairgame-auth": "public",
        "responses": {
          "200": {
            "description": "List of all tenants.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTenantListResponse"
                }
              }
            }
          },
          "304": {
            "description": "Response is unchanged for the supplied ETag."
          }
        }
      }
    },
    "/public/tenants/{tenantSlug}/tournaments": {
      "get": {
        "operationId": "listPublicTournaments",
        "summary": "List published tournaments for a tenant (public).",
        "tags": [
          "Public"
        ],
        "x-fairgame-auth": "public",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "tenantSlug",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List of tournaments for the given tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTournamentListResponse"
                }
              }
            }
          },
          "304": {
            "description": "Response is unchanged for the supplied ETag."
          },
          "404": {
            "description": "Tenant not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/tenants/{tenantSlug}/tournaments/{tournamentSlug}/summary": {
      "get": {
        "operationId": "getPublicTournamentSummary",
        "summary": "Get lean tournament summary (public).",
        "tags": [
          "Public"
        ],
        "x-fairgame-auth": "public",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "tenantSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "tournamentSlug",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Lean tournament header + section counts for first paint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTournamentSummaryResponse"
                }
              }
            }
          },
          "304": {
            "description": "Response is unchanged for the supplied ETag."
          },
          "404": {
            "description": "Tenant or tournament not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/tenants/{tenantSlug}/tournaments/{tournamentSlug}": {
      "get": {
        "operationId": "getPublicTournamentDetail",
        "summary": "Get tournament detail snapshot (public).",
        "tags": [
          "Public"
        ],
        "x-fairgame-auth": "public",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "tenantSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "tournamentSlug",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Full tournament snapshot for public display.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTournamentDetailResponse"
                }
              }
            }
          },
          "304": {
            "description": "Response is unchanged for the supplied ETag."
          },
          "404": {
            "description": "Tenant or tournament not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/v2/tenants/{tenantSlug}/tournaments/{tournamentSlug}": {
      "get": {
        "operationId": "getPublicTournamentDetailV2",
        "summary": "Get tournament detail snapshot (public). Includes unresolved fixtures.",
        "tags": [
          "Public"
        ],
        "x-fairgame-auth": "public",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "tenantSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "tournamentSlug",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Full tournament snapshot for public display.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTournamentDetailResponse"
                }
              }
            }
          },
          "304": {
            "description": "Response is unchanged for the supplied ETag."
          },
          "404": {
            "description": "Tenant or tournament not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/tenants/{tenantSlug}/tournaments/{tournamentSlug}/matches/{matchId}": {
      "get": {
        "operationId": "getPublicMatchDetail",
        "summary": "Get match detail with resolved names (public).",
        "tags": [
          "Public"
        ],
        "x-fairgame-auth": "public",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "tenantSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "tournamentSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "matchId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Single match detail with resolved names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicMatchDetailResponse"
                }
              }
            }
          },
          "304": {
            "description": "Response is unchanged for the supplied ETag."
          },
          "404": {
            "description": "Tenant, tournament, or match not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/v2/tenants/{tenantSlug}/tournaments/{tournamentSlug}/matches/{matchId}": {
      "get": {
        "operationId": "getPublicMatchDetailV2",
        "summary": "Get match detail with resolved names (public). Includes unresolved fixtures.",
        "tags": [
          "Public"
        ],
        "x-fairgame-auth": "public",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "tenantSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "tournamentSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "matchId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Single match detail with resolved names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicMatchDetailResponse"
                }
              }
            }
          },
          "304": {
            "description": "Response is unchanged for the supplied ETag."
          },
          "404": {
            "description": "Tenant, tournament, or match not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/tenants/{tenantSlug}/tournaments/{tournamentSlug}/announcements": {
      "get": {
        "operationId": "listPublicTournamentAnnouncements",
        "summary": "List a tournament's announcements (public).",
        "tags": [
          "Public"
        ],
        "x-fairgame-auth": "public",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "tenantSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "tournamentSlug",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Organizer announcements for the tournament, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "announcements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "body": {
                            "type": "string"
                          },
                          "sentAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "subject",
                          "body",
                          "sentAt"
                        ]
                      }
                    }
                  },
                  "required": [
                    "announcements"
                  ]
                }
              }
            }
          },
          "304": {
            "description": "Response is unchanged for the supplied ETag."
          },
          "404": {
            "description": "Tenant or tournament not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/tenants/{tenantSlug}/tournaments/{tournamentSlug}/clock": {
      "get": {
        "operationId": "getPublicTournamentClock",
        "summary": "Read a tournament's public match clock.",
        "tags": [
          "Public"
        ],
        "x-fairgame-auth": "public",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "tenantSlug",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "tournamentSlug",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The tournament's shared match clock and its per-court board.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTournamentClockResponse"
                }
              }
            }
          },
          "404": {
            "description": "Tenant or tournament not found, or the tournament is not public yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTournamentClockErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/mobile/releases/{platform}": {
      "get": {
        "operationId": "getPublicMobileRelease",
        "summary": "Get mobile release metadata (public).",
        "tags": [
          "Public"
        ],
        "x-fairgame-auth": "public",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "enum": [
                "ios",
                "android"
              ]
            },
            "required": true,
            "name": "platform",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Current optional update-prompt metadata for one mobile platform.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileReleaseResponse"
                }
              }
            }
          },
          "304": {
            "description": "Response is unchanged for the supplied ETag."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AuthErrorResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "challengeName": {
            "type": "string"
          },
          "session": {
            "type": "string"
          }
        },
        "required": [
          "message"
        ]
      },
      "BracketSideSource": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "none"
                ]
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "group_rank"
                ]
              },
              "groupId": {
                "type": "string",
                "format": "uuid"
              },
              "groupName": {
                "type": "string"
              },
              "rank": {
                "type": "integer"
              }
            },
            "required": [
              "kind",
              "groupId",
              "groupName",
              "rank"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "winner_of"
                ]
              },
              "bracketId": {
                "type": "string",
                "format": "uuid"
              },
              "code": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "bracketId",
              "code"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "loser_of"
                ]
              },
              "bracketId": {
                "type": "string",
                "format": "uuid"
              },
              "code": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "bracketId",
              "code"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "seed"
                ]
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "bye"
                ]
              }
            },
            "required": [
              "kind"
            ]
          }
        ]
      },
      "MobileRelease": {
        "type": "object",
        "nullable": true,
        "properties": {
          "platform": {
            "type": "string",
            "enum": [
              "ios",
              "android"
            ]
          },
          "version": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^\\d+(?:\\.\\d+){1,2}$"
          },
          "buildIdentifier": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^\\d+(?:\\.\\d+){0,2}$"
          },
          "storeUrl": {
            "type": "string",
            "format": "uri"
          },
          "minimumOsVersion": {
            "type": "string",
            "maxLength": 32,
            "pattern": "^\\d+(?:\\.\\d+){1,2}$"
          },
          "releasedAt": {
            "type": "string",
            "format": "date-time"
          },
          "promptEnabled": {
            "type": "boolean"
          }
        },
        "required": [
          "platform",
          "version",
          "buildIdentifier",
          "storeUrl",
          "minimumOsVersion",
          "releasedAt",
          "promptEnabled"
        ]
      },
      "MobileReleaseResponse": {
        "type": "object",
        "properties": {
          "release": {
            "$ref": "#/components/schemas/MobileRelease"
          }
        },
        "required": [
          "release"
        ]
      },
      "PublicBracketSlot": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "categoryId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "track": {
            "type": "string",
            "enum": [
              "championship",
              "plate"
            ]
          },
          "tier": {
            "type": "integer",
            "nullable": true
          },
          "ordinal": {
            "type": "integer"
          },
          "treeName": {
            "type": "string",
            "nullable": true
          },
          "tiePolicy": {
            "type": "string",
            "enum": [
              "shootout",
              "draw_allowed",
              "standings_tiebreak"
            ]
          },
          "position": {
            "type": "integer"
          },
          "code": {
            "type": "string",
            "nullable": true
          },
          "section": {
            "type": "string",
            "nullable": true
          },
          "roundIndex": {
            "type": "integer",
            "nullable": true
          },
          "roundsInSection": {
            "type": "integer",
            "nullable": true
          },
          "playOrder": {
            "type": "integer",
            "nullable": true
          },
          "decidesRanks": {
            "type": "object",
            "nullable": true,
            "properties": {
              "from": {
                "type": "integer"
              },
              "to": {
                "type": "integer"
              }
            },
            "required": [
              "from",
              "to"
            ]
          },
          "round": {
            "type": "string",
            "nullable": true
          },
          "homeTeamId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "homeTeamName": {
            "type": "string",
            "nullable": true
          },
          "homeTeamLogo": {
            "type": "string",
            "nullable": true
          },
          "homeSource": {
            "$ref": "#/components/schemas/BracketSideSource"
          },
          "awayTeamId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "awayTeamName": {
            "type": "string",
            "nullable": true
          },
          "awayTeamLogo": {
            "type": "string",
            "nullable": true
          },
          "awaySource": {
            "$ref": "#/components/schemas/BracketSideSource"
          },
          "winnerTeamId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "winnerTeamName": {
            "type": "string",
            "nullable": true
          },
          "matchId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "matchStatus": {
            "type": "string",
            "nullable": true
          },
          "homeScore": {
            "type": "integer",
            "nullable": true
          },
          "awayScore": {
            "type": "integer",
            "nullable": true
          },
          "homePenalties": {
            "type": "integer",
            "nullable": true
          },
          "awayPenalties": {
            "type": "integer",
            "nullable": true
          },
          "pitchId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "pitchName": {
            "type": "string",
            "nullable": true
          },
          "date": {
            "type": "string",
            "nullable": true
          },
          "time": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "categoryId",
          "track",
          "tier",
          "ordinal",
          "treeName",
          "tiePolicy",
          "position",
          "code",
          "section",
          "roundIndex",
          "roundsInSection",
          "playOrder",
          "decidesRanks",
          "round",
          "homeTeamId",
          "homeTeamName",
          "homeTeamLogo",
          "homeSource",
          "awayTeamId",
          "awayTeamName",
          "awayTeamLogo",
          "awaySource",
          "winnerTeamId",
          "winnerTeamName",
          "matchId",
          "matchStatus",
          "homeScore",
          "awayScore",
          "homePenalties",
          "awayPenalties",
          "pitchId",
          "pitchName",
          "date",
          "time"
        ]
      },
      "PublicClub": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "shortName": {
            "type": "string",
            "nullable": true
          },
          "logoUrl": {
            "type": "string",
            "nullable": true,
            "maxLength": 500
          }
        },
        "required": [
          "id",
          "name",
          "shortName",
          "logoUrl"
        ]
      },
      "PublicMatchDetailResponse": {
        "type": "object",
        "properties": {
          "match": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "homeTeam": {
                "type": "object",
                "nullable": true,
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              "awayTeam": {
                "type": "object",
                "nullable": true,
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              "homeScore": {
                "type": "integer",
                "nullable": true
              },
              "awayScore": {
                "type": "integer",
                "nullable": true
              },
              "homePenalties": {
                "type": "integer",
                "nullable": true
              },
              "awayPenalties": {
                "type": "integer",
                "nullable": true
              },
              "status": {
                "type": "string"
              },
              "date": {
                "type": "string",
                "nullable": true
              },
              "time": {
                "type": "string",
                "nullable": true
              },
              "pairingReleaseTime": {
                "type": "string",
                "nullable": true
              },
              "pairingReleaseAt": {
                "type": "string",
                "nullable": true,
                "format": "date-time",
                "description": "Scheduled adaptive pairing release instant, not proof of a completed draw. Retained after pairing; null for unpublished schedules, abandoned waves and ordinary fixtures. May be absent in older payloads."
              },
              "abandoned": {
                "type": "boolean"
              },
              "durationMinutes": {
                "type": "integer",
                "nullable": true
              },
              "pitch": {
                "type": "object",
                "nullable": true,
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              "group": {
                "type": "object",
                "nullable": true,
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              "roundNumber": {
                "type": "integer",
                "nullable": true
              }
            },
            "required": [
              "id",
              "homeTeam",
              "awayTeam",
              "homeScore",
              "awayScore",
              "homePenalties",
              "awayPenalties",
              "status",
              "date",
              "time",
              "pairingReleaseTime",
              "durationMinutes",
              "pitch",
              "group",
              "roundNumber"
            ]
          },
          "tournament": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "slug"
            ]
          },
          "tenant": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "slug"
            ]
          }
        },
        "required": [
          "match",
          "tournament",
          "tenant"
        ]
      },
      "PublicMatchReferee": {
        "type": "object",
        "properties": {
          "matchId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "teamId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          }
        },
        "required": [
          "matchId",
          "name",
          "teamId"
        ]
      },
      "PublicSnapshotArea": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "location": {
            "type": "string",
            "nullable": true,
            "maxLength": 500
          }
        },
        "required": [
          "id",
          "name",
          "location"
        ]
      },
      "PublicSnapshotCategory": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "gender": {
            "type": "string",
            "nullable": true,
            "enum": [
              "male",
              "female",
              "mixed",
              null
            ]
          },
          "publicStandingsVisible": {
            "type": "boolean",
            "nullable": true
          },
          "sortOrder": {
            "type": "integer",
            "minimum": -2147483648,
            "maximum": 2147483647
          }
        },
        "required": [
          "id",
          "name",
          "gender",
          "publicStandingsVisible",
          "sortOrder"
        ]
      },
      "PublicSnapshotGroup": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "categoryId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "maxLength": 100
          }
        },
        "required": [
          "id",
          "categoryId",
          "name"
        ]
      },
      "PublicSnapshotGroupTeam": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "groupId",
          "teamId"
        ]
      },
      "PublicSnapshotMatch": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "categoryId": {
            "type": "string",
            "format": "uuid"
          },
          "groupId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "homeTeamId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "awayTeamId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "pitchId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "roundNumber": {
            "type": "integer",
            "nullable": true,
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "homeScore": {
            "type": "integer",
            "nullable": true,
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "awayScore": {
            "type": "integer",
            "nullable": true,
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "homePenalties": {
            "type": "integer",
            "nullable": true,
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "resultType": {
            "type": "string",
            "nullable": true,
            "enum": [
              "regulation",
              "overtime",
              "shootout",
              "walkover",
              null
            ]
          },
          "awayPenalties": {
            "type": "integer",
            "nullable": true,
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "status": {
            "type": "string",
            "enum": [
              "locked",
              "waiting",
              "unscheduled",
              "scheduled",
              "in_progress",
              "completed",
              "cancelled",
              "postponed"
            ]
          },
          "date": {
            "type": "string",
            "nullable": true
          },
          "time": {
            "type": "string",
            "nullable": true,
            "maxLength": 5
          },
          "pairingReleaseTime": {
            "type": "string",
            "nullable": true
          },
          "pairingReleaseAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time",
            "description": "Scheduled adaptive pairing release instant, not proof of a completed draw. Retained after pairing; null for unpublished schedules, abandoned waves and ordinary fixtures. May be absent in older payloads."
          },
          "abandoned": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "categoryId",
          "groupId",
          "homeTeamId",
          "awayTeamId",
          "pitchId",
          "roundNumber",
          "homeScore",
          "awayScore",
          "homePenalties",
          "resultType",
          "awayPenalties",
          "status",
          "date",
          "time",
          "pairingReleaseTime"
        ]
      },
      "PublicSnapshotPitch": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "areaId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "surface": {
            "type": "string",
            "nullable": true,
            "enum": [
              "grass",
              "artificial",
              "indoor",
              "other",
              null
            ]
          },
          "location": {
            "type": "string",
            "nullable": true,
            "maxLength": 500
          },
          "latitude": {
            "type": "number",
            "nullable": true,
            "minimum": -140737488355328,
            "maximum": 140737488355327
          },
          "longitude": {
            "type": "number",
            "nullable": true,
            "minimum": -140737488355328,
            "maximum": 140737488355327
          }
        },
        "required": [
          "id",
          "areaId",
          "name",
          "surface",
          "location",
          "latitude",
          "longitude"
        ]
      },
      "PublicSnapshotStanding": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "groupId": {
            "type": "string",
            "format": "uuid"
          },
          "teamId": {
            "type": "string",
            "format": "uuid"
          },
          "played": {
            "type": "integer",
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "won": {
            "type": "integer",
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "drawn": {
            "type": "integer",
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "lost": {
            "type": "integer",
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "wonAfterRegulation": {
            "type": "integer",
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "lostAfterRegulation": {
            "type": "integer",
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "goalsFor": {
            "type": "integer",
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "goalsAgainst": {
            "type": "integer",
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "goalDifference": {
            "type": "integer",
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "points": {
            "type": "integer",
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "withdrawnAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "rating": {
            "type": "number",
            "nullable": true
          },
          "strengthOfSchedule": {
            "type": "number",
            "nullable": true,
            "description": "Sum of scored opponents’ current group points for pre-drawn Swiss pools; null otherwise. Byes contribute zero."
          }
        },
        "required": [
          "id",
          "groupId",
          "teamId",
          "played",
          "won",
          "drawn",
          "lost",
          "wonAfterRegulation",
          "lostAfterRegulation",
          "goalsFor",
          "goalsAgainst",
          "goalDifference",
          "points",
          "withdrawnAt",
          "rating"
        ]
      },
      "PublicSnapshotTeam": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "clubId": {
            "type": "string",
            "nullable": true,
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "withdrawnAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "clubId",
          "name",
          "withdrawnAt"
        ]
      },
      "PublicSnapshotTeamRoundSlot": {
        "type": "object",
        "properties": {
          "teamId": {
            "type": "string",
            "format": "uuid"
          },
          "groupId": {
            "type": "string",
            "format": "uuid"
          },
          "roundNumber": {
            "type": "integer",
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "date": {
            "type": "string"
          },
          "time": {
            "type": "string",
            "maxLength": 5
          },
          "bye": {
            "type": "boolean"
          },
          "abandoned": {
            "type": "boolean"
          }
        },
        "required": [
          "teamId",
          "groupId",
          "roundNumber",
          "date",
          "time",
          "bye"
        ]
      },
      "PublicSnapshotTournament": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "slug": {
            "type": "string",
            "maxLength": 255
          },
          "sportType": {
            "type": "string",
            "nullable": true,
            "maxLength": 50
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "published",
              "in_progress",
              "completed",
              "cancelled"
            ]
          },
          "startDate": {
            "type": "string",
            "nullable": true
          },
          "endDate": {
            "type": "string",
            "nullable": true
          },
          "registrationOpenedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "registrationFeePerTeamIsk": {
            "type": "integer",
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "logoUrl": {
            "type": "string",
            "nullable": true,
            "maxLength": 500
          },
          "themeId": {
            "type": "string",
            "nullable": true,
            "enum": [
              "kinetic-light",
              "kinetic-dark",
              "ember",
              "floodlight",
              "turf",
              null
            ]
          },
          "sponsors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "logoUrl": {
                  "type": "string",
                  "nullable": true,
                  "maxLength": 500
                },
                "linkUrl": {
                  "type": "string",
                  "nullable": true,
                  "maxLength": 500
                }
              },
              "required": [
                "name",
                "logoUrl",
                "linkUrl"
              ]
            },
            "maxItems": 24
          },
          "publicPages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "slug": {
                  "type": "string",
                  "maxLength": 80,
                  "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                },
                "body": {
                  "type": "string",
                  "maxLength": 20000
                }
              },
              "required": [
                "title",
                "slug",
                "body"
              ]
            },
            "maxItems": 12
          },
          "maxPublishedGoalDifference": {
            "type": "integer",
            "nullable": true,
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "publicStandingsVisible": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "sportType",
          "status",
          "startDate",
          "endDate",
          "registrationOpenedAt",
          "registrationFeePerTeamIsk",
          "logoUrl",
          "themeId",
          "sponsors",
          "publicPages",
          "maxPublishedGoalDifference",
          "publicStandingsVisible"
        ]
      },
      "PublicSnapshotTournamentArea": {
        "type": "object",
        "properties": {
          "areaId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "areaId"
        ]
      },
      "PublicSnapshotVenues": {
        "type": "object",
        "properties": {
          "areas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicSnapshotArea"
            }
          },
          "tournamentAreas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicSnapshotTournamentArea"
            }
          },
          "pitches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicSnapshotPitch"
            }
          }
        },
        "required": [
          "areas",
          "tournamentAreas",
          "pitches"
        ]
      },
      "PublicTenant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "indexable": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "indexable"
        ]
      },
      "PublicTenantListResponse": {
        "type": "object",
        "properties": {
          "tenants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicTenant"
            }
          }
        },
        "required": [
          "tenants"
        ]
      },
      "PublicTournament": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "logoUrl": {
            "type": "string",
            "nullable": true,
            "maxLength": 500
          },
          "sportType": {
            "type": "string",
            "nullable": true
          },
          "format": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "startDate": {
            "type": "string",
            "nullable": true
          },
          "endDate": {
            "type": "string",
            "nullable": true
          },
          "location": {
            "type": "string",
            "nullable": true
          },
          "matchCount": {
            "type": "integer"
          },
          "playedMatchCount": {
            "type": "integer"
          },
          "showcase": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "logoUrl",
          "sportType",
          "format",
          "status",
          "startDate",
          "endDate",
          "location",
          "matchCount",
          "playedMatchCount",
          "showcase"
        ]
      },
      "PublicTournamentClockErrorResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "enum": [
              "not-found",
              "not-public"
            ]
          }
        },
        "required": [
          "message"
        ]
      },
      "PublicTournamentClockResponse": {
        "type": "object",
        "properties": {
          "clock": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "idle",
                  "running",
                  "paused",
                  "stopped"
                ]
              },
              "matchSeconds": {
                "type": "integer"
              },
              "bufferSeconds": {
                "type": "integer"
              },
              "anchorRound": {
                "type": "integer"
              },
              "startedAt": {
                "type": "string",
                "nullable": true
              },
              "pausedAt": {
                "type": "string",
                "nullable": true
              },
              "pausedMs": {
                "type": "integer"
              },
              "activeDate": {
                "type": "string",
                "nullable": true
              },
              "usingTournamentDefaults": {
                "type": "boolean"
              }
            },
            "required": [
              "state",
              "matchSeconds",
              "bufferSeconds",
              "anchorRound",
              "startedAt",
              "pausedAt",
              "pausedMs",
              "activeDate",
              "usingTournamentDefaults"
            ]
          },
          "reading": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "idle",
                  "running",
                  "paused",
                  "stopped"
                ]
              },
              "phase": {
                "type": "string",
                "enum": [
                  "match",
                  "buffer"
                ]
              },
              "round": {
                "type": "integer"
              },
              "remainingSeconds": {
                "type": "integer"
              },
              "elapsedSeconds": {
                "type": "integer"
              },
              "phaseSeconds": {
                "type": "integer"
              },
              "ticking": {
                "type": "boolean"
              }
            },
            "required": [
              "state",
              "phase",
              "round",
              "remainingSeconds",
              "elapsedSeconds",
              "phaseSeconds",
              "ticking"
            ]
          },
          "serverTime": {
            "type": "string"
          },
          "tournamentName": {
            "type": "string"
          },
          "activeDate": {
            "type": "string",
            "nullable": true
          },
          "courts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "pitchId": {
                  "type": "string",
                  "format": "uuid"
                },
                "pitchName": {
                  "type": "string"
                },
                "venueName": {
                  "type": "string",
                  "nullable": true
                },
                "current": {
                  "type": "object",
                  "nullable": true,
                  "properties": {
                    "matchId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "categoryName": {
                      "type": "string",
                      "nullable": true
                    },
                    "groupName": {
                      "type": "string",
                      "nullable": true
                    },
                    "homeTeamName": {
                      "type": "string",
                      "nullable": true
                    },
                    "awayTeamName": {
                      "type": "string",
                      "nullable": true
                    },
                    "scheduledTime": {
                      "type": "string",
                      "nullable": true
                    },
                    "status": {
                      "type": "string"
                    },
                    "homeScore": {
                      "type": "integer",
                      "nullable": true
                    },
                    "awayScore": {
                      "type": "integer",
                      "nullable": true
                    }
                  },
                  "required": [
                    "matchId",
                    "categoryName",
                    "groupName",
                    "homeTeamName",
                    "awayTeamName",
                    "scheduledTime",
                    "status",
                    "homeScore",
                    "awayScore"
                  ]
                },
                "next": {
                  "type": "object",
                  "nullable": true,
                  "properties": {
                    "matchId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "categoryName": {
                      "type": "string",
                      "nullable": true
                    },
                    "groupName": {
                      "type": "string",
                      "nullable": true
                    },
                    "homeTeamName": {
                      "type": "string",
                      "nullable": true
                    },
                    "awayTeamName": {
                      "type": "string",
                      "nullable": true
                    },
                    "scheduledTime": {
                      "type": "string",
                      "nullable": true
                    },
                    "status": {
                      "type": "string"
                    },
                    "homeScore": {
                      "type": "integer",
                      "nullable": true
                    },
                    "awayScore": {
                      "type": "integer",
                      "nullable": true
                    }
                  },
                  "required": [
                    "matchId",
                    "categoryName",
                    "groupName",
                    "homeTeamName",
                    "awayTeamName",
                    "scheduledTime",
                    "status",
                    "homeScore",
                    "awayScore"
                  ]
                },
                "fixtureCount": {
                  "type": "integer"
                }
              },
              "required": [
                "pitchId",
                "pitchName",
                "venueName",
                "current",
                "next",
                "fixtureCount"
              ]
            }
          },
          "dayComplete": {
            "type": "boolean"
          }
        },
        "required": [
          "clock",
          "reading",
          "serverTime",
          "tournamentName",
          "activeDate",
          "courts",
          "dayComplete"
        ]
      },
      "PublicTournamentDay": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "dayNumber": {
            "type": "integer"
          },
          "date": {
            "type": "string"
          },
          "gameType": {
            "type": "string",
            "enum": [
              "round_robin",
              "knockout",
              "group_knockout",
              "no_play"
            ]
          },
          "matchCount": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "dayNumber",
          "date",
          "gameType",
          "matchCount"
        ]
      },
      "PublicTournamentDetailResponse": {
        "type": "object",
        "properties": {
          "tournament": {
            "$ref": "#/components/schemas/PublicSnapshotTournament"
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicSnapshotCategory"
            }
          },
          "clubs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicClub"
            }
          },
          "teams": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicSnapshotTeam"
            }
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicSnapshotGroup"
            }
          },
          "groupTeams": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicSnapshotGroupTeam"
            }
          },
          "standings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicSnapshotStanding"
            }
          },
          "matches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicSnapshotMatch"
            }
          },
          "teamRoundSlots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicSnapshotTeamRoundSlot"
            }
          },
          "matchReferees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicMatchReferee"
            }
          },
          "brackets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicBracketSlot"
            }
          },
          "days": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicTournamentDay"
            }
          },
          "venues": {
            "$ref": "#/components/schemas/PublicSnapshotVenues"
          }
        },
        "required": [
          "tournament",
          "categories",
          "clubs",
          "teams",
          "groups",
          "groupTeams",
          "standings",
          "matches",
          "teamRoundSlots",
          "matchReferees",
          "brackets",
          "days",
          "venues"
        ]
      },
      "PublicTournamentDiscoveryItem": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PublicTournament"
          },
          {
            "type": "object",
            "properties": {
              "tenant": {
                "$ref": "#/components/schemas/PublicTenant"
              }
            },
            "required": [
              "tenant"
            ]
          }
        ]
      },
      "PublicTournamentDiscoveryResponse": {
        "type": "object",
        "properties": {
          "tournaments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicTournamentDiscoveryItem"
            }
          }
        },
        "required": [
          "tournaments"
        ]
      },
      "PublicTournamentListResponse": {
        "type": "object",
        "properties": {
          "tournaments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicTournament"
            }
          }
        },
        "required": [
          "tournaments"
        ]
      },
      "PublicTournamentSummaryResponse": {
        "type": "object",
        "properties": {
          "tournament": {
            "$ref": "#/components/schemas/PublicSnapshotTournament"
          },
          "counts": {
            "type": "object",
            "properties": {
              "categories": {
                "type": "integer"
              },
              "teams": {
                "type": "integer"
              },
              "activeTeams": {
                "type": "integer"
              },
              "matches": {
                "type": "integer"
              },
              "brackets": {
                "type": "integer"
              },
              "pitches": {
                "type": "integer"
              }
            },
            "required": [
              "categories",
              "teams",
              "activeTeams",
              "matches",
              "brackets",
              "pitches"
            ]
          },
          "hasPitchLocations": {
            "type": "boolean"
          }
        },
        "required": [
          "tournament",
          "counts",
          "hasPitchLocations"
        ]
      }
    }
  }
}
