{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/apiacre-com/json-schema/apiacre-com-us-weather-forecast-input-schema.json",
  "title": "UsWeatherForecastInput",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/apiacre-com-openapi.json#/components/schemas/UsWeatherForecastInput",
  "oneOf": [
    {
      "not": {
        "anyOf": [
          {
            "required": [
              "latitude"
            ]
          },
          {
            "required": [
              "longitude"
            ]
          }
        ]
      },
      "required": [
        "place"
      ]
    },
    {
      "not": {
        "required": [
          "place"
        ]
      },
      "required": [
        "latitude",
        "longitude"
      ]
    }
  ],
  "properties": {
    "place": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 100,
          "minLength": 2
        },
        {
          "type": "null"
        }
      ],
      "title": "Place",
      "description": "City or locality name, optionally followed by country and first-level region qualifiers, for example London, GB or Paris, Texas, US. Provide either place or both latitude and longitude."
    },
    "latitude": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 90.0,
          "minimum": -90.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Latitude",
      "description": "Latitude in decimal degrees, rounded to four decimal places. Provide with longitude instead of place."
    },
    "longitude": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 180.0,
          "minimum": -180.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Longitude",
      "description": "Longitude in decimal degrees, rounded to four decimal places. Provide with latitude instead of place."
    },
    "forecast_type": {
      "type": "string",
      "enum": [
        "day_night",
        "hourly"
      ],
      "title": "Forecast Type",
      "description": "Day/night forecast periods or hourly forecast periods",
      "default": "day_night"
    },
    "units": {
      "type": "string",
      "enum": [
        "us",
        "si"
      ],
      "title": "Units",
      "description": "US customary or SI units requested from the NWS API",
      "default": "us"
    },
    "periods": {
      "type": "integer",
      "maximum": 48.0,
      "minimum": 1.0,
      "title": "Periods",
      "description": "Maximum periods to return; day_night supports at most 14 and hourly at most 48",
      "default": 6
    },
    "include_current_conditions": {
      "type": "boolean",
      "title": "Include Current Conditions",
      "description": "Include the latest observation from the nearest available NWS station; kept opt-in to preserve baseline latency",
      "default": false
    },
    "include_active_alerts": {
      "type": "boolean",
      "title": "Include Active Alerts",
      "description": "Include up to 10 currently active NWS alerts whose affected area contains the requested point",
      "default": false
    },
    "source_preference": {
      "type": "string",
      "enum": [
        "auto",
        "nws",
        "met"
      ],
      "title": "Source Preference",
      "description": "Prefer NWS within its U.S. coverage and fall back to MET Norway globally, or explicitly select one source",
      "default": "auto"
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 100,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Timezone",
      "description": "Optional IANA time zone used to group MET Norway day/night periods. Place-name requests use the matched GeoNames zone; coordinate requests default to UTC; NWS returns its authoritative point time zone."
    }
  },
  "additionalProperties": false,
  "type": "object"
}