{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/digitraffic-fi/json-schema/digitraffic-fi-forecast-section-weather-dto-v1-schema.json",
  "title": "ForecastSectionWeatherDtoV1",
  "description": "Forecast section weather forecasts",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/digitraffic-fi-road-api-openapi.yml#/components/schemas/ForecastSectionWeatherDtoV1",
  "required": [
    "dataUpdatedTime"
  ],
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "VERSION 1: Forecast section identifier 15 characters ie. 00004_112_000_0: <br>\n1. Road number 5 characters ie. 00004, <br>\n2. Road section 3 characters ie. 112, <br>\n3. Road section version 3 characters ie. 000, <br>\n4. Reserved for future needs 1 characters default 0 <br>\n<br>\nVERSION 2: Forecast section identifier ie. 00004_342_01435_0_274.569: <br>\n1. Road number 5 characters ie. 00004, <br>\n2. Road section 3 characters ie. 342, <br>\n3. Start distance 5 characters ie. 000, <br>\n4. Carriageway 1 character, <br>\n5. Measure value of link start point. Varying number of characters ie. 274.569, <br>\nRefers to Digiroad content at https://aineistot.vayla.fi/digiroad/"
    },
    "forecasts": {
      "type": "array",
      "description": "Forecast section's weather forecasts",
      "items": {
        "$ref": "#/$defs/ForecastSectionWeatherForecastDtoV1"
      }
    },
    "dataUpdatedTime": {
      "type": "string",
      "description": "Data last updated time",
      "format": "date-time"
    }
  },
  "$defs": {
    "ForecastConditionReasonDtoV1": {
      "type": "object",
      "properties": {
        "precipitationCondition": {
          "type": "string",
          "description": "Precipitation condition:<br>\nNO_DATA_AVAILABLE(0) = no data available,<br>\nNO_RAIN_DRY_WEATHER(1) = rain intensity lt 0.2 mm/h,<br>\nLIGHT_RAIN(2) = rain intensity ge 0.2 mm/h,<br>\nRAIN(3) = rain intensity ge 2.5 mm/h,<br>\nHEAVY_RAIN(4) = rain intensity ge 7.6 mm/h,<br>\nLIGHT_SNOWFALL(5) = snowing intensity ge 0.2 cm/h,<br>\nSNOWFALL(6) = snowing intensity ge 1 cm/h,<br>\nHEAVY_SNOWFALL(7) = snowing intensity ge 3 cm/h<br>\n(lt = lower than, ge = greater or equal)",
          "enum": [
            "NO_DATA_AVAILABLE",
            "NO_RAIN_DRY_WEATHER",
            "LIGHT_RAIN",
            "RAIN",
            "HEAVY_RAIN",
            "LIGHT_SNOWFALL",
            "SNOWFALL",
            "HEAVY_SNOWFALL"
          ]
        },
        "roadCondition": {
          "type": "string",
          "description": "The state of the road",
          "enum": [
            "DRY",
            "MOIST",
            "WET",
            "SLUSH",
            "FROST",
            "PARTLY_ICY",
            "ICE",
            "SNOW"
          ]
        },
        "windCondition": {
          "type": "string",
          "description": "The strength of wind",
          "enum": [
            "WEAK",
            "MEDIUM",
            "STRONG"
          ]
        },
        "freezingRainCondition": {
          "type": "boolean",
          "description": "Tells if there is freezing rain: true/false"
        },
        "winterSlipperiness": {
          "type": "boolean",
          "description": "Tells if it is slippery: true/false"
        },
        "visibilityCondition": {
          "type": "string",
          "description": "Visibility",
          "enum": [
            "FAIRLY_POOR",
            "POOR"
          ]
        },
        "frictionCondition": {
          "type": "string",
          "description": "The amount of friction on the road",
          "enum": [
            "SLIPPERY",
            "VERY_SLIPPERY"
          ]
        }
      },
      "description": "Forecast that is used is Vaisala’s weather forecast which is initialised from the weather model that performs best for Finland for a period under study. Majority of the times the initialisation is done from ECMWF model data. Then Vaisala meteorologists also manually edit the data to fix certain known errors in the model."
    },
    "ForecastSectionWeatherForecastDtoV1": {
      "required": [
        "dataUpdatedTime"
      ],
      "type": "object",
      "properties": {
        "time": {
          "type": "string",
          "description": "Observation or forecast time depending on type",
          "format": "date-time"
        },
        "type": {
          "type": "string",
          "description": "Tells if object is an observation or a forecast. (OBSERVATION, FORECAST)",
          "enum": [
            "OBSERVATION",
            "FORECAST"
          ]
        },
        "forecastName": {
          "type": "string",
          "description": "Name of the forecast"
        },
        "daylight": {
          "type": "boolean",
          "description": "Tells if there is daylight: true/false"
        },
        "roadTemperature": {
          "type": "number",
          "description": "Road temperature at given time. If not available value is not set",
          "format": "double"
        },
        "temperature": {
          "type": "number",
          "description": "Air temperature",
          "format": "double"
        },
        "windSpeed": {
          "type": "number",
          "description": "Wind speed in m/s",
          "format": "double"
        },
        "windDirection": {
          "type": "integer",
          "description": "Wind direction in degrees. 0 when there is no wind or the direction is variable. 90 degrees is arrow to the east (count clockwise)",
          "format": "int32"
        },
        "overallRoadCondition": {
          "type": "string",
          "description": "Overall road condition",
          "enum": [
            "NORMAL_CONDITION",
            "POOR_CONDITION",
            "EXTREMELY_POOR_CONDITION",
            "CONDITION_COULD_NOT_BE_RESOLVED"
          ]
        },
        "weatherSymbol": {
          "type": "string",
          "description": "Weather symbol code. See corresponding symbols at https://www.vaisala.com/en/vaisala-weather-symbols. Symbols are allowed to be used in user's applications but any further modification and redistribution is denied."
        },
        "reliability": {
          "type": "string",
          "description": "Forecast reliability",
          "enum": [
            "SUCCESSFUL",
            "NO_DATA_FROM_ROADSTATION",
            "FAILED"
          ]
        },
        "forecastConditionReason": {
          "$ref": "#/$defs/ForecastConditionReasonDtoV1"
        },
        "dataUpdatedTime": {
          "type": "string",
          "description": "Data last updated time",
          "format": "date-time"
        }
      },
      "description": "Forecast section's weather forecast"
    }
  }
}