From a734dea17acf377690a03996e45dfc87645dd0a7 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Sun, 5 Apr 2026 20:13:14 +0100 Subject: [PATCH] Add darwin association data type --- .../darwin-data/darwin-association.json | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 schemas/data-ingress/darwin-data/darwin-association.json diff --git a/schemas/data-ingress/darwin-data/darwin-association.json b/schemas/data-ingress/darwin-data/darwin-association.json new file mode 100644 index 0000000..a0d4ace --- /dev/null +++ b/schemas/data-ingress/darwin-data/darwin-association.json @@ -0,0 +1,118 @@ +{ + "$id": "https://schema.owlboard.info/data-ingress/darwin/association.schema.json", + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "DarwinAssocData", + "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": "raw", + "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": "darwin-association", + "description": "The data type contained in the message. Currently supported PIS: PIS Data, Timetable: CIF or VSTP Data, Knowledgebase: Station Data" + }, + "payload": { + "type": "array", + "additionalItems": false, + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "mr", + "ar", + "t", + "c", + "s", + "mt", + "at" + ], + "properties": { + "mr": { + "type": "string", + "name": "Main RID", + "description": "The main RID of this association object" + }, + "ar": { + "type": "string", + "name": "Associated RID", + "description": "The associated RID of this association object" + }, + "t": { + "type": "string", + "name": "TIPLOC", + "description": "The location at which this association applies" + }, + "c": { + "enum": ["JJ", "VV", "LK", "NP"], + "name": "Category", + "description": "The type of association" + }, + "s": { + "type": "string", + "format": "date", + "name": "SSD", + "description": "SSD Generated from the Main RID" + }, + "mt": { + "name": "Main Times", + "description": "Timings that apply to the main RID", + "type": "object", + "properties": { + "wta": { "type": "string", "format": "date-time" }, + "wtd": { "type": "string", "format": "date-time" }, + "wtp": { "type": "string", "format": "date-time" }, + "pta": { "type": "string", "format": "date-time" }, + "ptd": { "type": "string", "format": "date-time" } + } + }, + "at": { + "name": "Associated Times", + "description": "Timings that apply to the associated RID", + "type": "object", + "properties": { + "wta": { "type": "string", "format": "date-time" }, + "wtd": { "type": "string", "format": "date-time" }, + "wtp": { "type": "string", "format": "date-time" }, + "pta": { "type": "string", "format": "date-time" }, + "ptd": { "type": "string", "format": "date-time" } + } + }, + "can": { + "name": "Cancelled", + "type": "boolean", + "description": "Whether this association is cancelled" + }, + "del": { + "name": "Deleted", + "type": "boolean", + "description": "Whether this association is deleted" + } + } + } + } + }, + "required": [ + "service_name", + "service_id", + "data_type", + "data_kind", + "sent_timestamp", + "payload" + ], + "additionalProperties": false +} \ No newline at end of file