-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Discourage usage of nullable on API types #8488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: JoelSpeed The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
For example, a map field marked with `+nullable` would accept either `foo: null` or `foo: {}`. | ||
|
||
Usage of `+nullable` is discouraged as it introduces several issues: | ||
- It is not compatible with json merge patching. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(from the merge patch RFC: "Null values in the merge patch are given special meaning to indicate the removal of existing values in the target.")
|
||
Usage of `+nullable` is discouraged as it introduces several issues: | ||
- It is not compatible with json merge patching. | ||
- It is not compatible with generic protobuf. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It is not compatible with generic protobuf. | |
- Explicit `null` values are not be persisted in proto serializations |
|
||
Usage of `+nullable` is discouraged as it introduces several issues: | ||
- It is not compatible with json merge patching. | ||
- It is not compatible with generic protobuf. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's also not compatible with server-side apply, but this should be verified (I have a vague memory of SSA using null values as a signal to remove a key, which would make a null value impossible to persist via SSA)
From conversation around #8486, we realised that the usage of nullable is problematic and would like to discourage new usage of it.