Skip to content

Conversation

@eiriktsarpalis
Copy link
Member

Fix #96404. Should be backported to .NET 8.

@ghost ghost added the area-System.Text.Json label Jan 8, 2024
@eiriktsarpalis eiriktsarpalis self-assigned this Jan 8, 2024
@ghost
Copy link

ghost commented Jan 8, 2024

Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis
See info in area-owners.md if you want to be subscribed.

Issue Details

Fix #96404. Should be backported to .NET 8.

Author: eiriktsarpalis
Assignees: -
Labels:

area-System.Text.Json

Milestone: -

@eiriktsarpalis eiriktsarpalis requested review from krwq and tarekgh January 8, 2024 19:42
@eiriktsarpalis eiriktsarpalis added this to the 9.0.0 milestone Jan 8, 2024
IsValueType = type.IsValueType;
TypeKind = type.TypeKind;
SpecialType = type.SpecialType;
SpecialType = type.OriginalDefinition.SpecialType;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The root cause of the issue is that only the generic type definition of Nullable<T> is reported as SpecialType.System_Nullable_T resulting in the CanBeNull property in line 36 of this file to report incorrect values.

Copy link
Member

@tarekgh tarekgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@eiriktsarpalis eiriktsarpalis merged commit c31a217 into dotnet:main Jan 9, 2024
@eiriktsarpalis
Copy link
Member Author

/backport to release/8.0

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2024

Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/7460781523

tmds pushed a commit to tmds/runtime that referenced this pull request Jan 23, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fast-path source generator not honoring JsonIgnoreCondition.WhenWritingNull for Nullable<T> properties.

2 participants