-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable fast path serialization for types with properties using custom converters. #58291
Disable fast path serialization for types with properties using custom converters. #58291
Conversation
Tagging subscribers to this area: @eiriktsarpalis, @layomia Issue DetailsDisables fast path serialization for types with properties using custom converters. While technically it should be possible to support fast path serialization for this scenario, it would require making the Fixes #58119.
|
Should be backported to release/6.0 |
Why is this? I assume we just need to call |
property-level converters need to be instantiated and cached with property-level metadata (otherwise we would have to allocate a new converter on each serialization). We currently do cache a |
The long-term and more ideal implementation is to use the property-level converter in the fast-path, meaning add the new serializer-gen interop API (it will need to be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point, we should disable fast path and use serializer, and fix this in 7.0.
Also this PR needs to get in before the "property factory" support in #58267 is added, since fast path also needs to be disabled for properties that have factory converters.
/backport to release/6.0 |
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1195028196 |
Disables fast path serialization for types with properties using custom converters. While technically it should be possible to support fast path serialization for this scenario, it would require making the
JsonPropertyInfo.ConverterBase
property public. We should consider doing this in .NET 7.Fixes #58119.