-
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
[release/6.0] Throw on unsupported types in src gen #58983
Conversation
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. |
Tagging subscribers to this area: @eiriktsarpalis, @layomia Issue DetailsBackport of #58775 to release/6.0 /cc @eiriktsarpalis @steveharter Customer ImpactTestingRisk
|
cc @danmoseley |
@@ -341,7 +341,7 @@ public string PropertyPath() | |||
static void AppendStackFrame(StringBuilder sb, ref WriteStackFrame frame) | |||
{ | |||
// Append the property name. | |||
string? propertyName = frame.DeclaredJsonPropertyInfo?.MemberInfo?.Name; | |||
string? propertyName = frame.DeclaredJsonPropertyInfo?.ClrName; |
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.
is this a functional change for the non-generator scenario?
Approved. Fixes fairly mainstream scenario in this new feature. Code change essentially limited to generators. |
If we consider future fixes to the generator, it would reduce risk if it was possible to make zero changes to the non generator codepaths. |
Backport of #58775 to release/6.0
/cc @eiriktsarpalis @steveharter
Customer Impact
Types unsupported by sourcegen are currently being silently serialized (typically as
{}
). This can result in invalid data accidentally being returned in API responses or written to databases.Testing
Tests have been added affirming the new throwing behavior.
Risk
Low. While this is adding more code to the sourcegen implementation, these additions are relatively small and straightforward.