{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ufcalendar-com/json-schema/ufcalendar-com-power-index-board-response-schema.json",
  "title": "PowerIndexBoardResponse",
  "description": "Row shape follows `meta.view`: `current` / `peaks` rows carry peak fields, `movers` rows carry `start_rating` / `delta` / `fights_in_window`.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ufcalendar-com-openapi.json#/components/schemas/PowerIndexBoardResponse",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/PowerIndexBoardRow"
          },
          {
            "$ref": "#/$defs/PowerIndexMoverRow"
          }
        ]
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "org": {
          "type": "string"
        },
        "view": {
          "$ref": "#/$defs/PowerIndexView"
        },
        "division": {
          "type": [
            "string",
            "null"
          ],
          "description": "The `division=` filter applied."
        },
        "days": {
          "type": "integer",
          "description": "`view=movers` only: the window actually used (snapped to 30/90/180/365/730/1825/3650)."
        },
        "note": {
          "type": "string"
        },
        "ignored_params": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Present only when the request carried query parameters this endpoint does not take — they were ignored. Same list as the `X-UFCalendar-Ignored-Params` header. Sorted, unique."
        }
      },
      "required": [
        "org",
        "view",
        "division",
        "note"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "data",
    "meta"
  ],
  "additionalProperties": false,
  "$defs": {
    "PowerIndexBoardRow": {
      "type": "object",
      "description": "`view=current` / `view=peaks` row.",
      "properties": {
        "position": {
          "type": "integer"
        },
        "fighter": {
          "type": "object",
          "properties": {
            "id": {
              "type": "integer"
            },
            "slug": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "nationality": {
              "type": [
                "string",
                "null"
              ]
            },
            "country_code": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "id",
            "slug",
            "name",
            "nationality",
            "country_code"
          ],
          "additionalProperties": false
        },
        "rating": {
          "type": "integer",
          "description": "Rounded."
        },
        "peak": {
          "type": "integer",
          "description": "Rounded."
        },
        "peak_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "last_fought_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "fights_rated": {
          "type": "integer"
        },
        "division": {
          "type": [
            "string",
            "null"
          ],
          "description": "Division slug from the fighter's latest bout; null for a catchweight."
        }
      },
      "required": [
        "position",
        "fighter",
        "rating",
        "peak",
        "peak_at",
        "last_fought_at",
        "fights_rated",
        "division"
      ],
      "additionalProperties": false
    },
    "PowerIndexMoverRow": {
      "type": "object",
      "description": "`view=movers` row.",
      "properties": {
        "position": {
          "type": "integer"
        },
        "fighter": {
          "type": "object",
          "properties": {
            "id": {
              "type": "integer"
            },
            "slug": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "nationality": {
              "type": [
                "string",
                "null"
              ]
            },
            "country_code": {
              "type": [
                "string",
                "null"
              ],
              "description": "ISO-2 derived from `nationality`."
            }
          },
          "required": [
            "id",
            "slug",
            "name",
            "nationality",
            "country_code"
          ],
          "additionalProperties": false
        },
        "rating": {
          "type": "integer",
          "description": "Rating at the end of the window, rounded."
        },
        "start_rating": {
          "type": "integer",
          "description": "Rating going into the window, rounded."
        },
        "delta": {
          "type": "integer",
          "description": "`rating` − `start_rating`."
        },
        "fights_in_window": {
          "type": "integer"
        },
        "division": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "position",
        "fighter",
        "rating",
        "start_rating",
        "delta",
        "fights_in_window",
        "division"
      ],
      "additionalProperties": false
    },
    "PowerIndexView": {
      "type": "string",
      "enum": [
        "current",
        "movers",
        "peaks"
      ],
      "description": "Which board view a row belongs to."
    }
  }
}