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
JsonSerializer allows nulls in arrays of non-nullable T #101659
Comments
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis |
I believe this is covered under #100144. |
Ah, my bad, I tried searching for issues and could not find an appropriate one. Thanks. |
Note that non-nullable element types are out of scope for #100144, due to restrictions in their run-time representation. |
I see. Could there be a possibility of that changing in the future? (perhaps for source-generated serialization only?) |
Unlikely. The serialization infrastructure is shared between reflection and source gen and both key they contracts on |
Description
It appears that
System.Text.Json
treats the following objects in the same way:Reproduction Steps
Expected behavior
Serializer throws an exception
Actual behavior
The "unreachable" exception is thrown
Regression?
No
Known Workarounds
Using custom converter
Configuration
.NET 8.0.3
Other information
No response
The text was updated successfully, but these errors were encountered: