-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add support for nullable primitive lists #2042
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
skarimo
added
the
changelog/Added
Added features results into a minor version bump
label
Jun 9, 2023
skarimo
force-pushed
the
sherz/nullable-primitive-list
branch
from
June 9, 2023 18:54
921e0b0
to
6628b08
Compare
skarimo
force-pushed
the
sherz/nullable-primitive-list
branch
from
June 9, 2023 18:56
6628b08
to
3e3e70d
Compare
therve
reviewed
Jun 13, 2023
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.
This looks good to me, but it's a breaking change so it should be marked as such. Can you also edit the PR description to explain the change a bit and what do to? This is our best way to document a migration, as it's linked in the changelog.
therve
added
changelog/Fixed
Fixed features results into a bug fix version bump
backward-incompatible
Warns for backward incompatible changes
and removed
changelog/Added
Added features results into a minor version bump
labels
Jun 13, 2023
therve
approved these changes
Jun 16, 2023
github-actions bot
pushed a commit
that referenced
this pull request
Jun 16, 2023
* add support for nullable primitive containers --------- Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com> 8160536
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backward-incompatible
Warns for backward incompatible changes
changelog/Fixed
Fixed features results into a bug fix version bump
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Previously, the sdk did not support nullable arrays. With introduction of new nullable properties and promotion of old properties to nullable, we now have use cases where we need to differentiate between explicit null vs zero value.
Changes in the PR
This PR introduces a new wrapper around nullable primitive lists
NullableList[T any]
. This is a backward incompatible change but one that is necessary to add support for explicit null lists.A previously nullable list with type
[]string
will now be converted todatadog.NullableList[string]
. There is a helper functionNewNullableList
. As an example:Would now be configured as: