{
    "openapi": "3.1.0",
    "info": {
        "title": "Gauntlet API",
        "version": "0.0.1",
        "description": "REST API for building tournaments (groups + knockout), submitting match results, and projecting hypothetical \"what if?\" scenarios. Public read endpoints (standings, brackets, tournament view) are open; organizer endpoints require a Sanctum bearer token from \/login or \/register."
    },
    "servers": [
        {
            "url": "http:\/\/gauntlet-api.marianacastro.dev\/api"
        }
    ],
    "security": [
        {
            "http": []
        }
    ],
    "paths": {
        "\/register": {
            "post": {
                "operationId": "auth.register",
                "tags": [
                    "Auth"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "email": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "password": {
                                        "type": "string",
                                        "minLength": 8
                                    },
                                    "seed_sample": {
                                        "type": "boolean"
                                    }
                                },
                                "required": [
                                    "name",
                                    "email",
                                    "password"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "user": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "id"
                                            ]
                                        },
                                        "token": {
                                            "type": "string"
                                        },
                                        "sample_tournament_id": {
                                            "type": "integer"
                                        }
                                    },
                                    "required": [
                                        "user",
                                        "token",
                                        "sample_tournament_id"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                },
                "security": []
            }
        },
        "\/login": {
            "post": {
                "operationId": "auth.login",
                "tags": [
                    "Auth"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "password": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "email",
                                    "password"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "user": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "id"
                                            ]
                                        },
                                        "token": {
                                            "type": "string"
                                        },
                                        "sandbox_tournament_id": {
                                            "type": "integer"
                                        }
                                    },
                                    "required": [
                                        "user",
                                        "token",
                                        "sandbox_tournament_id"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                },
                "security": []
            }
        },
        "\/user": {
            "get": {
                "operationId": "auth.me",
                "tags": [
                    "Auth"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "integer"
                                        }
                                    },
                                    "required": [
                                        "id"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/logout": {
            "post": {
                "operationId": "auth.logout",
                "tags": [
                    "Auth"
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/stages\/{stage}\/bracket": {
            "get": {
                "operationId": "bracket.show",
                "tags": [
                    "Bracket"
                ],
                "parameters": [
                    {
                        "name": "stage",
                        "in": "path",
                        "required": true,
                        "description": "The stage ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`BracketResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/BracketResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    }
                },
                "security": []
            }
        },
        "\/demo\/template": {
            "get": {
                "operationId": "demo.template",
                "summary": "The public demo tournament shown to anonymous visitors: the read-only template",
                "tags": [
                    "Demo"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "tournament_id": {
                                            "type": [
                                                "integer",
                                                "null"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "tournament_id"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": []
            }
        },
        "\/demo\/reset": {
            "post": {
                "operationId": "demo.reset",
                "summary": "Resets this session's demo sandbox: drops the current copy and clones a\nfresh one from the template. One active sandbox per session token",
                "tags": [
                    "Demo"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "sandbox_tournament_id": {
                                            "type": "integer"
                                        }
                                    },
                                    "required": [
                                        "sandbox_tournament_id"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error\n\nAn error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "description": "Error overview.",
                                                    "examples": [
                                                        "Only the demo account can reset the sandbox."
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "message"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "description": "Error overview.",
                                                    "examples": [
                                                        ""
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                "The demo template is not available."
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/tournaments\/{tournament}\/group-stage": {
            "post": {
                "operationId": "groupStage.store",
                "summary": "Builds the group stage (groups + distribution + single round-robin) and returns\nthe full tournament already with the new ids. Owner only",
                "tags": [
                    "GroupStage"
                ],
                "parameters": [
                    {
                        "name": "tournament",
                        "in": "path",
                        "required": true,
                        "description": "The tournament ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/BuildGroupStageRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`TournamentDetailResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/TournamentDetailResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/tournaments\/{tournament}\/knockout": {
            "post": {
                "operationId": "knockout.store",
                "tags": [
                    "Knockout"
                ],
                "parameters": [
                    {
                        "name": "tournament",
                        "in": "path",
                        "required": true,
                        "description": "The tournament ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`TournamentDetailResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/TournamentDetailResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "The tournament structure does not allow this transition yet.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Why the tournament structure rejected the transition."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/matches\/{fixture}\/result": {
            "put": {
                "operationId": "matchResult.update",
                "tags": [
                    "MatchResult"
                ],
                "parameters": [
                    {
                        "name": "fixture",
                        "in": "path",
                        "required": true,
                        "description": "The fixture ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/ConfirmMatchResultRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Array of `StandingResource`\n\n`BracketResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#\/components\/schemas\/StandingResource"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#\/components\/schemas\/BracketResource"
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Version conflict \u2014 the match was changed by someone else. Reload and retry.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview."
                                        },
                                        "expected_version": {
                                            "type": "integer",
                                            "description": "The current version the client must reload before retrying."
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "expected_version"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/tournaments\/{tournament}\/scenario": {
            "post": {
                "operationId": "scenario.store",
                "tags": [
                    "Scenario"
                ],
                "parameters": [
                    {
                        "name": "tournament",
                        "in": "path",
                        "required": true,
                        "description": "The tournament ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/ProjectScenarioRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`ScenarioResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ScenarioResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                },
                "security": []
            }
        },
        "\/groups\/{group}\/standings": {
            "get": {
                "operationId": "standings.show",
                "summary": "Public read: the current standings of a group (projection from the matches)",
                "tags": [
                    "Standings"
                ],
                "parameters": [
                    {
                        "name": "group",
                        "in": "path",
                        "required": true,
                        "description": "The group ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Array of `StandingResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/StandingResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    }
                },
                "security": []
            }
        },
        "\/tournaments\/{tournament}\/teams": {
            "post": {
                "operationId": "team.store",
                "tags": [
                    "Team"
                ],
                "parameters": [
                    {
                        "name": "tournament",
                        "in": "path",
                        "required": true,
                        "description": "The tournament ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/AddTeamsRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Array of `TeamResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/TeamResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/tournaments\/{tournament}\/teams\/{team}": {
            "patch": {
                "operationId": "team.update",
                "tags": [
                    "Team"
                ],
                "parameters": [
                    {
                        "name": "tournament",
                        "in": "path",
                        "required": true,
                        "description": "The tournament ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "team",
                        "in": "path",
                        "required": true,
                        "description": "The team ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateTeamRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`TeamResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/TeamResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/tournaments\/{tournament}": {
            "get": {
                "operationId": "tournament.show",
                "tags": [
                    "Tournament"
                ],
                "parameters": [
                    {
                        "name": "tournament",
                        "in": "path",
                        "required": true,
                        "description": "The tournament ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`TournamentDetailResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/TournamentDetailResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    }
                },
                "security": []
            },
            "patch": {
                "operationId": "tournament.update",
                "tags": [
                    "Tournament"
                ],
                "parameters": [
                    {
                        "name": "tournament",
                        "in": "path",
                        "required": true,
                        "description": "The tournament ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateTournamentRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`TournamentResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/TournamentResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            },
            "delete": {
                "operationId": "tournament.destroy",
                "tags": [
                    "Tournament"
                ],
                "parameters": [
                    {
                        "name": "tournament",
                        "in": "path",
                        "required": true,
                        "description": "The tournament ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/tournaments": {
            "get": {
                "operationId": "tournament.index",
                "tags": [
                    "Tournament"
                ],
                "responses": {
                    "200": {
                        "description": "Array of `TournamentResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/TournamentResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "tournament.store",
                "tags": [
                    "Tournament"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/CreateTournamentRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`TournamentResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/TournamentResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/tournaments\/{tournament}\/stream": {
            "get": {
                "operationId": "tournamentStream.stream",
                "tags": [
                    "TournamentStream"
                ],
                "parameters": [
                    {
                        "name": "tournament",
                        "in": "path",
                        "required": true,
                        "description": "The tournament ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    }
                },
                "security": []
            }
        }
    },
    "components": {
        "securitySchemes": {
            "http": {
                "type": "http",
                "scheme": "bearer"
            }
        },
        "schemas": {
            "AddTeamsRequest": {
                "type": "object",
                "properties": {
                    "teams": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 255
                                },
                                "code": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 8
                                },
                                "flag": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 16
                                }
                            },
                            "required": [
                                "name"
                            ]
                        },
                        "minItems": 1,
                        "maxItems": 64
                    }
                },
                "required": [
                    "teams"
                ],
                "title": "AddTeamsRequest"
            },
            "BracketResource": {
                "type": "object",
                "properties": {
                    "champion": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "id",
                            "name"
                        ]
                    },
                    "ties": {
                        "type": "array",
                        "items": {}
                    }
                },
                "required": [
                    "champion",
                    "ties"
                ],
                "title": "BracketResource"
            },
            "BuildGroupStageRequest": {
                "type": "object",
                "properties": {
                    "qualify_count": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 4
                    },
                    "groups": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string",
                                    "maxLength": 8
                                },
                                "team_ids": {
                                    "type": "array",
                                    "items": {
                                        "type": "integer"
                                    },
                                    "minItems": 2,
                                    "maxItems": 16
                                }
                            },
                            "required": [
                                "name",
                                "team_ids"
                            ]
                        },
                        "minItems": 1,
                        "maxItems": 16
                    }
                },
                "required": [
                    "qualify_count",
                    "groups"
                ],
                "title": "BuildGroupStageRequest"
            },
            "ConfirmMatchResultRequest": {
                "type": "object",
                "properties": {
                    "home_score": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 99
                    },
                    "away_score": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 99
                    },
                    "expected_version": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "home_penalties": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 99
                    },
                    "away_penalties": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 99
                    }
                },
                "required": [
                    "home_score",
                    "away_score",
                    "expected_version"
                ],
                "title": "ConfirmMatchResultRequest"
            },
            "CreateTournamentRequest": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 255
                    }
                },
                "required": [
                    "name"
                ],
                "title": "CreateTournamentRequest"
            },
            "ProjectScenarioRequest": {
                "type": "object",
                "properties": {
                    "results": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "fixture_id": {
                                    "type": "integer"
                                },
                                "home_score": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 99
                                },
                                "away_score": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 99
                                },
                                "home_penalties": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "minimum": 0,
                                    "maximum": 99
                                },
                                "away_penalties": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "minimum": 0,
                                    "maximum": 99
                                }
                            },
                            "required": [
                                "fixture_id",
                                "home_score",
                                "away_score"
                            ]
                        }
                    }
                },
                "required": [
                    "results"
                ],
                "title": "ProjectScenarioRequest"
            },
            "ScenarioResource": {
                "type": "object",
                "properties": {
                    "groups": {
                        "type": "array",
                        "items": {}
                    },
                    "bracket": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "champion": {
                                "type": [
                                    "object",
                                    "null"
                                ],
                                "properties": {
                                    "id": {
                                        "type": "integer"
                                    },
                                    "name": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "id",
                                    "name"
                                ]
                            },
                            "ties": {
                                "type": "array",
                                "items": {}
                            }
                        },
                        "required": [
                            "champion",
                            "ties"
                        ]
                    }
                },
                "required": [
                    "groups",
                    "bracket"
                ],
                "title": "ScenarioResource"
            },
            "StandingResource": {
                "type": "object",
                "properties": {
                    "position": {
                        "type": "integer"
                    },
                    "team": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "id",
                            "name"
                        ]
                    },
                    "played": {
                        "type": "integer"
                    },
                    "won": {
                        "type": "integer"
                    },
                    "drawn": {
                        "type": "integer"
                    },
                    "lost": {
                        "type": "integer"
                    },
                    "goals_for": {
                        "type": "integer"
                    },
                    "goals_against": {
                        "type": "integer"
                    },
                    "goal_difference": {
                        "type": "integer"
                    },
                    "points": {
                        "type": "integer"
                    },
                    "form": {
                        "type": "array",
                        "items": {}
                    },
                    "qualified": {
                        "type": "boolean"
                    }
                },
                "required": [
                    "position",
                    "team",
                    "played",
                    "won",
                    "drawn",
                    "lost",
                    "goals_for",
                    "goals_against",
                    "goal_difference",
                    "points",
                    "form",
                    "qualified"
                ],
                "title": "StandingResource"
            },
            "TeamResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "code": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "flag": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "name",
                    "code",
                    "flag"
                ],
                "title": "TeamResource"
            },
            "TournamentDetailResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "can_manage": {
                        "type": "string"
                    },
                    "owner_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "teams": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer"
                                },
                                "name": {
                                    "type": "string"
                                },
                                "code": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "flag": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            },
                            "required": [
                                "id",
                                "name",
                                "code",
                                "flag"
                            ]
                        }
                    },
                    "stages": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": {}
                        }
                    }
                },
                "required": [
                    "id",
                    "name",
                    "status",
                    "can_manage",
                    "owner_id",
                    "teams",
                    "stages"
                ],
                "title": "TournamentDetailResource"
            },
            "TournamentResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "teams_count": {
                        "type": "integer"
                    },
                    "stages_count": {
                        "type": "integer"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "name",
                    "status",
                    "created_at"
                ],
                "title": "TournamentResource"
            },
            "UpdateTeamRequest": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                    },
                    "code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 8
                    },
                    "flag": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 16
                    }
                },
                "title": "UpdateTeamRequest"
            },
            "UpdateTournamentRequest": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 255
                    }
                },
                "required": [
                    "name"
                ],
                "title": "UpdateTournamentRequest"
            }
        },
        "responses": {
            "ValidationException": {
                "description": "Validation error",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Errors overview."
                                },
                                "errors": {
                                    "type": "object",
                                    "description": "A detailed description of each field that failed validation.",
                                    "additionalProperties": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            },
                            "required": [
                                "message",
                                "errors"
                            ]
                        }
                    }
                }
            },
            "ModelNotFoundException": {
                "description": "Not found",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            },
            "AuthenticationException": {
                "description": "Unauthenticated",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            },
            "AuthorizationException": {
                "description": "Authorization error",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            }
        }
    }
}