From 0afd217f9fe2b528eebea92298a2dc3a73a2553e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 26 Jul 2026 06:11:43 +0200 Subject: [PATCH] docs(api): say which profile fields an empty string actually clears The description promised that null or an empty string clears any field. An empty string clears the free-text ones and now gender, but email is validated as an address and 422s on it, and the display preferences are not clearable at all. Name them rather than let a client find out. --- docs/api/openapi.yaml | 7 +++++-- src/lib/openapi/routes/profile.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/api/openapi.yaml b/docs/api/openapi.yaml index 75d1d22bc..b87fd95c0 100644 --- a/docs/api/openapi.yaml +++ b/docs/api/openapi.yaml @@ -13336,8 +13336,11 @@ components: anyOf: - type: string - type: "null" - description: Partial profile update. Every field is optional; an omitted field is left untouched, an explicit null (or - empty string) clears it. `userId` is never accepted — it is narrowed from the session/token. + description: Partial profile update. Every field is optional and an omitted field is left untouched. An explicit null + clears any nullable field; an empty string also clears `displayName`, `dateOfBirth`, `gender`, `fullName`, + `insurerName`, `insuranceNumber` and `insurerIkNumber`. `email` is not among them — it is validated as an + address, so send null to clear it. `locale`, `timezone`, `timeFormat` and `dateFormat` are not clearable. + `userId` is never accepted — it is narrowed from the session/token. NotificationPrefsPatchRequest: type: object properties: diff --git a/src/lib/openapi/routes/profile.ts b/src/lib/openapi/routes/profile.ts index 0b9c2b671..a75fe9a11 100644 --- a/src/lib/openapi/routes/profile.ts +++ b/src/lib/openapi/routes/profile.ts @@ -252,7 +252,7 @@ const profileUpdateRequest = z .meta({ id: "ProfileUpdateRequest", description: - "Partial profile update. Every field is optional; an omitted field is left untouched, an explicit null (or empty string) clears it. `userId` is never accepted — it is narrowed from the session/token.", + "Partial profile update. Every field is optional and an omitted field is left untouched. An explicit null clears any nullable field; an empty string also clears `displayName`, `dateOfBirth`, `gender`, `fullName`, `insurerName`, `insuranceNumber` and `insurerIkNumber`. `email` is not among them — it is validated as an address, so send null to clear it. `locale`, `timezone`, `timeFormat` and `dateFormat` are not clearable. `userId` is never accepted — it is narrowed from the session/token.", }); const profileResponse = z