-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[STJ] Add support for nullable reference annotations on properties #102499
Conversation
Note regarding the
|
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis |
src/libraries/System.Private.CoreLib/src/System/Reflection/NullabilityInfo.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfo.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfo.cs
Outdated
Show resolved
Hide resolved
...libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfo.Cache.cs
Show resolved
Hide resolved
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfo.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Reflection/NullabilityInfoContext.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Reflection/NullabilityInfoContext.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Reflection/NullabilityInfoContext.cs
Show resolved
Hide resolved
src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.ExceptionMessages.cs
Show resolved
Hide resolved
src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonParameterInfo.cs
Outdated
Show resolved
Hide resolved
...Text.Json/src/System/Text/Json/Serialization/Metadata/DefaultJsonTypeInfoResolver.Helpers.cs
Outdated
Show resolved
Hide resolved
...Text.Json/src/System/Text/Json/Serialization/Metadata/DefaultJsonTypeInfoResolver.Helpers.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs
Show resolved
Hide resolved
...ests/System.Text.Json.SourceGeneration.Tests/System.Text.Json.SourceGeneration.Tests.targets
Outdated
Show resolved
Hide resolved
…ion/JsonSerializerOptions.cs Co-authored-by: David Cantú <[email protected]>
…neration.Tests/System.Text.Json.SourceGeneration.Tests.targets Co-authored-by: David Cantú <[email protected]>
...Text.Json/src/System/Text/Json/Serialization/Metadata/DefaultJsonTypeInfoResolver.Helpers.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.
LGTM, thanks a lot for taking over.
…otnet#102499) * Progress so far on nullability annotations * Complete implementation and make all NullableAnnotations tests pass. * Update annotations for all failing unit tests. * Update src/libraries/System.Text.Json/gen/Helpers/RoslynExtensions.cs * Update src/libraries/System.Text.Json/gen/Helpers/RoslynExtensions.cs * Address feedback * Update to latest approved API and semantics. * Update src/libraries/System.Private.CoreLib/src/System/Reflection/NullabilityInfoContext.cs Co-authored-by: David Cantú <[email protected]> * Update src/libraries/System.Private.CoreLib/src/System/Reflection/NullabilityInfoContext.cs Co-authored-by: David Cantú <[email protected]> * Update src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs Co-authored-by: David Cantú <[email protected]> * Rename more ignoreNullableAnnotations stragglers. * Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs Co-authored-by: David Cantú <[email protected]> * Remove commented out code and address feedback. * Update src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/System.Text.Json.SourceGeneration.Tests.targets Co-authored-by: David Cantú <[email protected]> * Ensure the original parameter name flows exception messages. * Extract exceptions to a throw helper in the new properties. * Extend test coverage to Nullable<T> properties. * Revert sln changes * Add second-pass review improvements. --------- Co-authored-by: David Cantú <[email protected]>
@eiriktsarpalis this is breaking the ASP.NET E2E tests as we ingested it for preview5. Here are the logs |
…otnet#102499) * Progress so far on nullability annotations * Complete implementation and make all NullableAnnotations tests pass. * Update annotations for all failing unit tests. * Update src/libraries/System.Text.Json/gen/Helpers/RoslynExtensions.cs * Update src/libraries/System.Text.Json/gen/Helpers/RoslynExtensions.cs * Address feedback * Update to latest approved API and semantics. * Update src/libraries/System.Private.CoreLib/src/System/Reflection/NullabilityInfoContext.cs Co-authored-by: David Cantú <[email protected]> * Update src/libraries/System.Private.CoreLib/src/System/Reflection/NullabilityInfoContext.cs Co-authored-by: David Cantú <[email protected]> * Update src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs Co-authored-by: David Cantú <[email protected]> * Rename more ignoreNullableAnnotations stragglers. * Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs Co-authored-by: David Cantú <[email protected]> * Remove commented out code and address feedback. * Update src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/System.Text.Json.SourceGeneration.Tests.targets Co-authored-by: David Cantú <[email protected]> * Ensure the original parameter name flows exception messages. * Extract exceptions to a throw helper in the new properties. * Extend test coverage to Nullable<T> properties. * Revert sln changes * Add second-pass review improvements. --------- Co-authored-by: David Cantú <[email protected]>
JsonParameterInfo
metadata such that properties and constructor parameters are associated early in the contract resolution process and annotations of both feed into theJsonPropertyInfo.DisallowNullReads
property.Fix #100144