-
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
fix JsonNode deserialising from null #85463
fix JsonNode deserialising from null #85463
Conversation
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis |
@@ -39,6 +41,10 @@ public static void JsonTypes_Deserialize() | |||
Assert.IsAssignableFrom<JsonValue>(JsonNode.Parse("\"str\"")); | |||
Assert.IsAssignableFrom<JsonValue>(JsonNode.Parse(ToUtf8("\"str\""))); | |||
Assert.IsType<JsonElement>(JsonSerializer.Deserialize<object>("\"str\"")); | |||
|
|||
Assert.Null(JsonSerializer.Deserialize<JsonNode>("null")); |
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.
Would it be possible to
- Also test deserializing an object containing a
JsonNode
property? - Add tests validating the same behavior for
JsonObject
andJsonArray
?
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.
Sure thing!
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.
Thanks!
@adj123 would you mind responding to the CLA bot as well? Thanks! |
@dotnet-policy-service agree company="DRW Holdings" |
Fixes #85172