Compare commits

..

6 Commits

Author SHA1 Message Date
b55d9f32ec Add further missing types
All checks were successful
Generate and Release Protos / release (push) Successful in 47s
2026-04-24 19:23:21 +01:00
79c900e320 Ensure fields for rdelay and operator are present in schedule schema
All checks were successful
Generate and Release Protos / release (push) Successful in 47s
2026-04-24 19:13:52 +01:00
0e87c510b3 Increase max size of allowed 'seq' value in schedule
All checks were successful
Generate and Release Protos / release (push) Successful in 49s
2026-04-24 15:49:44 +01:00
2552204da2 Add schema for TS message
All checks were successful
Generate and Release Protos / release (push) Successful in 49s
2026-04-22 20:14:05 +01:00
5eb6f623be Schemata...
All checks were successful
Generate and Release Protos / release (push) Successful in 48s
2026-04-21 13:56:26 +01:00
d8acf84b44 Add schema for OW Data 2026-04-21 13:55:57 +01:00
4 changed files with 278 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
# backend-data-contracts # backend-data-contracts
This repository is the single source of truth for all schema definitions used across the Owlboard backend communication and storage services. Language specific types are generated here and published to the Gitea package repository linked to the repo. This repository is the single source of truth for all schemata definitions used across the Owlboard backend communication and storage services. Language specific types are generated here and published to the Gitea package repository linked to the repo.
## Directory Structure ## Directory Structure

View File

@@ -0,0 +1,190 @@
{
"$id": "https://schema.owlboard.info/data-ingress/darwin/TS.schema.json",
"$schema": "https://json-schema.org/draft-07/schema#",
"title": "DarwinTSData",
"type": "object",
"required": [
"rid",
"ssd",
"locs",
"rf"
],
"additionalProperties": false,
"properties": {
"rid": {
"type": "string",
"name": "RID",
"description": "The RID of the service that the data applies to"
},
"uid": {
"type": "string",
"name": "UID",
"description": "The UID of the timetable entry for this service"
},
"ssd": {
"type": "string",
"format": "date",
"name": "Service Start Date",
"description": "The date on which the service commences"
},
"rf": {
"type": "boolean",
"name": "isReverseFormation",
"description": "Whether the service is running in reverse formation"
},
"lr": {
"type": "object",
"name": "Late Reason",
"description": "Late Reason Object",
"additionalProperties": false,
"required": [
"c"
],
"properties": {
"c": {
"type": "integer",
"name": "Reason code",
"description": "The reason code for the delay"
},
"t": {
"type": "string",
"name": "TIPLOC",
"description": "The TIPLOC where the delay occurred"
},
"n": {
"type": "boolean",
"name": "Near",
"description": "Whether the delay occurred NEAR the TIPLOC, otherwise at the TIPLOC"
}
}
},
"locs" : {
"type": "array",
"items": {"$ref": "#/definitions/location"}
}
},
"definitions": {
"location": {
"type": "object",
"required": ["t"],
"properties": {
"t": {
"type": "string",
"name": "TIPLOC",
"description": "The TIPLOC of the location"
},
"wta": {
"type": "string",
"name": "Working Time of Arrival",
"description": "The scheduled arrival time from the working timetable"
},
"wtd": {
"type": "string",
"name": "Working Time of Departure",
"description": "The scheduled departure time from the working timetable"
},
"pta": {
"type": "string",
"name": "Public Time of Arrival",
"description": "The scheduled arrival time from the public timetable"
},
"ptd": {
"type": "string",
"name": "Public time of departure",
"description": "The scheduled departure time from the public timetable"
},
"wtp": {
"type": "string",
"name": "Working pass time",
"description": "The scheduled pass time from the working timetable"
},
"d": {
"name": "Departure data",
"$ref": "#/definitions/forecastTime"
},
"a": {
"name": "Arrival data",
"$ref": "#/definitions/forecastTime"
},
"p": {
"name": "Pass data",
"$ref": "#/definitions/forecastTime"
},
"plt": {
"name": "Platform data",
"$ref": "#/definitions/platformStatus"
}
}
},
"forecastTime": {
"type": "object",
"name": "Forecast/Actual Time",
"properties": {
"et": {
"type": "string",
"name": "Estimated Time",
"description": "The estimated time of this event"
},
"at": {
"type": "string",
"name": "Actual Time",
"description": "The actual time of this event"
},
"wet": {
"type": "string",
"name": "Working Estimated Time",
"description": "The estimated 'working' time"
},
"atRem": {
"type": "boolean",
"name": "AT Removal",
"description": "If true, previous AT given was not valid, delete it"
},
"del": {
"type": "boolean",
"name": "Delayed",
"description": "If this train is delayed (Display delayed if no ET/AT)"
},
"src": {
"type": "string",
"name": "Data source",
"description": "The source of this data (Darwin/Trust/CIS etc)"
}
}
},
"platformStatus": {
"type": "object",
"name": "PlatformData",
"required": [
"sup"
],
"properties": {
"sup": {
"type": "boolean",
"name": "Suppressed",
"description": "Whether the platform is suppressed (hidden to public)"
},
"n": {
"type": "string",
"name": "Platform Number",
"description": "The platform at which this event will occur"
},
"src": {
"type": "string",
"name": "Data source",
"description": "The name of the source of the platform data"
},
"c": {
"type": "boolean",
"name": "Platform Confirmed",
"description": "Whether the platform has been confirmed by local CIS"
},
"cisSup": {
"type": "boolean",
"name": "CIS suppressed",
"description": "Whether the local CIS has suppressed the platform (not needed to determine whether to suppress or not)"
}
}
}
}
}

View File

@@ -0,0 +1,66 @@
{
"$id": "https://schema.owlboard.info/data-ingress/darwin/OW.schema.json",
"$schema": "https://json-schema.org/draft-07/schema#",
"title": "DarwinOwData",
"type": "object",
"required": [
"i",
"d"
],
"additionalProperties": false,
"properties": {
"i": {
"type": "string",
"name": "ID",
"description": "Unique ID of the incident message"
},
"c": {
"type": "string",
"name": "Category",
"description": "Category of the incident message"
},
"s": {
"type": "integer",
"name": "Severity",
"description": "The severity of the incident"
},
"l": {
"type": "array",
"name": "locations",
"description": "CRS Locations at which the message applies",
"additionalItems": false,
"items": {
"type": "string",
"name": "CRS",
"description": "CRS Location where this message applies"
}
},
"d": {
"type": "boolean",
"name": "Delete",
"description": "If true, the message is to be deleted"
},
"m": {
"type": "object",
"name": "Message",
"description": "The message properties",
"properties": {
"l": {
"type": "string",
"name": "href",
"description": "URL where further information can be found"
},
"lt": {
"type": "string",
"name": "href-text",
"description": "Text that should be displayed as part of the href"
},
"m": {
"type": "string",
"name": "Message text",
"description": "The text to be displayed"
}
}
}
}
}

View File

@@ -110,6 +110,11 @@
"type": "boolean", "type": "boolean",
"default": false "default": false
}, },
"tc": {
"name": "trainCat",
"description": "Train Category",
"type": "string"
},
"cr": { "cr": {
"name": "cancel_reason", "name": "cancel_reason",
"type": ["integer", "null"], "type": ["integer", "null"],
@@ -120,6 +125,10 @@
"type": "string", "type": "string",
"description": "The location at which the service was cancelled" "description": "The location at which the service was cancelled"
}, },
"cn": {
"name": "cancel_near",
"description": "Whether the incident happened 'near' cancel_location, or AT cancel_location (default, false, at location)"
},
"l": { "l": {
"type": "array", "type": "array",
"minItems": 2, "minItems": 2,
@@ -133,6 +142,17 @@
"maxLength": 7, "maxLength": 7,
"minLength": 4 "minLength": 4
}, },
"rd": {
"name": "rdelay",
"description": "Route Delay",
"type": "integer"
},
"p": {
"name": "platform",
"description": "Scheduled platform",
"type": "string",
"maxLength": 4
},
"lr": { "lr": {
"name": "loc_role", "name": "loc_role",
"description": "The role of the location (Orig, Call, Pass, Dest)", "description": "The role of the location (Orig, Call, Pass, Dest)",
@@ -143,7 +163,7 @@
"description": "The sequence in the service at which this location occours", "description": "The sequence in the service at which this location occours",
"type": "integer", "type": "integer",
"minimum": 1, "minimum": 1,
"maximum": 32767 "maximum": 2147483647
}, },
"pta": { "pta": {
"description": "Public timetable arrival", "description": "Public timetable arrival",