{
  "$id": "/insights/game_data",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Contains data about the game overall.",
  "properties": {
    "avg_shots": {
      "description": "Represents the average number of shots per rally.",
      "minimum": 1,
      "type": "number"
    },
    "game_outcome": {
      "description": "the result (e.g., points scored) by each team",
      "items": {
        "anyOf": [
          {
            "description": "we don't know the team's score or whether they won or lost",
            "type": "null"
          },
          {
            "description": "whether the team won or lost (we don't know how points they scored)",
            "enum": [
              "won",
              "lost"
            ],
            "type": "string"
          },
          {
            "description": "how many points the team scored (and by comparing it with the other team's score, we can also determine which team win)')",
            "minimum": 0,
            "type": "integer"
          }
        ],
        "description": "Describes the team's result (score or won/lost, if known)",
        "title": "Game Outcome for Team"
      },
      "maxItems": 2,
      "minItems": 2,
      "type": "array"
    },
    "kitchen_rallies": {
      "description": "Represents the number of rallies where all players get to the kitchen.",
      "minimum": 0,
      "type": "integer"
    },
    "longest_rally": {
      "additionalProperties": false,
      "description": "Contains the rally index and number of shots for the longest rally in the game.",
      "properties": {
        "num_shots": {
          "description": "Number of shots in the longest rally.",
          "minimum": 0,
          "type": "integer"
        },
        "rally_idx": {
          "description": "The rally which was the longest (0 is the first rally in the game).",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "rally_idx",
        "num_shots"
      ],
      "title": "Longest Rally",
      "type": "object"
    },
    "md5_full": {
      "const": "713b895293fd2b75a081d26bb525cfdf",
      "description": "MD5 of the all aspects of this schema (including non-functional elements like documentation)"
    },
    "md5_functional": {
      "const": "b9df94fa021870b5ce0b09cf7e991fbc",
      "description": "MD5 of the functional aspects of this schema"
    },
    "min_points": {
      "description": "Minimal amount of points needed to win, as in \"first to 11\".",
      "enum": [
        11,
        15,
        21,
        25
      ]
    },
    "relative_adjustments": {
      "additionalProperties": false,
      "description": "Outputs from the retired relative DUPr adjustment models: how strongly they nudged ratings between the two teams (Stage 2) and between partners on each team (Stage 3). Those two models have been removed and nothing writes this any more; it is present only on documents produced before the neural rating model replaced them.",
      "properties": {
        "between_teams": {
          "description": "Team-differential correction based on comparative performance of the teams. Each player on the higher-ranked team receives +between_teams/4, while the opponents get -between_teams/4. Positive values indicate the model boosted the predicted winners, negative values indicate a penalty.",
          "type": "number"
        },
        "within_teams": {
          "description": "Partner-differential corrections. Index 0 is the within-team adjustment applied between players 0 and 1, index 1 is applied between players 2 and 3.",
          "items": {
            "type": "number"
          },
          "maxItems": 2,
          "minItems": 2,
          "type": "array"
        }
      },
      "required": [
        "between_teams",
        "within_teams"
      ],
      "type": "object"
    },
    "scoring": {
      "description": "The scoring system most likely used in the game.",
      "enum": [
        "side_out",
        "rally"
      ]
    },
    "team_percentage_to_kitchen": {
      "description": "Percent of rallies where all players on a team successfully arrived at the kitchen.",
      "items": {
        "$ref": "/types/percentage",
        "description": "A percentage value between 0 and 100.",
        "title": "Percentage"
      },
      "maxItems": 2,
      "minItems": 2,
      "type": "array"
    }
  },
  "required": [
    "game_outcome",
    "kitchen_rallies",
    "avg_shots",
    "longest_rally",
    "team_percentage_to_kitchen"
  ],
  "title": "Game Data",
  "type": "object"
}