[STJ] Add support for nullable reference annotations on properties#102499
Merged
eiriktsarpalis merged 19 commits intodotnet:mainfrom May 22, 2024
Merged
[STJ] Add support for nullable reference annotations on properties#102499eiriktsarpalis merged 19 commits intodotnet:mainfrom
eiriktsarpalis merged 19 commits intodotnet:mainfrom
Conversation
|
Note regarding the |
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis |
eiriktsarpalis
commented
May 21, 2024
eiriktsarpalis
commented
May 21, 2024
jozkee
reviewed
May 21, 2024
src/libraries/System.Private.CoreLib/src/System/Reflection/NullabilityInfo.cs
Outdated
Show resolved
Hide resolved
eiriktsarpalis
commented
May 21, 2024
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfo.cs
Outdated
Show resolved
Hide resolved
eiriktsarpalis
commented
May 21, 2024
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfo.cs
Outdated
Show resolved
Hide resolved
eiriktsarpalis
commented
May 21, 2024
...libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfo.Cache.cs
Show resolved
Hide resolved
eiriktsarpalis
commented
May 21, 2024
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfo.cs
Show resolved
Hide resolved
jozkee
reviewed
May 21, 2024
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
jozkee
reviewed
May 21, 2024
This was referenced May 22, 2024
jozkee
reviewed
May 22, 2024
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
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ú <dacantu@microsoft.com>
…neration.Tests/System.Text.Json.SourceGeneration.Tests.targets Co-authored-by: David Cantú <dacantu@microsoft.com>
jozkee
reviewed
May 22, 2024
jozkee
reviewed
May 22, 2024
...Text.Json/src/System/Text/Json/Serialization/Metadata/DefaultJsonTypeInfoResolver.Helpers.cs
Outdated
Show resolved
Hide resolved
jozkee
approved these changes
May 22, 2024
Member
jozkee
left a comment
There was a problem hiding this comment.
LGTM, thanks a lot for taking over.
steveharter
pushed a commit
to steveharter/runtime
that referenced
this pull request
May 28, 2024
…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ú <dacantu@microsoft.com> * Update src/libraries/System.Private.CoreLib/src/System/Reflection/NullabilityInfoContext.cs Co-authored-by: David Cantú <dacantu@microsoft.com> * Update src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs Co-authored-by: David Cantú <dacantu@microsoft.com> * Rename more ignoreNullableAnnotations stragglers. * Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs Co-authored-by: David Cantú <dacantu@microsoft.com> * 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ú <dacantu@microsoft.com> * 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ú <dacantu@microsoft.com>
Member
|
@eiriktsarpalis this is breaking the ASP.NET E2E tests as we ingested it for preview5. Here are the logs |
Ruihan-Yin
pushed a commit
to Ruihan-Yin/runtime
that referenced
this pull request
May 30, 2024
…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ú <dacantu@microsoft.com> * Update src/libraries/System.Private.CoreLib/src/System/Reflection/NullabilityInfoContext.cs Co-authored-by: David Cantú <dacantu@microsoft.com> * Update src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs Co-authored-by: David Cantú <dacantu@microsoft.com> * Rename more ignoreNullableAnnotations stragglers. * Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs Co-authored-by: David Cantú <dacantu@microsoft.com> * 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ú <dacantu@microsoft.com> * 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ú <dacantu@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JsonParameterInfometadata such that properties and constructor parameters are associated early in the contract resolution process and annotations of both feed into theJsonPropertyInfo.DisallowNullReadsproperty.Fix #100144