{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/api-ninjas-com/json-schema/api-ninjas-com-baseball-player-schema.json",
  "title": "BaseballPlayer",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/api-ninjas-com-baseball-api-openapi.yml#/components/schemas/BaseballPlayer",
  "type": "object",
  "properties": {
    "player_id": {
      "type": "string",
      "description": "Permanent id; it stays the same when a player changes teams."
    },
    "league": {
      "type": "string",
      "enum": [
        "mlb"
      ]
    },
    "team": {
      "allOf": [
        {
          "$ref": "#/$defs/BaseballTeamRef"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "first_name": {
      "type": "string"
    },
    "last_name": {
      "type": "string"
    },
    "position": {
      "type": "string"
    },
    "jersey_number": {
      "type": [
        "string",
        "null"
      ]
    },
    "height_in": {
      "type": [
        "integer",
        "null"
      ]
    },
    "height_cm": {
      "type": [
        "integer",
        "null"
      ]
    },
    "weight_lb": {
      "type": [
        "integer",
        "null"
      ]
    },
    "weight_kg": {
      "type": [
        "integer",
        "null"
      ]
    },
    "birth_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "birth_place": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "city": {
          "type": [
            "string",
            "null"
          ]
        },
        "state": {
          "type": [
            "string",
            "null"
          ]
        },
        "country": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "roster_status": {
      "type": "string"
    },
    "college": {
      "type": "string"
    },
    "experience_years": {
      "type": "integer"
    }
  },
  "$defs": {
    "BaseballTeamRef": {
      "type": "object",
      "properties": {
        "team_id": {
          "type": "string",
          "description": "Team id, e.g. mlb-nyy."
        },
        "name": {
          "type": "string"
        },
        "abbreviation": {
          "type": "string"
        }
      }
    }
  }
}