You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+57-1Lines changed: 57 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,4 +17,60 @@ docker compose up -d
17
17
18
18
Notes:
19
19
- docker-compose.yml now reads credentials from environment variables. Docker Compose automatically loads variables from a .env file in the project root.
20
-
- It's not recommended to commit real secrets (like POSTGRES_PASSWORD) to GitHub. Use .env locally and secret managers or CI/CD secrets in production.
20
+
- It's not recommended to commit real secrets (like POSTGRES_PASSWORD) to GitHub. Use .env locally and secret managers or CI/CD secrets in production.
21
+
22
+
## Telematics Event Schema
23
+
24
+
A canonical JSON Schema defines the message contract for events published to the `telematics.events` topic.
- Always set `schema_version` to the schema version you targeted (e.g., `1.0.0`).
58
+
- Generate stable UUIDs for `event_id` and a stable vehicle identifier for `vehicle_id`.
59
+
- Use UTC epoch milliseconds in `ts`.
60
+
- Provide `position.lat` and `position.lon`; other fields are optional but recommended when available.
61
+
62
+
### Evolving the schema
63
+
- Backward-compatible changes in 1.x: add optional properties, extend enums, loosen minima/maxima where safe.
64
+
- Breaking changes: bump major and publish under a new `$id` path (e.g., `.../2-0-0`) and update `schema_version` expectations.
65
+
66
+
67
+
## Unit consistency
68
+
69
+
- We standardize on meters-per-second for speed inside the pipeline. The canonical field is `speed_mps` (m/s). If your API/UI needs kilometers-per-hour, convert at the edges (kph = mps * 3.6).
70
+
- If you previously used `speed_kph` in docs or prototypes, consider it deprecated in favor of `speed_mps`.
71
+
72
+
## Forward compatibility stance
73
+
74
+
- The schema is intentionally strict at the root: `additionalProperties: false`. Unknown top-level fields are rejected to prevent silent contract drift and to keep consumers predictable.
75
+
- If you later need looser forward-compatibility (accept unknown fields while validating the known required set), you can switch to JSON Schema 2020-12's `unevaluatedProperties: true` at the root. Keep `required` minimal to avoid false negatives.
76
+
- Nullability guidance: prefer omitting fields when a value is unknown rather than sending `null`. If you must send nulls from some sources, we can broaden specific fields to allow unions like `["boolean","null"]` or `["number","null"]` in a backward-compatible minor version.
0 commit comments