You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MIGRATION_v5_to_v6.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -206,6 +206,45 @@ New composition types: `HasOwnUser`, `HasUserCommonFields`, `HasUserPrivacyField
206
206
|`MembershipLevel`|`MembershipLevelResponse`||
207
207
|`ThreadedComment`|`ThreadedCommentResponse`||
208
208
209
+
## JSON Serialization of Optional Fields
210
+
211
+
Optional (nullable) fields in request objects are now omitted from the JSON body when not set, instead of being sent as explicit `null`. Previously, every unset field was serialized as `null`, which caused the backend to zero out existing values on partial updates.
// Backend: sets enforce_unique_usernames="no", all other fields preserved
229
+
```
230
+
231
+
Collection fields (lists, maps) are still serialized when set (including as empty `[]`/`{}`), so you can continue to send an empty list to clear a list field. Unset collection fields (`null`) are now also omitted.
232
+
233
+
**Clearing individual fields:** To explicitly remove or reset a scalar field, use the partial update endpoints with the `unset` parameter instead of sending `null`:
Partial update models (`UpdateUserPartialRequest`, `UpdateMessagePartialRequest`, `UpdateActivityPartialRequest`) support `set` (a map of fields to update) and `unset` (a list of field names to remove).
0 commit comments