-
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 Serialize ignores Properties from base interfaces #73021
Comments
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue DetailsDescriptionIf you have a Interface wich inherits from a Basic one, System.Text.Json only serializes the Properties from the Interface specified. Reproduction StepsTry this Code:
Expected behaviorThe result should be:
Actual behaviorThe result is:
Regression?No response Known WorkaroundsNo response Configuration.Net6 latest Service Pack Other informationNo response
|
Thanks for reporting. I believe this is a duplicate of #41749. |
Description
If you have a Interface wich inherits from a Basic one, System.Text.Json only serializes the Properties from the Interface specified.
This has nothing to do with polymorphism, cause I've got a instance of the derived interface.
(Look, my Object Variable is of Type B, and Type B should include the Properties of Type A)
Reproduction Steps
Try this Code:
Expected behavior
The result should be:
Actual behavior
The result is:
Regression?
No response
Known Workarounds
No response
Configuration
.Net6 latest Service Pack
Windows 10
x64
Other information
No response
The text was updated successfully, but these errors were encountered: