Skip to content

Honor explicit DefaultValueHandling for bools - #1847

Merged
SimonCropp merged 1 commit into
mainfrom
default-value-handling-bools
Aug 17, 2026
Merged

SimonCropp merged 1 commit into
mainfrom
default-value-handling-bools

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

bool members were unconditionally given DefaultValueHandling.Include at the property level, which overrides the global setting. So an explicit AddExtraSettings(_ => _.DefaultValueHandling = Ignore) could never drop false.

Track whether an extra setting explicitly assigns DefaultValueHandling (using null as a sentinel, since the property is nullable) and skip the bool special case when it has. Default behavior is unchanged.

Fixes #1660

bool members were unconditionally given DefaultValueHandling.Include at the
property level, which overrides the global setting. So an explicit
AddExtraSettings(_ => _.DefaultValueHandling = Ignore) could never drop false.

Track whether an extra setting explicitly assigns DefaultValueHandling (using
null as a sentinel, since the property is nullable) and skip the bool special
case when it has. Default behavior is unchanged.

Fixes #1660
@SimonCropp SimonCropp added this to the 32.0.0 milestone Aug 15, 2026
@SimonCropp
SimonCropp merged commit a8551f1 into main Aug 17, 2026
7 checks passed
@SimonCropp
SimonCropp deleted the default-value-handling-bools branch August 17, 2026 12:16
This was referenced Aug 26, 2026
samtrion added a commit to dailydevops/pulse that referenced this pull request Sep 28, 2026
Verify 32 omits boolean members with default value false (VerifyTests/Verify#1847). Only IsSuppressed, IsWarningAsError, IsInMetadata and IsInSource entries with value false were removed; no content change.
samtrion added a commit to dailydevops/pulse that referenced this pull request Sep 28, 2026
* chore(deps): update dependency verify.tunit to v33

* build(deps): declare Verify OpenSource sponsorship exemption

Verify v33 enforces the Open Source Maintenance Fee at build time and fails with SC021 without a declaration. Declare the OpenSource exemption (valid until 2027-09) in every test project that references Verify.TUnit.

* test(sourcegeneration): update Verify snapshots for v33 serialization

Verify 32 omits boolean members with default value false (VerifyTests/Verify#1847). Only IsSuppressed, IsWarningAsError, IsInMetadata and IsInSource entries with value false were removed; no content change.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Martin Stühmer <martin@stuehmer.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Booleans with Default Value are not Ignored

1 participant