Skip to content

Conversation

@jamietanna
Copy link
Member

As noted in #2031, this was a regression.

To fix this, we'll add some additional template helpers to consolidate and clarify this.

Closes #2031.

jamietanna and others added 3 commits November 1, 2025 11:58
As part of #2031, we need to correct a subtle breakage in #1981, where
we would not correctly perform the nil check on arrays, breaking
marshalling functionality.

As a first step, we add a new helper method to inform as to whether the
zero value of a Property could be `nil`, and therefore needs a `nil`
check.
As part of #2031, we need to correct a subtle breakage in #1981, where
we would not correctly perform the nil check on arrays, breaking
marshalling functionality.

As a first step, we add a new helper method to be used to validate
whether a `nil` check is required on a given type, which is used for
either types with a zero value of `nil`, or where we have an optional
pointer set.
As part of #2031, we need to correct a subtle breakage in #1981, where
we would not correctly perform the nil check on arrays, breaking
marshalling functionality.

To do this we can modify our templates to call the newly added
`RequiresNilCheck` when performing nil checks

Closes #2031.

Co-authored-by: Matthew Gabeler-Lee <[email protected]>
@jamietanna jamietanna added the bug Something isn't working label Nov 1, 2025
@jamietanna jamietanna marked this pull request as ready for review November 1, 2025 11:58
@jamietanna jamietanna requested a review from a team as a code owner November 1, 2025 11:58
@jamietanna jamietanna merged commit c4ba545 into main Nov 1, 2025
47 checks passed
@jamietanna jamietanna deleted the iss-2031 branch November 1, 2025 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

regression in v2.5.0: marshalling optional array property emits null instead of omitting the array

2 participants