Uh oh!
There was an error while loading. Please reload this page.
SrcGen fast-path serialization for nullable structs (#59719) - #60366
SrcGen fast-path serialization for nullable structs (#59719)#60366SkiFoD wants to merge 1 commit into
Conversation
ghost
commented
Oct 13, 2021
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
ghost
commented
Oct 13, 2021
Tagging subscribers to this area: @dotnet/area-system-text-json Issue Detailsnull
|
eiriktsarpalis
commented
Oct 15, 2021
Fixes #59719. |
layomia
commented
Nov 17, 2021
Thanks for the PR and effort here @SkiFoD. Upon further investigation, it turns out that these changes are not needed because fast-path methods for underlying nullable types are already being invoked when serializing parent nullable types. The pattern for this fast-path execution remains the same: PersonStruct?person=new(){FirstName="Jane",LastName="Doe"};stringjson=JsonSerializer.Serialize(person,someContext.NullablePersonStruct);// Fast-path for person struct is invoked.I added tests verifying this behavior here - #61711. |
No description provided.