-
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
Subject src-gen serializer to full number-handling test #87484
Conversation
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis |
@@ -104,8 +109,7 @@ public bool IsFastPathSupported() | |||
foreach (PropertyGenerationSpec property in PropertyGenSpecs) | |||
{ | |||
if (property.PropertyType.SpecialType is SpecialType.System_Object || | |||
property.NumberHandling is JsonNumberHandling.AllowNamedFloatingPointLiterals | |||
or JsonNumberHandling.WriteAsString || | |||
property.NumberHandling != null || |
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.
Should the same check for type infos apply here?
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.
It's causing test failures for cases where you have properties containing POCOs annotated with JsonNumberHandling.Strict
and you have global configuration specifying WriteAsString
. The fast-path method cannot pass the property-level configuration to downlevel JsonSerializer.Serialize
calls so it ends up picking up the global configuration incorrectly. Probably not a super common scenario but I figured we should be conservative for now.
Revives #78010
Fixes #58638. Fixes #79511. Contributes to #73714.