From 14fb45965582c6210b6229a73ab31272ead21ad7 Mon Sep 17 00:00:00 2001 From: Drew Johnston <31270488+drewjj@users.noreply.github.com> Date: Fri, 18 Oct 2024 05:02:35 -0600 Subject: [PATCH] Update TIM schema to include full TIM definition for ODE supported fields --- .../main/resources/schemas/schema-tim.json | 1464 ++++++++++++----- 1 file changed, 1013 insertions(+), 451 deletions(-) diff --git a/jpo-ode-core/src/main/resources/schemas/schema-tim.json b/jpo-ode-core/src/main/resources/schemas/schema-tim.json index dbab9d350..f637c0775 100644 --- a/jpo-ode-core/src/main/resources/schemas/schema-tim.json +++ b/jpo-ode-core/src/main/resources/schemas/schema-tim.json @@ -1,7 +1,22 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "type": "object", "properties": { "metadata": { + "$ref": "#/$defs/OdeTimMetadata" + }, + "payload": { + "$ref": "#/$defs/OdeTimPayload" + } + }, + "required": [ + "metadata", + "payload" + ], + "additionalProperties": false, + "$defs": { + "OdeTimMetadata": { + "type": "object", "properties": { "logFileName": { "type": "string" @@ -31,19 +46,7 @@ "type": "string" }, "recordGeneratedBy": { - "enum": [ - "TMC", - "OBU", - "RSU", - "TMC_VIA_SAT", - "TMC_VIA_SNMP", - "UNKNOWN", - null - ], - "type": [ - "string", - "null" - ] + "$ref": "#/$defs/OdeRecordGeneratedBy" }, "recordType": { "type": "string" @@ -52,44 +55,16 @@ "type": "string" }, "schemaVersion": { - "const": 7, "type": "string" }, "securityResultCode": { "type": "string" }, "serialId": { - "properties": { - "bundleId": { - "type": "string" - }, - "bundleSize": { - "type": "string" - }, - "recordId": { - "type": "string" - }, - "serialNumber": { - "type": "string" - }, - "streamId": { - "type": "string" - } - }, - "required": [ - "recordId", - "serialNumber", - "streamId", - "bundleSize", - "bundleId" - ], - "type": "object" + "$ref": "#/$defs/OdeSerialId" }, "asn1": { - "type": [ - "string", - "null" - ] + "type": "string" } }, "required": [ @@ -108,429 +83,1016 @@ "logFileName", "odeReceivedAt", "originIp" + ] + }, + "OdeRecordGeneratedBy": { + "type": [ + "string", + "null" ], - "type": "object" + "enum": [ + "TMC", + "OBU", + "RSU", + "TMC_VIA_SAT", + "TMC_VIA_SNMP", + "UNKNOWN", + null + ] }, - "payload": { + "OdeSerialId": { + "type": "object", + "properties": { + "bundleId": { + "type": "string" + }, + "bundleSize": { + "type": "string" + }, + "recordId": { + "type": "string" + }, + "serialNumber": { + "type": "string" + }, + "streamId": { + "type": "string" + } + }, + "required": [ + "recordId", + "serialNumber", + "streamId", + "bundleSize", + "bundleId" + ] + }, + "OdeTimPayload": { + "type": "object", "properties": { "data": { + "type": "object", "properties": { "MessageFrame": { - "properties": { - "messageId": { - "type": "string" - }, - "value": { + "$ref": "#/$defs/OdeTimMessageFrame" + } + }, + "required": [ + "MessageFrame" + ] + }, + "dataType": { + "type": "string" + } + }, + "required": [ + "data", + "dataType" + ] + }, + "OdeTimMessageFrame": { + "type": "object", + "properties": { + "messageId": { + "type": "string" + }, + "value": { + "type": "object", + "properties": { + "TravelerInformation": { + "$ref": "#/$defs/J2735Tim" + } + }, + "required": [ + "TravelerInformation" + ] + } + }, + "required": [ + "messageId", + "value" + ] + }, + "J2735Tim": { + "type": "object", + "properties": { + "timeStamp": { + "type": "string" + }, + "packetID": { + "type": "string" + }, + "urlB": { + "type": "string" + }, + "dataFrames": { + "oneOf": [ + { + "type": "array", + "items": [ + { + "$ref": "#/$defs/J2735DateFrame" + } + ] + }, + { + "$ref": "#/$defs/J2735DateFrame" + } + ] + }, + "msgCnt": { + "type": "string" + } + }, + "required": [ + "dataFrames", + "msgCnt" + ] + }, + "J2735DateFrame": { + "type": "object", + "properties": { + "TravelerDataFrame": { + "type": "object", + "properties": { + "notUsed": { + "type": "string" + }, + "frameType": { + "$ref": "#/$defs/J2735DF_FrameType" + }, + "msgId": { + "oneOf": [ + { + "type": "object", "properties": { - "TravelerInformation": { - "properties": { - "dataFrames": { - "properties": { - "TravelerDataFrame": { - "properties": { - "content": { - "properties": { - "advisory": { - "anyOf": [ - { - "properties": { - "SEQUENCE": { - "items": [ - { - "properties": { - "item": { - "properties": { - "itis": { - "type": "string" - } - }, - "required": [ - "itis" - ], - "type": "object" - } - }, - "required": [ - "item" - ], - "type": "object" - } - ], - "type": "array" - } - }, - "required": [ - "SEQUENCE" - ], - "type": "object" - }, - { - "properties": { - "SEQUENCE": { - "properties": { - "item": { - "properties": { - "itis": { - "type": "string" - } - }, - "required": [ - "itis" - ], - "type": "object" - } - }, - "required": [ - "item" - ], - "type": "object" - } - }, - "required": [ - "SEQUENCE" - ], - "type": "object" - } - ] - } - }, - "required": [ - "advisory" - ], - "type": "object" - }, - "durationTime": { - "type": "string" - }, - "frameType": { - "properties": { - "advisory": { - "type": "string" - } - }, - "required": [ - "advisory" - ], - "type": "object" - }, - "msgId": { - "properties": { - "roadSignID": { - "properties": { - "mutcdCode": { - "properties": { - "warning": { - "type": "string" - } - }, - "required": [ - "warning" - ], - "type": "object" - }, - "position": { - "properties": { - "lat": { - "type": "string" - }, - "long": { - "type": "string" - }, - "elevation": { - "type": [ - "string", - "null" - ] - } - }, - "required": [ - "lat", - "long" - ], - "type": "object" - }, - "viewAngle": { - "type": "string" - } - }, - "required": [ - "viewAngle", - "mutcdCode", - "position" - ], - "type": "object" - } - }, - "required": [ - "roadSignID" - ], - "type": "object" - }, - "priority": { - "type": "string" - }, - "regions": { - "properties": { - "GeographicalPath": { - "properties": { - "anchor": { - "properties": { - "lat": { - "type": "string" - }, - "long": { - "type": "string" - }, - "elevation": { - "type": [ - "string", - "null" - ] - } - }, - "required": [ - "lat", - "long" - ], - "type": [ - "object", - "null" - ] - }, - "closedPath": { - "properties": { - "true": { - "type": [ - "string", - "null" - ] - }, - "false": { - "type": [ - "string", - "null" - ] - } - }, - "type": [ - "object", - "null" - ] - }, - "description": { - "properties": { - "path": { - "properties": { - "offset": { - "properties": { - "xy": { - "properties": { - "nodes": { - "properties": { - "NodeXY": { - "items": [ - { - "properties": { - "delta": { - "properties": { - "node-LatLon": { - "properties": { - "lat": { - "type": "string" - }, - "lon": { - "type": "string" - }, - "elevation": { - "type": [ - "string", - "null" - ] - } - }, - "required": [ - "lon", - "lat" - ], - "type": "object" - } - }, - "required": [ - "node-LatLon" - ], - "type": "object" - } - }, - "required": [ - "delta" - ], - "type": "object" - } - ], - "type": "array" - } - }, - "required": [ - "NodeXY" - ], - "type": "object" - } - }, - "required": [ - "nodes" - ], - "type": "object" - } - }, - "required": [ - "xy" - ], - "type": "object" - } - }, - "required": [ - "offset" - ], - "type": "object" - } - }, - "required": [ - "path" - ], - "type": [ - "object", - "null" - ] - }, - "direction": { - "type": "string" - }, - "directionality": { - "properties": { - "unavailable": { - "type": "string" - }, - "forward": { - "type": "string" - }, - "reverse": { - "type": "string" - }, - "both": { - "type": "string" - } - }, - "type": [ - "object", - "null" - ] - }, - "laneWidth": { - "type": [ - "string", - "null" - ] - } - }, - "required": [ - "direction" - ], - "type": "object" - } - }, - "required": [ - "GeographicalPath" - ], - "type": "object" - }, - "notUsed1": { - "type": "string" - }, - "notUsed2": { - "type": "string" - }, - "notUsed3": { - "type": "string" - }, - "notUsed": { - "type": "string" - }, - "startTime": { - "type": "string" - }, - "startYear": { - "type": "string" - } - }, - "required": [ - "regions", - "durationTime", - "notUsed2", - "notUsed3", - "notUsed", - "startYear", - "notUsed1", - "frameType", - "msgId", - "startTime", - "priority", - "content" - ], - "type": "object" - } - }, - "required": [ - "TravelerDataFrame" - ], - "type": "object" - }, - "msgCnt": { - "type": "string" - }, - "packetID": { - "type": "string" - } - }, - "required": [ - "packetID", - "dataFrames", - "msgCnt" - ], - "type": "object" + "furtherInfoID": { + "type": "string" } }, "required": [ - "TravelerInformation" - ], - "type": "object" + "furtherInfoID" + ] + }, + { + "$ref": "#/$defs/J2735DF_MsgId_RoadSignId" } - }, - "required": [ - "messageId", - "value" - ], - "type": "object" + ] + }, + "startYear": { + "type": "string" + }, + "startTime": { + "type": "string" + }, + "durationTime": { + "type": "string" + }, + "priority": { + "type": "string" + }, + "notUsed1": { + "type": "string" + }, + "regions": { + "oneOf": [ + { + "type": "array", + "items": [ + { + "$ref": "#/$defs/J2735DF_Regions" + } + ] + }, + { + "$ref": "#/$defs/J2735DF_Regions" + } + ] + }, + "notUsed2": { + "type": "string" + }, + "notUsed3": { + "type": "string" + }, + "content": { + "$ref": "#/$defs/J2735DF_Content" + }, + "url": { + "type": "string" } }, "required": [ - "MessageFrame" - ], - "type": "object" + "notUsed", + "frameType", + "msgId", + "startTime", + "durationTime", + "priority", + "notUsed1", + "regions", + "notUsed2", + "notUsed3", + "content" + ] + } + }, + "required": [ + "TravelerDataFrame" + ] + }, + "J2735DF_FrameType": { + "oneOf": [ + { + "type": "object", + "properties": { + "unknown": { + "type": "string" + } + }, + "required": [ + "unknown" + ] }, - "dataType": { + { + "type": "object", + "properties": { + "advisory": { + "type": "string" + } + }, + "required": [ + "advisory" + ] + }, + { + "type": "object", + "properties": { + "roadSignage": { + "type": "string" + } + }, + "required": [ + "roadSignage" + ] + }, + { + "type": "object", + "properties": { + "commercialSignage": { + "type": "string" + } + }, + "required": [ + "commercialSignage" + ] + } + ] + }, + "J2735DF_MsgId_RoadSignId": { + "type": "object", + "properties": { + "roadSignID": { + "type": "object", + "properties": { + "position": { + "$ref": "#/$defs/J2735Position3D" + }, + "viewAngle": { + "type": "string" + }, + "mutcdCode": { + "$ref": "#/$defs/J2735MUTCDCode" + } + }, + "required": [ + "position", + "viewAngle" + ] + } + }, + "required": [ + "roadSignID" + ] + }, + "J2735DF_Regions": { + "type": "object", + "properties": { + "GeographicalPath": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "$ref": "#/$defs/J2735RoadSegmentReferenceID" + }, + "anchor": { + "$ref": "#/$defs/J2735Position3D" + }, + "laneWidth": { + "type": "string" + }, + "directionality": { + "$ref": "#/$defs/J2735DirectionOfUse" + }, + "closedPath": { + "$ref": "#/$defs/BooleanObject" + }, + "direction": { + "type": "string" + }, + "description": { + "$ref": "#/$defs/J2735DF_Regions_Description" + } + }, + "required": [ + "description" + ] + } + }, + "required": [ + "GeographicalPath" + ] + }, + "J2735DirectionOfUse": { + "oneOf": [ + { + "type": "object", + "properties": { + "unavailable": { + "type": "string" + } + }, + "required": [ + "unavailable" + ] + }, + { + "type": "object", + "properties": { + "forward": { + "type": "string" + } + }, + "required": [ + "forward" + ] + }, + { + "type": "object", + "properties": { + "reverse": { + "type": "string" + } + }, + "required": [ + "reverse" + ] + }, + { + "type": "object", + "properties": { + "both": { + "type": "string" + } + }, + "required": [ + "both" + ] + } + ] + }, + "J2735DF_Regions_Description": { + "oneOf": [ + { + "type": "object", + "properties": { + "path": { + "oneOf": [ + { + "type": "array", + "items": [ + { + "$ref": "#/$defs/J2735OffsetSystem" + } + ] + }, + { + "$ref": "#/$defs/J2735OffsetSystem" + } + ] + } + }, + "required": [ + "path" + ] + }, + { + "type": "object", + "properties": { + "geometry": { + "oneOf": [ + { + "type": "array", + "items": [ + { + "$ref": "#/$defs/J2735GeometricProjection" + } + ] + }, + { + "$ref": "#/$defs/J2735GeometricProjection" + } + ] + } + }, + "required": [ + "geometry" + ] + } + ] + }, + "J2735OffsetSystem": { + "type": "object", + "properties": { + "scale": { "type": "string" + }, + "offset": { + "oneOf": [ + { + "type": "object", + "properties": { + "xy": { + "$ref": "#/$defs/J2735NodeListXY" + } + }, + "required": [ + "xy" + ] + }, + { + "type": "object", + "properties": { + "ll": { + "$ref": "#/$defs/J2735NodeListLL" + } + }, + "required": [ + "ll" + ] + } + ] } }, "required": [ - "data", - "dataType" - ], - "type": "object" - } - }, - "required": [ - "metadata", - "payload" - ], - "type": "object" + "offset" + ] + }, + "J2735NodeListXY": { + "type": "object", + "properties": { + "nodes": { + "type": "object", + "properties": { + "NodeXY": { + "type": "array", + "items": [ + { + "$ref": "#/$defs/J2735NodeXY" + } + ] + } + }, + "required": [ + "NodeXY" + ] + } + }, + "required": [ + "nodes" + ] + }, + "J2735NodeListLL": { + "type": "object", + "properties": { + "nodes": { + "type": "object", + "properties": { + "NodeLL": { + "type": "array", + "items": [ + { + "$ref": "#/$defs/J2735NodeLL" + } + ] + } + }, + "required": [ + "NodeLL" + ] + } + }, + "required": [ + "nodes" + ] + }, + "J2735NodeXY": { + "type": "object", + "properties": { + "delta": { + "oneOf": [ + { + "type": "object", + "properties": { + "node-XY1": { + "$ref": "#/$defs/J2735NodeXYDelta" + } + }, + "required": [ + "node-XY1" + ] + }, + { + "type": "object", + "properties": { + "node-XY2": { + "$ref": "#/$defs/J2735NodeXYDelta" + } + }, + "required": [ + "node-XY2" + ] + }, + { + "type": "object", + "properties": { + "node-XY3": { + "$ref": "#/$defs/J2735NodeXYDelta" + } + }, + "required": [ + "node-XY3" + ] + }, + { + "type": "object", + "properties": { + "node-XY4": { + "$ref": "#/$defs/J2735NodeXYDelta" + } + }, + "required": [ + "node-XY4" + ] + }, + { + "type": "object", + "properties": { + "node-XY5": { + "$ref": "#/$defs/J2735NodeXYDelta" + } + }, + "required": [ + "node-XY5" + ] + }, + { + "type": "object", + "properties": { + "node-XY6": { + "$ref": "#/$defs/J2735NodeXYDelta" + } + }, + "required": [ + "node-XY6" + ] + }, + { + "type": "object", + "properties": { + "node-LatLon": { + "$ref": "#/$defs/J2735NodeLLDelta" + } + }, + "required": [ + "node-LatLon" + ] + } + ] + } + }, + "required": [ + "delta" + ] + }, + "J2735NodeLL": { + "type": "object", + "properties": { + "delta": { + "oneOf": [ + { + "type": "object", + "properties": { + "node-LL1": { + "$ref": "#/$defs/J2735NodeLLDelta" + } + }, + "required": [ + "node-LL1" + ] + }, + { + "type": "object", + "properties": { + "node-LL2": { + "$ref": "#/$defs/J2735NodeLLDelta" + } + }, + "required": [ + "node-LL2" + ] + }, + { + "type": "object", + "properties": { + "node-LL3": { + "$ref": "#/$defs/J2735NodeLLDelta" + } + }, + "required": [ + "node-LL3" + ] + }, + { + "type": "object", + "properties": { + "node-LL4": { + "$ref": "#/$defs/J2735NodeLLDelta" + } + }, + "required": [ + "node-LL4" + ] + }, + { + "type": "object", + "properties": { + "node-LL5": { + "$ref": "#/$defs/J2735NodeLLDelta" + } + }, + "required": [ + "node-LL5" + ] + }, + { + "type": "object", + "properties": { + "node-LL6": { + "$ref": "#/$defs/J2735NodeLLDelta" + } + }, + "required": [ + "node-LL6" + ] + }, + { + "type": "object", + "properties": { + "node-LatLon": { + "$ref": "#/$defs/J2735NodeLLDelta" + } + }, + "required": [ + "node-LatLon" + ] + } + ] + } + }, + "required": [ + "delta" + ] + }, + "J2735NodeXYDelta": { + "type": "object", + "properties": { + "x": { + "type": "string" + }, + "y": { + "type": "string" + } + }, + "required": [ + "x", + "y" + ] + }, + "J2735NodeLLDelta": { + "type": "object", + "properties": { + "lat": { + "type": "string" + }, + "lon": { + "type": "string" + } + }, + "required": [ + "lon", + "lat" + ] + }, + "J2735GeometricProjection": { + "type": "object", + "properties": { + "direction": { + "type": "string" + }, + "extent": { + "type": "string" + }, + "laneWidth": { + "type": "string" + }, + "circle": { + "type": "object", + "properties": { + "center": { + "$ref": "#/$defs/J2735Position3D" + }, + "radius": { + "type": "string" + }, + "units": { + "type": "string" + } + }, + "required": [ + "center", + "radius", + "units" + ] + } + }, + "required": [ + "direction", + "circle" + ] + }, + "J2735DF_Content": { + "oneOf": [ + { + "type": "object", + "properties": { + "advisory": { + "$ref": "#/$defs/J2735DF_ContentSequence" + } + }, + "required": [ + "advisory" + ] + }, + { + "type": "object", + "properties": { + "workZone": { + "$ref": "#/$defs/J2735DF_ContentSequence" + } + }, + "required": [ + "workZone" + ] + }, + { + "type": "object", + "properties": { + "genericSign": { + "$ref": "#/$defs/J2735DF_ContentSequence" + } + }, + "required": [ + "genericSign" + ] + }, + { + "type": "object", + "properties": { + "speedLimit": { + "$ref": "#/$defs/J2735DF_ContentSequence" + } + }, + "required": [ + "speedLimit" + ] + }, + { + "type": "object", + "properties": { + "exitService": { + "$ref": "#/$defs/J2735DF_ContentSequence" + } + }, + "required": [ + "exitService" + ] + } + ] + }, + "J2735DF_ContentSequence": { + "oneOf": [ + { + "type": "object", + "properties": { + "SEQUENCE": { + "type": "array", + "items": [ + { + "$ref": "#/$defs/J2735DF_ContentSequenceItem" + } + ] + } + }, + "required": [ + "SEQUENCE" + ] + }, + { + "type": "object", + "properties": { + "SEQUENCE": { + "$ref": "#/$defs/J2735DF_ContentSequenceItem" + } + }, + "required": [ + "SEQUENCE" + ] + } + ] + }, + "J2735DF_ContentSequenceItem": { + "type": "object", + "properties": { + "item": { + "type": "object", + "properties": { + "itis": { + "type": "string" + } + }, + "required": [ + "itis" + ] + } + }, + "required": [ + "item" + ] + }, + "J2735Position3D": { + "type": "object", + "properties": { + "lat": { + "type": "string" + }, + "long": { + "type": "string" + }, + "elevation": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "lat", + "long" + ] + }, + "J2735MUTCDCode": { + "oneOf": [ + { + "type": "object", + "properties": { + "none": { + "type": "string" + } + }, + "required": [ + "none" + ] + }, + { + "type": "object", + "properties": { + "regulatory": { + "type": "string" + } + }, + "required": [ + "regulatory" + ] + }, + { + "type": "object", + "properties": { + "warning": { + "type": "string" + } + }, + "required": [ + "warning" + ] + }, + { + "type": "object", + "properties": { + "maintenance": { + "type": "string" + } + }, + "required": [ + "maintenance" + ] + }, + { + "type": "object", + "properties": { + "motoristService": { + "type": "string" + } + }, + "required": [ + "motoristService" + ] + }, + { + "type": "object", + "properties": { + "guide": { + "type": "string" + } + }, + "required": [ + "guide" + ] + }, + { + "type": "object", + "properties": { + "rec": { + "type": "string" + } + }, + "required": [ + "rec" + ] + } + ] + }, + "J2735RoadSegmentReferenceID": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "region": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "BooleanObject": { + "oneOf": [ + { + "type": "object", + "properties": { + "true": { + "type": "string" + } + }, + "required": [ + "true" + ] + }, + { + "type": "object", + "properties": { + "false": { + "type": "string" + } + }, + "required": [ + "false" + ] + } + ] + } + } } \ No newline at end of file