{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sportstatsapi/json-schema/sportstatsapi-dto-baseball-match-response-schema.json",
  "title": "dto.BaseballMatchResponse",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sportstatsapi-openapi.json#/components/schemas/dto.BaseballMatchResponse",
  "properties": {
    "away_team": {
      "$ref": "#/$defs/dto.TeamInfo"
    },
    "extra_innings": {
      "type": "integer"
    },
    "file_group": {
      "type": "string"
    },
    "freshness": {
      "allOf": [
        {
          "$ref": "#/$defs/dto.Freshness"
        }
      ],
      "description": "Freshness: when the data was last fetched and changed, and whether a\nlive match may be behind (docs/freshness.md); sport match endpoints only."
    },
    "game_info": {
      "allOf": [
        {
          "$ref": "#/$defs/dto.BaseballGameInfo"
        }
      ],
      "description": "GameInfo: a past MLB game's park, weather, attendance, duration,\numpires and decision pitchers from Retrosheet (its notice in\nmeta.sources); /baseball/matches/{id} only, absent when we have none."
    },
    "home_team": {
      "$ref": "#/$defs/dto.TeamInfo"
    },
    "id": {
      "type": "integer"
    },
    "inning_scores": {
      "$ref": "#/$defs/dto.BaseballInningScores"
    },
    "league_gid": {
      "type": "integer"
    },
    "league_id": {
      "type": "integer"
    },
    "league_name": {
      "type": "string"
    },
    "live": {
      "allOf": [
        {
          "$ref": "#/$defs/dto.BaseballLive"
        }
      ],
      "description": "Live: the in-play state, only while status_code is live, halftime or intermission."
    },
    "match_id": {
      "type": "integer"
    },
    "periods": {
      "description": "Periods: the period scores in game order, one shape for every sport ({period, label, home, away}).",
      "items": {
        "$ref": "#/$defs/dto.Period"
      },
      "type": "array"
    },
    "sport": {
      "type": "string"
    },
    "start_at": {
      "description": "StartAt: start_date and start_time as one RFC 3339 UTC time; null when the time is unknown.",
      "type": "string"
    },
    "start_date": {
      "type": "string"
    },
    "start_time": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "status_code": {
      "description": "StatusCode: the status in one vocabulary for every sport (raw word in status).\nawaiting_result: still not started with no score, Unknown or stuck in\nplay well after the start (per sport: soccer and handball 3 hours,\nbasketball, hockey and volleyball 4, american-football 5, baseball 6,\ntennis 24, cricket 12 after the start on its last day; in play: 24 at\nleast): the feed never gave a result; it may still come. Derived when\nanswering: status stays as stored.",
      "enum": [
        "scheduled",
        "live",
        "halftime",
        "intermission",
        "final",
        "final_overtime",
        "final_penalties",
        "postponed",
        "delayed",
        "suspended",
        "abandoned",
        "cancelled",
        "unknown",
        "awaiting_result"
      ],
      "type": "string"
    },
    "updated_at": {
      "description": "UpdatedAt: when this match row last changed (RFC 3339, UTC).",
      "type": "string"
    }
  },
  "type": "object",
  "$defs": {
    "dto.BaseballGameInfo": {
      "properties": {
        "attendance": {
          "type": "integer"
        },
        "day_night": {
          "enum": [
            "day",
            "night"
          ],
          "type": "string"
        },
        "duration_minutes": {
          "type": "integer"
        },
        "losing_pitcher": {
          "type": "string"
        },
        "save_pitcher": {
          "type": "string"
        },
        "source": {
          "type": "string"
        },
        "umpires": {
          "$ref": "#/$defs/dto.BaseballUmpires"
        },
        "venue": {
          "type": "string"
        },
        "weather": {
          "allOf": [
            {
              "$ref": "#/$defs/dto.BaseballWeather"
            }
          ],
          "description": "Weather at the start, as the official scorer recorded it."
        },
        "winning_pitcher": {
          "description": "WinningPitcher, LosingPitcher, SavePitcher: the decisions, by name.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "dto.BaseballInningScores": {
      "properties": {
        "errors": {
          "$ref": "#/$defs/dto.ScorePair"
        },
        "extra": {
          "$ref": "#/$defs/dto.ScorePair"
        },
        "hits": {
          "$ref": "#/$defs/dto.ScorePair"
        },
        "in1": {
          "$ref": "#/$defs/dto.ScorePair"
        },
        "in2": {
          "$ref": "#/$defs/dto.ScorePair"
        },
        "in3": {
          "$ref": "#/$defs/dto.ScorePair"
        },
        "in4": {
          "$ref": "#/$defs/dto.ScorePair"
        },
        "in5": {
          "$ref": "#/$defs/dto.ScorePair"
        },
        "in6": {
          "$ref": "#/$defs/dto.ScorePair"
        },
        "in7": {
          "$ref": "#/$defs/dto.ScorePair"
        },
        "in8": {
          "$ref": "#/$defs/dto.ScorePair"
        },
        "in9": {
          "$ref": "#/$defs/dto.ScorePair"
        }
      },
      "type": "object"
    },
    "dto.BaseballLive": {
      "properties": {
        "inning": {
          "type": "integer"
        },
        "inning_half": {
          "enum": [
            "top",
            "bottom"
          ],
          "type": "string"
        },
        "inning_source": {
          "enum": [
            "play_by_play",
            "status"
          ],
          "type": "string"
        },
        "inning_updated_at": {
          "type": "string"
        },
        "outs": {
          "type": "integer"
        },
        "outs_updated_at": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "dto.BaseballUmpires": {
      "properties": {
        "first_base": {
          "type": "string"
        },
        "home_plate": {
          "type": "string"
        },
        "left_field": {
          "type": "string"
        },
        "right_field": {
          "type": "string"
        },
        "second_base": {
          "type": "string"
        },
        "third_base": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "dto.BaseballWeather": {
      "properties": {
        "field_condition": {
          "type": "string"
        },
        "precipitation": {
          "type": "string"
        },
        "sky": {
          "type": "string"
        },
        "temperature_f": {
          "type": "integer"
        },
        "wind_direction": {
          "type": "string"
        },
        "wind_speed_mph": {
          "type": "integer"
        }
      },
      "type": "object"
    },
    "dto.Freshness": {
      "properties": {
        "last_fetch_at": {
          "description": "LastFetchAt: the last good fetch of the sport's live feed (the sync's\nlive refresh of the provider's today feed, every sport's matches in one file).",
          "type": "string"
        },
        "stale": {
          "description": "Stale: the match is live and its data may be behind; StaleReason says why.",
          "type": "boolean"
        },
        "stale_reason": {
          "description": "feed_not_fetched, state_unchanged, clock_unchanged",
          "type": "string"
        },
        "state_changed_at": {
          "description": "StateChangedAt: the status or the score last changed (null for rows\nnot written since 2026-10-28).",
          "type": "string"
        },
        "updated_at": {
          "description": "UpdatedAt: the row last changed (any field: score, clock, line scores).",
          "type": "string"
        }
      },
      "type": "object"
    },
    "dto.Period": {
      "properties": {
        "away": {
          "type": "integer"
        },
        "cumulative": {
          "description": "Cumulative: soccer FT and ET only: the score after 90 or 120 minutes\n(all goals so far), not the goals scored in that period.",
          "type": "boolean"
        },
        "home": {
          "description": "Home, Away: null when that side is not stored.",
          "type": "integer"
        },
        "label": {
          "type": "string"
        },
        "period": {
          "description": "Period: OT (basketball, hockey, american football) is every overtime\ntogether, so the periods add up to the final after 2OT+.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "dto.ScorePair": {
      "properties": {
        "away": {
          "type": "integer"
        },
        "home": {
          "type": "integer"
        }
      },
      "type": "object"
    },
    "dto.TeamInfo": {
      "properties": {
        "display_name": {
          "description": "DisplayName: the name to show (accents and case from official sources; a managed club's own name), else name. name stays the data provider's: filters match on it.",
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "score": {
          "type": "integer"
        }
      },
      "type": "object"
    }
  }
}