{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/smarterweather-com/json-schema/smarterweather-com-weather-batch-request-schema.json",
  "title": "WeatherBatchRequest",
  "description": "Multi-location request body. `locations[]` is required and capped\nat 25 entries. The remaining fields are shared parameters applied\nto every location.\n",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/smarterweather-com-openapi.yaml#/components/schemas/WeatherBatchRequest",
  "type": "object",
  "required": [
    "locations"
  ],
  "properties": {
    "locations": {
      "type": "array",
      "minItems": 1,
      "maxItems": 25,
      "description": "Locations to fetch in this batch. Order is preserved on the\ncorresponding `results[]` array.\n",
      "items": {
        "$ref": "#/$defs/WeatherBatchLocation"
      }
    },
    "include": {
      "type": "string",
      "description": "Same semantics as the `include` query parameter on\n`GET /v1/weather`. Applied to every location.\n"
    },
    "units": {
      "type": "string",
      "enum": [
        "imperial",
        "metric"
      ],
      "default": "imperial",
      "description": "Same semantics as the `units` query parameter on `GET /v1/weather`."
    },
    "days": {
      "type": "integer",
      "minimum": 1,
      "maximum": 14,
      "default": 10,
      "description": "Same semantics as the `days` query parameter on `GET /v1/weather`."
    },
    "hourly_hours": {
      "type": "integer",
      "minimum": 1,
      "maximum": 168,
      "default": 48,
      "description": "Same semantics as the `hourly_hours` query parameter on `GET /v1/weather`."
    },
    "view": {
      "type": "string",
      "enum": [
        "concise",
        "detailed"
      ],
      "default": "detailed",
      "description": "Same semantics as the `view` query parameter on `GET /v1/weather`. Applied to every row."
    },
    "fields": {
      "type": "string",
      "description": "Same semantics as the `fields` query parameter on\n`GET /v1/weather`, as one comma-separated string. Validated once\nagainst the batch `include`; an invalid path fails the whole\nrequest with `400`.\n"
    },
    "hourly_step": {
      "type": "integer",
      "minimum": 1,
      "maximum": 24,
      "default": 1,
      "description": "Same semantics as the `hourly_step` query parameter on `GET /v1/weather`."
    },
    "hourly_step_from": {
      "type": "integer",
      "minimum": 0,
      "maximum": 168,
      "default": 0,
      "description": "Same semantics as the `hourly_step_from` query parameter on `GET /v1/weather`."
    }
  },
  "$defs": {
    "WeatherBatchLocation": {
      "type": "object",
      "description": "A single location selector. Exactly one of (`lat` + `lon`),\n`zip`, or `location` must be provided. Mixing selectors in one\nentry, or omitting all of them, fails that row only.\n",
      "properties": {
        "lat": {
          "type": "number",
          "format": "double",
          "minimum": -90,
          "maximum": 90,
          "description": "Latitude. Required together with `lon`."
        },
        "lon": {
          "type": "number",
          "format": "double",
          "minimum": -180,
          "maximum": 180,
          "description": "Longitude. Required together with `lat`."
        },
        "zip": {
          "type": "string",
          "pattern": "^\\d{5}$",
          "description": "5-digit US ZIP code."
        },
        "location": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "description": "Free-text location name."
        }
      }
    }
  }
}