{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/digitraffic-fi/json-schema/digitraffic-fi-tms-raw-history-csv-schema.json",
  "title": "TmsRawHistoryCsv",
  "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/TmsRawHistoryCsv",
  "required": [
    "dayNumber",
    "direction",
    "faulty",
    "hour",
    "hundredthOfASecond",
    "lane",
    "length",
    "minute",
    "queueStart",
    "second",
    "speed",
    "timeTnterval",
    "tmsNumber",
    "totalTime",
    "vehicleClass",
    "yearShort"
  ],
  "type": "object",
  "properties": {
    "tmsNumber": {
      "type": "integer",
      "description": "TMS Station tmsNumber (Not station id!)",
      "format": "int32"
    },
    "yearShort": {
      "maximum": 99,
      "minimum": 0,
      "type": "integer",
      "description": "Year in short format, last two digits of the year",
      "format": "int32"
    },
    "dayNumber": {
      "maximum": 366,
      "minimum": 1,
      "type": "integer",
      "description": "Day of the year (i.e. ordinal date, taking into account leap years). e.g. 1.1. = 1",
      "format": "int32"
    },
    "hour": {
      "maximum": 23,
      "minimum": 0,
      "type": "integer",
      "description": "Hour of the day (24h)",
      "format": "int32"
    },
    "minute": {
      "maximum": 59,
      "minimum": 0,
      "type": "integer",
      "description": "Minute of the hour",
      "format": "int32"
    },
    "second": {
      "maximum": 59,
      "minimum": 0,
      "type": "integer",
      "description": "Second of the minute",
      "format": "int32"
    },
    "hundredthOfASecond": {
      "maximum": 99,
      "minimum": 0,
      "type": "integer",
      "description": "Hundredth of the second",
      "format": "int32"
    },
    "length": {
      "maximum": 39.8,
      "minimum": 1,
      "type": "number",
      "description": "Length of the vehicle in meters",
      "format": "double"
    },
    "lane": {
      "type": "integer",
      "description": "Lane",
      "format": "int32"
    },
    "direction": {
      "maximum": 2,
      "minimum": 1,
      "type": "integer",
      "description": "Measurement direction </br>1 = According to the road register address increasing direction. I.e. on the road 4 to Rovaniemi.</br>2 = According to the road register address decreasing direction. I.e. on the road 4 to Helsinki.",
      "format": "int32"
    },
    "vehicleClass": {
      "maximum": 7,
      "minimum": 1,
      "type": "integer",
      "description": "Vehicle class</br>1 HA-PA (car or delivery van)</br>2 KAIP (truck, no trailer)</br>3 Buses</br>4 KAPP (semi-trailer truck)</br>5 KATP (truck with trailer)</br>6 HA + PK (car or delivery van with trailer)</br>7 HA + AV (car or delivery van with trailer or camper)",
      "format": "int32"
    },
    "speed": {
      "maximum": 188,
      "minimum": 2,
      "type": "integer",
      "description": "Speed in km/h",
      "format": "int32"
    },
    "faulty": {
      "maximum": 1,
      "minimum": 0,
      "type": "integer",
      "description": "Is record faulty (0=valid record, 1=faulty record)",
      "format": "int32"
    },
    "totalTime": {
      "type": "integer",
      "description": "Total time (technical)",
      "format": "int32"
    },
    "timeTnterval": {
      "type": "integer",
      "description": "Time interval (technical)",
      "format": "int32"
    },
    "queueStart": {
      "type": "integer",
      "description": "Queue start (technical)",
      "format": "int32"
    }
  }
}