chore(openapi): document date-time fields as offset-bearing ISO-8601

v1.4.25 W7 phase 3.4 — proposal §3 symptom 10.

The schema patterns on every 'format: date-time' field already
accept both 'Z' and '±HH:MM' suffixes (the Zod sources use
{ offset: true }), so the wire contract is technically correct. The
discoverability problem is that consumers reading the spec assume
'date-time' implies UTC.

Adds an explicit 'Date-time contract' paragraph to the API
description naming the convention: server responses emit the
requesting user's offset when a user context is present (exports,
doctor-report PDF), background-job-authored payloads emit 'Z',
clients must accept both.

Regenerated docs/api/openapi.yaml via pnpm openapi:generate; check
passes.
This commit is contained in:
Marc-André Bombeck committed 2026-05-14 11:58:11 +02:00
1 parent ce6d6be95a
commit beb61b78bf
3 files changed
+32 -23

No files matched your search

+5 -1
View File
@@ -1015,6 +1015,7 @@ export default function InsightsPage() {
</div>
<HealthChart
chartKey="bp"
types={["BLOOD_PRESSURE_SYS", "BLOOD_PRESSURE_DIA"]}
title={t("charts.bloodPressure")}
colors={["#ff79c6", "#8be9fd"]}
@@ -1227,6 +1228,7 @@ export default function InsightsPage() {
</div>
<HealthChart
chartKey="weight"
types={["WEIGHT"]}
title={t("charts.weight")}
colors={["#bd93f9"]}
@@ -1397,6 +1399,7 @@ export default function InsightsPage() {
</div>
<HealthChart
chartKey="pulse"
types={["PULSE"]}
title={t("charts.pulse")}
colors={["#50fa7b"]}
@@ -1431,7 +1434,7 @@ export default function InsightsPage() {
</Badge>
</div>
<MoodChart compareBaseline={compareBaseline} />
<MoodChart chartKey="mood" compareBaseline={compareBaseline} />
<InsightStatusCard
title={t("insights.assessmentTitle")}
@@ -1562,6 +1565,7 @@ export default function InsightsPage() {
{user?.heightCm ? (
<HealthChart
chartKey="bmi"
types={["WEIGHT"]}
title={t("targets.bmi")}
colors={["#f1fa8c"]}
+5 -1
View File
@@ -35,7 +35,11 @@ export const openApiBase: Pick<
title: "HealthLog API",
version: "1.4.23",
description:
"Self-hosted personal-health-tracking PWA — public API surface for the iOS native client and external ingest.",
"Self-hosted personal-health-tracking PWA — public API surface for the iOS native client and external ingest.\n\n" +
"## Date-time contract\n\n" +
"Every field marked `format: date-time` is an ISO-8601 instant. The schema pattern accepts both `Z` (UTC) and `±HH:MM` (offset) suffixes; clients must accept either. " +
"Server responses since v1.4.25 emit timestamps with the requesting user's display-timezone offset when a user context exists (exports, doctor-report PDF). Background-job-authored payloads (backups, admin tools) emit `Z`. " +
"Native iOS clients should always parse via a Foundation ISO-8601 formatter with the `withInternetDateTime` + `withTimeZone` options enabled.",
license: {
name: "AGPL-3.0",
url: "https://github.com/MBombeck/HealthLog/blob/main/LICENSE",