Compare commits

...

5 Commits

Author SHA1 Message Date
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
e574358ea9 Make networkRailCorpus.json an object not an array.
All checks were successful
Generate and Release Protos / release (push) Successful in 40s
Object/Array support can be handled on the processor side to support either
2026-04-08 23:12:28 +01:00
5 changed files with 281 additions and 26 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

@@ -143,7 +143,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",

View File

@@ -2,11 +2,11 @@
"$id": "https://schema.owlboard.info/data-ingress/network-rail/networkRailCorpus.schema.json", "$id": "https://schema.owlboard.info/data-ingress/network-rail/networkRailCorpus.schema.json",
"$schema": "https://json-schema.org/draft-07/schema#", "$schema": "https://json-schema.org/draft-07/schema#",
"title": "networkRailCorpus", "title": "networkRailCorpus",
"type": "array",
"additionalItems": false,
"items": {
"type": "object", "type": "object",
"required": ["t", "n"], "required": [
"t",
"n"
],
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"t": { "t": {
@@ -27,5 +27,4 @@
"maximum": 999999 "maximum": 999999
} }
} }
}
} }