-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
System.Text.Json.JsonSerializer does not work with Dictionary<string, object> #67588
Comments
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue DetailsDescriptionWhen a
I have provided a simple piece of code example to reproduce it. I tried with Reproduction Steps
Expected behavior
Actual behavior
Regression?No response Known Workarounds
Configuration
Other informationNo response
|
|
This is a bug, our unsupported type detection for System.Type values is evaded in the case of polymorphism. Values are resolved as This example should have failed with NotSupportedException since |
Description
When a
Dictionary<string, object>
needs serialization, the .NET defaultSystem.Text.Json.JsonSerializer
throws an exception:I have provided a simple piece of code example to reproduce it. I tried with
Newtonsoft.Json.JsonConvert
and it works flawlessly.Reproduction Steps
Expected behavior
System.Text.Json.JsonSerializer
should not throw any ExceptionActual behavior
System.Text.Json.JsonSerializer
throws:Regression?
No response
Known Workarounds
Newtonsoft.Json.JsonConvert
works flawlesslyConfiguration
Other information
No response
The text was updated successfully, but these errors were encountered: