{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/predixsport-com/json-schema/predixsport-com-nbafantasy-squad-response-schema.json",
  "title": "NBAFantasySquadResponse",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/predixsport-com-openapi.json#/components/schemas/NBAFantasySquadResponse",
  "properties": {
    "sport": {
      "type": "string",
      "enum": [
        "nba"
      ],
      "const": "nba",
      "title": "Sport",
      "default": "nba"
    },
    "mode": {
      "type": "string",
      "enum": [
        "squad_builder"
      ],
      "const": "squad_builder",
      "title": "Mode",
      "default": "squad_builder"
    },
    "snapshot_id": {
      "type": "integer",
      "title": "Snapshot Id"
    },
    "season": {
      "type": "string",
      "title": "Season"
    },
    "preset": {
      "type": "string",
      "title": "Preset"
    },
    "policy_version": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Policy Version"
    },
    "champion": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Champion"
    },
    "court_source": {
      "type": "string",
      "enum": [
        "official_market"
      ],
      "const": "official_market",
      "title": "Court Source",
      "default": "official_market"
    },
    "board_digest": {
      "type": "string",
      "title": "Board Digest"
    },
    "roster_revision": {
      "type": "integer",
      "title": "Roster Revision"
    },
    "market": {
      "$ref": "#/$defs/NBAFantasyMarketReference"
    },
    "budget": {
      "type": "number",
      "title": "Budget"
    },
    "bank_to_leave": {
      "type": "number",
      "title": "Bank To Leave"
    },
    "cap": {
      "type": "number",
      "title": "Cap"
    },
    "value_basis": {
      "type": "string",
      "enum": [
        "fielded_five"
      ],
      "const": "fielded_five",
      "title": "Value Basis",
      "description": "Squads are ranked on the five they would field, never on a sum of the ten.",
      "default": "fielded_five"
    },
    "search": {
      "type": "string",
      "enum": [
        "exact",
        "certified",
        "truncated"
      ],
      "title": "Search",
      "description": "'exact' means every legal squad the budget reaches was compared and these are the best there are. 'certified' means the search stopped as soon as it could prove it was inside its optimality tolerance, and `search_gap` says how close to the best squad there is every squad here was proved to be. 'truncated' means the search ran out of time before it could prove anything, so these are the best reached and not the best there are. On anything but 'exact', say so beside the squads and say how many squads came back.",
      "default": "exact"
    },
    "search_gap": {
      "type": "number",
      "minimum": 0.0,
      "title": "Search Gap",
      "description": "How close to the best squad there is every squad here was PROVED to be, as a fraction: 0.004 is four tenths of a percent. Zero on an exact search.",
      "default": 0.0
    },
    "search_gap_tolerance": {
      "type": "number",
      "minimum": 0.0,
      "title": "Search Gap Tolerance",
      "description": "The optimality gap the search was allowed to stop at. The builder takes one because the exact search over two Gameweeks of a full market is slow enough to time out, and a proved half a percent is a better answer than an apology.",
      "default": 0.0
    },
    "window": {
      "$ref": "#/$defs/NBAFantasySquadWindow"
    },
    "window_days": {
      "type": "integer",
      "title": "Window Days",
      "description": "How many Gamedays the squads were valued over."
    },
    "window_label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Window Label",
      "description": "The Gameweeks of the window, in words."
    },
    "window_assumption": {
      "type": "string",
      "title": "Window Assumption",
      "description": "The assumption behind every total here, to repeat beside it: the ten are held for the whole window and no future transfer is simulated inside it."
    },
    "protected": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Protected"
    },
    "excluded": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Excluded"
    },
    "recommended": {
      "$ref": "#/$defs/NBAFantasyBuiltSquad"
    },
    "alternatives": {
      "items": {
        "$ref": "#/$defs/NBAFantasyBuiltSquad"
      },
      "type": "array",
      "title": "Alternatives"
    },
    "counts": {
      "additionalProperties": {
        "type": "integer"
      },
      "type": "object",
      "title": "Counts"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "snapshot_id",
    "season",
    "preset",
    "board_digest",
    "roster_revision",
    "market",
    "budget",
    "bank_to_leave",
    "cap",
    "window",
    "window_days",
    "window_assumption",
    "recommended"
  ],
  "$defs": {
    "NBAFantasyBuiltSquad": {
      "properties": {
        "expected_points": {
          "type": "number",
          "title": "Expected Points",
          "description": "The five this squad would field on EVERY Gameday of the window, added up. The window is the first two official Gameweeks still ahead and the same ten are held for all of it."
        },
        "fielded_points": {
          "type": "number",
          "title": "Fielded Points",
          "description": "The same number, named for what it measures."
        },
        "proxy_points": {
          "type": "number",
          "title": "Proxy Points",
          "description": "The old linear ranking, over all ten. Kept for provenance and decides nothing."
        },
        "gameweeks": {
          "items": {
            "$ref": "#/$defs/NBAFantasyBuiltSquadGameweek"
          },
          "type": "array",
          "title": "Gameweeks",
          "description": "What each Gameweek of the window contributed, so a squad that gives up the first one to win the second is visible rather than averaged away."
        },
        "squad_value": {
          "type": "number",
          "title": "Squad Value"
        },
        "bank_after": {
          "type": "number",
          "title": "Bank After",
          "description": "What is left of the cap after buying these ten, which is what the game prints. The reserve is named beside it and is part of this number, not subtracted from it twice."
        },
        "reserve": {
          "type": "number",
          "title": "Reserve",
          "description": "Millions the owner asked us to keep back.",
          "default": 0.0
        },
        "squad": {
          "items": {
            "$ref": "#/$defs/NBAFantasyBuiltSquadRow"
          },
          "type": "array",
          "title": "Squad"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_points",
        "fielded_points",
        "proxy_points",
        "squad_value",
        "bank_after",
        "squad"
      ],
      "title": "NBAFantasyBuiltSquad"
    },
    "NBAFantasyBuiltSquadGameweek": {
      "properties": {
        "gameweek": {
          "type": "integer",
          "title": "Gameweek"
        },
        "gamedays": {
          "type": "integer",
          "title": "Gamedays"
        },
        "fielded_points": {
          "type": "number",
          "title": "Fielded Points",
          "description": "What this squad fields over that Gameweek alone."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "gameweek",
        "gamedays",
        "fielded_points"
      ],
      "title": "NBAFantasyBuiltSquadGameweek"
    },
    "NBAFantasyBuiltSquadRow": {
      "properties": {
        "player_name": {
          "type": "string",
          "title": "Player Name"
        },
        "court": {
          "type": "string",
          "enum": [
            "BC",
            "FC"
          ],
          "title": "Court"
        },
        "team_code": {
          "type": "string",
          "title": "Team Code"
        },
        "price": {
          "type": "number",
          "title": "Price"
        },
        "expected_points": {
          "type": "number",
          "title": "Expected Points"
        },
        "window_games": {
          "type": "integer",
          "title": "Window Games",
          "description": "How many Gamedays of the window his club plays. It is what makes a cheap tenth man legible: either he covers a night the five do not, or nothing cheaper was legal.",
          "default": 0
        },
        "valuation_basis": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Valuation Basis",
          "description": "season_price_blend_v1 blends what he did last season with what his price implies for his court. price_line_v1 is the price alone, which is all we have for a player with no season record."
        },
        "season_basis": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Season Basis",
          "description": "Which season the record behind this player's value came from. At the start of a season it is LAST season's, because nothing has been played in this one yet."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "player_name",
        "court",
        "team_code",
        "price",
        "expected_points"
      ],
      "title": "NBAFantasyBuiltSquadRow"
    },
    "NBAFantasyMarketReference": {
      "properties": {
        "snapshot_id": {
          "type": "integer",
          "title": "Snapshot Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "period_kind": {
          "type": "string",
          "enum": [
            "gameday",
            "calendar_day"
          ],
          "title": "Period Kind"
        },
        "period_key": {
          "type": "string",
          "title": "Period Key"
        },
        "source_observed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source Observed At"
        },
        "collected_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Collected At"
        },
        "deadline_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Deadline At",
          "description": "The official Gameday deadline this market was frozen before."
        },
        "player_count": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Player Count"
        },
        "priced_players": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Priced Players",
          "description": "How many priced players we could place against our own player identity. The rest are on the market and not in this plan."
        },
        "duplicate_identities": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Duplicate Identities",
          "default": 0
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "snapshot_id",
        "revision",
        "period_kind",
        "period_key",
        "player_count",
        "priced_players"
      ],
      "title": "NBAFantasyMarketReference",
      "description": "Which frozen snapshot of the official market a plan was priced from."
    },
    "NBAFantasySquadWindow": {
      "properties": {
        "days": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Days"
        },
        "start": {
          "type": "string",
          "title": "Start"
        },
        "end": {
          "type": "string",
          "title": "End"
        },
        "gameweeks": {
          "items": {
            "$ref": "#/$defs/NBAFantasySquadWindowWeek"
          },
          "type": "array",
          "title": "Gameweeks"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "days",
        "start",
        "end",
        "gameweeks"
      ],
      "title": "NBAFantasySquadWindow",
      "description": "The Gamedays a squad built from scratch was valued over.\n\nThe first two official Gameweeks still ahead, from the Gameday calendar\nand the club games frozen with the market. Two Gameweeks is a product\ndefault and not a measured optimum."
    },
    "NBAFantasySquadWindowWeek": {
      "properties": {
        "gameweek": {
          "type": "integer",
          "title": "Gameweek"
        },
        "days": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Days"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "gameweek",
        "days"
      ],
      "title": "NBAFantasySquadWindowWeek"
    }
  }
}