Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TIM schema #109

Merged
merged 10 commits into from
Nov 4, 2024
Merged

Update TIM schema #109

merged 10 commits into from
Nov 4, 2024

Conversation

drewjj
Copy link
Collaborator

@drewjj drewjj commented Oct 18, 2024

PR Details

Description

This pull request updates the TIM schema to include all supported ODE fields. This maintains the ASN1 being an optional field.

Related Issue

N/A

Motivation and Context

The previous TIM schema was only partially supporting the possible ODE fields of a TIM. This caused TIMs that were perfectly acceptable to fail validation checks where schema validation was implemented.

How Has This Been Tested?

This has been tested with live TIM data generated in the CDOT environment based off WZDx data.

Types of changes

  • Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • I have added any new packages to the sonar-scanner.properties file
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
    ODE Contributing Guide
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

@payneBrandon payneBrandon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@Michael7371
Copy link

@drewjj it looks like TMC generated TIM messages fail the schema check:
image

Here is the message that gets output on the topic.OdeTimJson topic from a TIM message created from the ODE's /tim POST REST endpoint:

{
	"metadata": {
		"request": {
			"ode": {
				"verb": "POST",
				"version": "3"
			},
			"rsus": {
				"rsus": {
					"rsuTarget": "10.145.2.60",
					"rsuUsername": "rwUser",
					"snmpProtocol": "NTCIP1218",
					"rsuRetries": "3",
					"rsuTimeout": "5000",
					"rsuPassword": "*",
					"rsuIndex": "21"
				}
			},
			"snmp": {
				"mode": "1",
				"deliverystop": "2024-09-30T10:00:00.0Z",
				"rsuid": "83",
				"deliverystart": "2024-09-25T10:00:00.0Z",
				"enable": "1",
				"channel": "183",
				"msgid": "31",
				"interval": "1000",
				"status": "4"
			}
		},
		"recordGeneratedBy": "TMC",
		"schemaVersion": "7",
		"payloadType": "us.dot.its.jpo.ode.model.OdeTimPayload",
		"odePacketID": "8D442EF0020C6B1A01",
		"serialId": {
			"recordId": "0",
			"serialNumber": "26",
			"streamId": "af334b18-487d-489c-9dff-fcdc99d7c293",
			"bundleSize": "1",
			"bundleId": "26"
		},
		"sanitized": "false",
		"recordGeneratedAt": "2024-10-22T21:01:28.000Z",
		"maxDurationTime": "8640",
		"odeTimStartDateTime": "2024-10-22T21:01:28.000Z",
		"odeReceivedAt": "2024-10-22T21:01:28.056Z"
	},
	"payload": {
		"data": {
			"MessageFrame": {
				"messageId": "31",
				"value": {
					"TravelerInformation": {
						"timeStamp": "426061",
						"packetID": "8D442EF0020C6B1A01",
						"urlB": "null",
						"dataFrames": {
							"TravelerDataFrame": {
								"durationTime": "8640",
								"regions": {
									"GeographicalPath": {
										"closedPath": {
											"false": ""
										},
										"anchor": {
											"lat": "389565870",
											"long": "-771491972"
										},
										"name": "Snow Turner Q1",
										"laneWidth": "5000",
										"directionality": {
											"both": ""
										},
										"description": {
											"path": {
												"offset": {
													"ll": {
														"nodes": {
															"NodeLL": [
																{
																	"delta": {
																		"node-LL1": {
																			"lon": "-906",
																			"lat": "-227"
																		}
																	}
																},
																{
																	"delta": {
																		"node-LL2": {
																			"lon": "-7088",
																			"lat": "-1334"
																		}
																	}
																},
																{
																	"delta": {
																		"node-LL2": {
																			"lon": "-5907",
																			"lat": "-1186"
																		}
																	}
																},
																{
																	"delta": {
																		"node-LL2": {
																			"lon": "-6104",
																			"lat": "-1631"
																		}
																	}
																},
																{
																	"delta": {
																		"node-LL2": {
																			"lon": "-6695",
																			"lat": "-2076"
																		}
																	}
																},
																{
																	"delta": {
																		"node-LL2": {
																			"lon": "-5316",
																			"lat": "-2372"
																		}
																	}
																},
																{
																	"delta": {
																		"node-LL2": {
																			"lon": "-6301",
																			"lat": "-2817"
																		}
																	}
																},
																{
																	"delta": {
																		"node-LL2": {
																			"lon": "-4726",
																			"lat": "-2372"
																		}
																	}
																},
																{
																	"delta": {
																		"node-LL2": {
																			"lon": "-4529",
																			"lat": "-2965"
																		}
																	}
																},
																{
																	"delta": {
																		"node-LL2": {
																			"lon": "-4135",
																			"lat": "-2817"
																		}
																	}
																}
															]
														}
													}
												},
												"scale": "0"
											}
										},
										"id": {
											"id": "0",
											"region": "0"
										},
										"direction": "1111000011110000"
									}
								},
								"startYear": "2024",
								"notUsed2": "0",
								"msgId": {
									"roadSignID": {
										"viewAngle": "1111111111111111",
										"mutcdCode": {
											"warning": ""
										},
										"position": {
											"lat": "389565870",
											"long": "-771491972"
										}
									}
								},
								"notUsed3": "0",
								"notUsed1": "0",
								"priority": "5",
								"content": {
									"advisory": {
										"SEQUENCE": {
											"item": {
												"itis": "4868"
											}
										}
									}
								},
								"url": "null",
								"notUsed": "0",
								"frameType": {
									"advisory": ""
								},
								"startTime": "426061"
							}
						},
						"msgCnt": "2"
					}
				}
			}
		},
		"dataType": "TravelerInformation"
	}
}

Copy link

@Michael7371 Michael7371 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we might need to open up the schema a bit to allow for TIM's created from the REST endpoint to pass validation

Copy link
Member

@dmccoystephenson dmccoystephenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any breaking changes that would require an update to the major version of the application?

@drewjj
Copy link
Collaborator Author

drewjj commented Oct 25, 2024

Are there any breaking changes that would require an update to the major version of the application?

Nothing breaking here. Just a schema update intended to represent what the ODE currently outputs.

@drewjj
Copy link
Collaborator Author

drewjj commented Oct 25, 2024

Looks like we might need to open up the schema a bit to allow for TIM's created from the REST endpoint to pass validation

I am told this may not be a factor anymore for the topics we intend for this to represent.

Copy link

@Michael7371 Michael7371 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Member

@dmccoystephenson dmccoystephenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@drewjj drewjj merged commit 787c40e into dev Nov 4, 2024
2 of 4 checks passed
@drewjj drewjj deleted the tim-schema-update branch November 4, 2024 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants