Files
backend-data-contracts/schemas/data-ingress/pushport/16schedule.json
Fred Boniface 4ab05ba738
All checks were successful
Generate and Release Protos / release (push) Successful in 38s
Adjust declarations and remove uses of the allOf function to assist with type generation
2026-02-27 20:18:57 +00:00

361 lines
13 KiB
JSON

{
"$id": "https://schema.owlboard.info/data-ingress/pushport16-schedule.schema.json",
"$schema": "https://json-schema.org/draft-07/schema#",
"title": "PushPortSchedule",
"description": "Consolidated object definition for Darwin Schedule messages",
"definitions": {
"originPoint": {
"description": "Merged Origin (OR / OPOR). The starting point of the journey.",
"required": [
"wtd",
"tpl"
],
"type": "object",
"properties": {
"tpl": {
"type": "string",
"description": "TIPLOC"
},
"act": {
"type": "string",
"default": " ",
"description": "Current Activity Codes"
},
"planAct": {
"type": "string",
"description": "Planned Activity Codes"
},
"can": {
"type": "boolean",
"default": false,
"description": "Cancelled flag"
},
"fid": {
"type": "string",
"description": "Unique identifier of the formation data (v3) "
},
"pta": {
"type": "string",
"description": "Public Scheduled Time of Arrival"
},
"ptd": {
"type": "string",
"description": "Public Scheduled Time of Departure"
},
"avgLoading": {
"type": "string",
"description": "Average Loading value based on long-term averages (v3) "
},
"wta": {
"type": "string",
"description": "Working Scheduled Time of Arrival (Optional)"
},
"wtd": {
"type": "string",
"description": "Working Scheduled Time of Departure (Required)"
},
"fd": {
"type": "string",
"description": "False Destination TIPLOC (Passenger only)"
}
}
},
"callingPoint": {
"description": "Merged Intermediate Point (IP / OPIP). An intermediate stop requiring dwell time.",
"required": [
"wta",
"wtd",
"tpl"
],
"type": "object",
"properties": {
"tpl": {
"type": "string",
"description": "TIPLOC"
},
"act": {
"type": "string",
"default": " ",
"description": "Current Activity Codes"
},
"planAct": {
"type": "string",
"description": "Planned Activity Codes"
},
"can": {
"type": "boolean",
"default": false,
"description": "Cancelled flag"
},
"fid": {
"type": "string",
"description": "Unique identifier of the formation data (v3) "
},
"pta": {
"type": "string",
"description": "Public Scheduled Time of Arrival"
},
"ptd": {
"type": "string",
"description": "Public Scheduled Time of Departure"
},
"avgLoading": {
"type": "string",
"description": "Average Loading value based on long-term averages (v3) "
},
"wta": {
"type": "string",
"description": "Working Scheduled Time of Arrival (Required)"
},
"wtd": {
"type": "string",
"description": "Working Scheduled Time of Departure (Required)"
},
"rdelay": {
"type": "integer",
"default": 0,
"description": "Route delay value"
},
"fd": {
"type": "string",
"description": "False Destination (Passenger only)"
}
}
},
"passPoint": {
"description": "Intermediate Passing Point (PP). Purely operational.",
"required": [
"wtp",
"tpl"
],
"type": "object",
"properties": {
"tpl": {
"type": "string",
"description": "TIPLOC"
},
"act": {
"type": "string",
"default": " ",
"description": "Current Activity Codes"
},
"planAct": {
"type": "string",
"description": "Planned Activity Codes"
},
"can": {
"type": "boolean",
"default": false,
"description": "Cancelled flag"
},
"fid": {
"type": "string",
"description": "Unique identifier of the formation data (v3) "
},
"wtp": {
"type": "string",
"description": "Working Scheduled Time of Passing (Required)"
},
"rdelay": {
"type": "integer",
"default": 0,
"description": "Route delay value"
}
},
"additionalProperties": false
},
"destinationPoint": {
"description": "Merged Destination (DT / OPDT). The termination point of the journey.",
"required": [
"wta",
"tpl"
],
"type": "object",
"properties": {
"tpl": {
"type": "string",
"description": "TIPLOC"
},
"act": {
"type": "string",
"default": " ",
"description": "Current Activity Codes"
},
"planAct": {
"type": "string",
"description": "Planned Activity Codes"
},
"can": {
"type": "boolean",
"default": false,
"description": "Cancelled flag"
},
"fid": {
"type": "string",
"description": "Unique identifier of the formation data (v3) "
},
"pta": {
"type": "string",
"description": "Public Scheduled Time of Arrival"
},
"ptd": {
"type": "string",
"description": "Public Scheduled Time of Departure"
},
"avgLoading": {
"type": "string",
"description": "Average Loading value based on long-term averages (v3) "
},
"wta": {
"type": "string",
"description": "Working Scheduled Time of Arrival (Required)"
},
"wtd": {
"type": "string",
"description": "Working Scheduled Time of Departure (Optional)"
},
"rdelay": {
"type": "integer",
"default": 0,
"description": "Route delay value"
}
}
}
},
"type": "object",
"properties": {
"service_name": {
"type": "string",
"description": "Name of the service submitting the update"
},
"service_id": {
"type": "string",
"description": "ID of the service sending the message - usually a hostname"
},
"data_type": {
"type": "string",
"const": "PushPort16Schedule",
"description": "The type of data contained in this message object"
},
"sent_timestamp": {
"type": "integer",
"description": "Unix timestamp representing the time the message was sent"
},
"data_kind": {
"type": "string",
"const": "PushPort16Schedule",
"description": "The data type contained in the message. Currently supported PIS: PIS Data, Timetable: CIF or VSTP Data, Knowledgebase: Station Data"
},
"payload": {
"type": "object",
"required": [
"rid",
"uid",
"trainId",
"ssd",
"toc",
"locations"
],
"properties": {
"rid": {
"type": "string",
"description": "Rail Identifier - Unique value for the service"
},
"uid": {
"type": "string",
"description": "Unique ID - Unique value for the timetable entry - maps to Network Rail CIF schedules"
},
"ssd": {
"type": "string",
"format": "date",
"description": "Service Start Date - The date the service commences"
},
"trainId": {
"type": "string",
"description": "Headcode"
},
"toc": {
"type": "string",
"minLength": 2,
"maxLength": 2,
"description": "Train Operator (ATOC Code)"
},
"rsid": {
"type": "string",
"description": "Retail Service ID"
},
"status": {
"type": "string",
"default": "P",
"description": "P = Permanent, L = Long Term, S = Short Term"
},
"trainCat": {
"type": "string",
"default": "OO",
"description": "Train Category"
},
"isPassenger": {
"type": "boolean",
"default": true,
"description": "Declares the service as a passenger service"
},
"isActive": {
"type": "boolean",
"default": false,
"description": "UNKNOWN"
},
"isCharter": {
"type": "boolean",
"default": false,
"description": "Declares the service as a charter service"
},
"cancelReason": {
"type": "integer",
"description": "Cancellation Reason code"
},
"locations": {
"type": "object",
"additionalProperties": false,
"description": "Merged and flattened location objects",
"properties": {
"OR": {
"type": "array",
"description": "OR/OPOR Values - Trains Origin",
"items": {
"$ref": "#/definitions/originPoint"
}
},
"IP": {
"type": "array",
"description": "IP/OPIP Values - Intermediate Points",
"items": {
"$ref": "#/definitions/callingPoint"
}
},
"PP": {
"type": "array",
"description": "Passing Points (Non-stop)",
"items": {
"$ref": "#/definitions/passPoint"
}
},
"DT": {
"type": "array",
"description": "DT/OPDT Values - Trains Destination",
"items": {
"$ref": "#/definitions/destinationPoint"
}
}
}
}
}
}
},
"required": [
"service_name",
"service_id",
"data_type",
"sent_timestamp"
],
"additionalProperties": false
}