You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Aren't the warnings correct in this case, because System.Text.Json ignores the non-nullability?
There's robust logic in STJ to handle null on serialization and deserialization, including to support features like ignoring null on serialization. Because of this we don't leak NullReferenceException and related bugs. However, it would be most correct to accept T? on deserialization and return T? on serialization, since property values could indeed be null. Unfortunately, I couldn't find a way to express this in a prototype to have the correct semantics, due error CS0453 given this code.
In the fix for the issue #57178, I left the parameter type as Func<object, T>? getter and just banged the return value of the getter call in the generated code.
I think it's an issue with the nullability annotations on the getters and setters for JsonMetadataServices.CreatePropertyInfo
These should be:
etc
The text was updated successfully, but these errors were encountered: