-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Resolve ILLink warnings on System.Private.DataContractSerialization Part 1; Json) #50619
Conversation
Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @tannergooding, @sbomer Issue DetailsThis is part 1 of resolving the warnings for System.Private.DataContractSerialization. It is covering all of the warnings from the Json side, the next step will be to cover the Xml side. Given the space is serialization, these changes mostly are about adding RequiresUnreferencedCode to all the stack that uses reflection to serialize/deserialize objects comming from the input. cc: @eerhardt @krwq @vitek-karas
|
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. |
As said above, the initial approach was to just mark everything as RequiredUnreferencedCode given the fact that this is a serializer, but due to the nature of DataContractSerialization and the fact that you have to always create the serializer passing in the expected types in the object graph, I'm checking to see if we can actually annotate this accordingly in order to make this serializer safe. I'll try a few things and update the PR if necessary |
...ataContractSerialization/src/System/Runtime/Serialization/Json/DataContractJsonSerializer.cs
Outdated
Show resolved
Hide resolved
...DataContractSerialization/src/System/Runtime/Serialization/Json/JsonFormatWriterGenerator.cs
Outdated
Show resolved
Hide resolved
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.
Just one suggestion to factor the Delegate GetMethod("Invoke") out into a helper method. Once that is addressed this looks good.
Hello @joperezr! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
This is part 1 of resolving the warnings for System.Private.DataContractSerialization. It is covering all of the warnings from the Json side, the next step will be to cover the Xml side.
Given the space is serialization, these changes mostly are about adding RequiresUnreferencedCode to all the stack that uses reflection to serialize/deserialize objects comming from the input.
cc: @eerhardt @krwq @vitek-karas