mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 13:22:14 +00:00
fix(openapi): admit the bare-instant route samples older tracks carry
A track stored before the object form holds one ISO instant per point, and the detail answers it as stored. The route-sample declaration accepts both forms.
This commit is contained in:
1 parent
32dec72564
commit
38baafcdd7
2 files changed
+28
-21
No files matched your search
@@ -187,15 +187,18 @@ const workoutRouteGeometry = z
|
||||
geometry: z.unknown(),
|
||||
sampleTimestamps: z
|
||||
.array(
|
||||
z.object({
|
||||
t: isoDateTime(),
|
||||
speedMs: z.number().optional(),
|
||||
hr: z.number().int().optional(),
|
||||
}),
|
||||
z.union([
|
||||
isoDateTime(),
|
||||
z.object({
|
||||
t: isoDateTime(),
|
||||
speedMs: z.number().optional(),
|
||||
hr: z.number().int().optional(),
|
||||
}),
|
||||
]),
|
||||
)
|
||||
.nullable()
|
||||
.describe(
|
||||
"One entry per geometry point, as the track was ingested: its instant and, where recorded, speed (m/s) and heart rate (bpm).",
|
||||
"One entry per geometry point, as the track was stored: a bare instant, or (from the workout batch and the Apple Health export) an object with its instant and, where recorded, speed (m/s) and heart rate (bpm).",
|
||||
),
|
||||
})
|
||||
.meta({ id: "WorkoutRouteGeometry" });
|
||||
|
||||
Reference in new issue
Block a user