{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/snowsure-ai/json-schema/snowsure-ai-station-snowing-now-response-schema.json",
  "title": "StationSnowingNowResponse",
  "description": "The snowing-now document (SS-W-2861), plus `credits`.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/snowsure-ai-openapi.json#/components/schemas/StationSnowingNowResponse",
  "type": "object",
  "required": [
    "as_of",
    "hours",
    "count",
    "reporting",
    "biggest",
    "biggest_24h",
    "deepest",
    "stations",
    "attribution"
  ],
  "properties": {
    "as_of": {
      "type": "string",
      "format": "date-time",
      "description": "When the sweep wrote the document."
    },
    "hours": {
      "type": "integer",
      "description": "The window a rise must fall in."
    },
    "count": {
      "type": "integer",
      "description": "Stations whose depth rose in the window."
    },
    "reporting": {
      "type": "integer",
      "description": "Public stations with a reading today."
    },
    "biggest": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "slug",
        "country",
        "name",
        "elevation",
        "network",
        "gain_cm",
        "hours",
        "observed_at"
      ],
      "additionalProperties": false,
      "properties": {
        "slug": {
          "type": "string"
        },
        "country": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2, lower-case."
        },
        "name": {
          "type": "string"
        },
        "elevation": {
          "type": "number",
          "description": "Metres."
        },
        "network": {
          "type": "string"
        },
        "gain_cm": {
          "type": "number"
        },
        "hours": {
          "type": "integer"
        },
        "observed_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "biggest_24h": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "slug",
        "country",
        "name",
        "elevation",
        "network",
        "gain_cm",
        "observed_at"
      ],
      "additionalProperties": false,
      "properties": {
        "slug": {
          "type": "string"
        },
        "country": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2, lower-case."
        },
        "name": {
          "type": "string"
        },
        "elevation": {
          "type": "number",
          "description": "Metres."
        },
        "network": {
          "type": "string"
        },
        "gain_cm": {
          "type": "number"
        },
        "observed_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "deepest": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "slug",
        "country",
        "name",
        "elevation",
        "network",
        "depth_cm",
        "observed_at"
      ],
      "additionalProperties": false,
      "properties": {
        "slug": {
          "type": "string"
        },
        "country": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2, lower-case."
        },
        "name": {
          "type": "string"
        },
        "elevation": {
          "type": "number",
          "description": "Metres."
        },
        "network": {
          "type": "string"
        },
        "depth_cm": {
          "type": "number"
        },
        "observed_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "stations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/StationSnowingNowStation"
      }
    },
    "attribution": {
      "type": "array",
      "description": "The networks the document names, credited verbatim.",
      "items": {
        "type": "object",
        "required": [
          "source",
          "name",
          "credit",
          "url"
        ],
        "properties": {
          "source": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "credit": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        }
      }
    },
    "credits": {
      "$ref": "#/$defs/Credits"
    }
  },
  "$defs": {
    "Credits": {
      "type": "object",
      "description": "Who to credit when showing this data (SS-W-1469). `provider` is SnowSure's own credit, which reuse requires with a visible link back; `upstream` lists the sources whose licences require a credit wherever their data, or data derived from it, is shown.",
      "required": [
        "provider",
        "required",
        "terms",
        "upstream"
      ],
      "properties": {
        "provider": {
          "type": "object",
          "required": [
            "name",
            "url",
            "text"
          ],
          "properties": {
            "name": {
              "type": "string",
              "const": "SnowSure"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "text": {
              "type": "string"
            }
          }
        },
        "required": {
          "type": "string",
          "description": "The attribution requirement in one sentence."
        },
        "terms": {
          "type": "string",
          "format": "uri"
        },
        "upstream": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "text",
              "url"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "text": {
                "type": "string",
                "description": "The credit line to display, in the licensor's required wording where it has one."
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "license": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "StationSnowingNowStation": {
      "type": "object",
      "description": "One public station whose depth rose in the window (SS-W-2861): exactly these keys and no other.",
      "required": [
        "id",
        "slug",
        "country",
        "name",
        "lat",
        "lon",
        "elevation",
        "network",
        "gain_cm",
        "observed_at"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "description": "network:station id."
        },
        "slug": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "lat": {
          "type": "number"
        },
        "lon": {
          "type": "number"
        },
        "elevation": {
          "type": "number",
          "description": "Metres."
        },
        "network": {
          "type": "string"
        },
        "gain_cm": {
          "type": "number",
          "description": "Newest depth minus the reading nearest `hours` earlier, cm; always > 0."
        },
        "observed_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}