{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nexus/json-schema/nexus-usage-history-xo-schema.json",
  "title": "UsageHistoryXO",
  "description": "Historical usage metrics for a single metric type and period",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nexus-usage-history-api-openapi.yml#/components/schemas/UsageHistoryXO",
  "type": "object",
  "properties": {
    "metric": {
      "type": "string",
      "description": "Metric type requested",
      "enum": [
        "requests",
        "components"
      ]
    },
    "period": {
      "type": "string",
      "description": "Period requested",
      "enum": [
        "daily",
        "monthly"
      ]
    },
    "data": {
      "type": "array",
      "description": "Data points ordered oldest to newest",
      "items": {
        "$ref": "#/$defs/UsageHistoryPointXO"
      }
    }
  },
  "$defs": {
    "UsageHistoryPointXO": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "description": "Period covered: yyyy-MM-dd for daily series, yyyy-MM for monthly"
        },
        "value": {
          "type": "integer",
          "description": "Metric value recorded for the period",
          "format": "int64"
        }
      },
      "description": "A single data point in a usage history series"
    }
  }
}