{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/snowsure-ai/json-schema/snowsure-ai-resort-monthly-snow-response-schema.json",
  "title": "ResortMonthlySnowResponse",
  "description": "Monthly snowfall climatology and per-season history for one resort, from the ERA5 reanalysis.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/snowsure-ai-openapi.json#/components/schemas/ResortMonthlySnowResponse",
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "1.0.0",
      "description": "Versions this payload contract, independently of info.version."
    },
    "meta": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "const": "SnowSure"
        },
        "slug": {
          "type": "string",
          "description": "Canonical resort slug, after alias resolution"
        },
        "generatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "dataSource": {
          "type": "string",
          "const": "open-meteo-era5"
        },
        "hemisphere": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "NH",
            "SH",
            null
          ],
          "description": "Drives which months count as the ski season."
        },
        "seasonsTracked": {
          "type": "integer"
        },
        "minYearsForNorm": {
          "type": "integer",
          "description": "Minimum tracked years before a month’s averages are published. Months below it are withheld rather than shown thin."
        },
        "withheld": {
          "type": "array",
          "description": "Months excluded from data.months for having too little history, with the reason. Empty for most resorts.",
          "items": {
            "type": "object",
            "properties": {
              "month": {
                "type": "integer"
              },
              "monthName": {
                "type": "string"
              },
              "yearsTracked": {
                "type": "integer"
              },
              "reason": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "data": {
      "type": "object",
      "properties": {
        "avgAnnualSnowfallCm": {
          "type": [
            "number",
            "null"
          ]
        },
        "avgAnnualSnowDays": {
          "type": [
            "integer",
            "null"
          ]
        },
        "hasRichMetrics": {
          "type": "boolean",
          "description": "False until the backfill has populated snow_days / depth columns; those fields are null when false."
        },
        "months": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "month": {
                "type": "integer",
                "minimum": 1,
                "maximum": 12
              },
              "monthName": {
                "type": "string"
              },
              "avgSnowfallCm": {
                "type": "number",
                "description": "Mean snowfall total for this month"
              },
              "avgSnowDays": {
                "type": "integer",
                "description": "Mean count of days with measurable snowfall"
              },
              "avgDepthCm": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Mean snow depth across the month"
              },
              "avgMaxDepthCm": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Mean of each year’s peak depth"
              },
              "avgMaxStormCm": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Mean of each year’s largest single storm"
              },
              "yearsTracked": {
                "type": "integer",
                "description": "How many years back this month’s averages. Always ≥ meta.minYearsForNorm — thinner months are withheld and listed in meta.withheld."
              }
            }
          }
        },
        "seasons": {
          "type": "array",
          "description": "Per-season totals, most recent first.",
          "items": {
            "type": "object",
            "properties": {
              "seasonYear": {
                "type": "integer"
              },
              "seasonLabel": {
                "type": "string"
              },
              "totalCm": {
                "type": "number"
              },
              "snowDays": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "avgDepthCm": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "peakDepthCm": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "maxStormCm": {
                "type": [
                  "number",
                  "null"
                ]
              }
            }
          }
        }
      }
    }
  }
}