mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
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:
1 parent
349dac3a07
commit
0afd217f9f
2 files changed
+6
-3
No files matched your search
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user