Commit 28bf0c7
authored
Allow null value metadata (#1274)
## Description
We say in our
[docs](https://workos.com/docs/user-management/metadata/add-and-update-metadata)
that to remove a metadata field, you should set the value to null:
> To delete a metadata attribute, set the key to null in the metadata
object of the request body.
This works via Postman. However, in our workos-node SDK, we have the TS
interface set to only accept string values for the metadata object
([here](https://github.com/workos/workos-node/blob/16a31c8605bc91c66616e7e54dd15c0ec2b7da66/src/user-management/interfaces/update-user-options.interface.ts#L12)).
This PR adds `null` to the`UpdateUserOptions` and
`SerializedUpdateUserOptions` interfaces and adds one test.
## Documentation
No docs changes needed
## Review
I would love eyes on my test - I am pretty sure it is correctly testing
that the key is removed from the metadata since the [user
fixture](https://github.com/workos/workos-node/blob/16a31c8605bc91c66616e7e54dd15c0ec2b7da66/src/user-management/fixtures/user.json)
starts with a value there, but I'd love confirmation!1 parent 16a31c8 commit 28bf0c7
File tree
2 files changed
+15
-2
lines changed- src/user-management
- interfaces
2 files changed
+15
-2
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1322 | 1322 | | |
1323 | 1323 | | |
1324 | 1324 | | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
1325 | 1338 | | |
1326 | 1339 | | |
1327 | 1340 | | |
| |||
0 commit comments