Skip to content

Honor explicit DefaultValueHandling for bools - #1847

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

Honor explicit DefaultValueHandling for bools#1847
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
This was referenced Aug 28, 2026
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