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.
This commit is contained in:
Marc-André Bombeck committed 2026-07-26 17:09:03 +02:00
1 parent 349dac3a07
commit 0afd217f9f
2 files changed
+6 -3

No files matched your search

+5 -2
View File
@@ -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:
+1 -1
View File
@@ -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