{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openteesheet.com/schemas/league-standing.schema.json",
  "title": "OpenTeeSheet league standing (open format v1)",
  "description": "One team's line in a season's standings, computed from the posted weekly scores by the season's rule: match_play (2 for a win, 1 for a tie, lower score wins), field_rank (each night's best score earns one point per team that posted, ties share the higher) or low_total (fewest strokes over the weeks played; points is null).",
  "type": "object",
  "properties": {
    "object": {
      "const": "league_standing"
    },
    "season_id": {
      "type": "string",
      "format": "uuid"
    },
    "team_id": {
      "type": "string",
      "format": "uuid"
    },
    "team": {
      "type": "string"
    },
    "rank": {
      "type": "integer",
      "minimum": 1
    },
    "played": {
      "type": "integer",
      "minimum": 0
    },
    "wins": {
      "type": "integer",
      "minimum": 0
    },
    "ties": {
      "type": "integer",
      "minimum": 0
    },
    "losses": {
      "type": "integer",
      "minimum": 0
    },
    "points": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0
    },
    "total_strokes": {
      "type": "integer",
      "minimum": 0
    }
  },
  "required": [
    "object",
    "season_id",
    "team_id",
    "team",
    "rank",
    "played",
    "wins",
    "ties",
    "losses",
    "points",
    "total_strokes"
  ],
  "additionalProperties": false
}
