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
When serializing an object via the System.Text.Json.JsonSerializer, readonly enumerable properties are serialized regardless of IgnoreReadOnlyProperties set to True.
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis
See info in area-owners.md if you want to be subscribed.
Issue Details
Description
When serializing an object via the System.Text.Json.JsonSerializer, readonly enumerable properties are serialized regardless of IgnoreReadOnlyProperties set to True.
Description
When serializing an object via the System.Text.Json.JsonSerializer, readonly enumerable properties are serialized regardless of IgnoreReadOnlyProperties set to True.
Reproduction Steps
.NET Fiddle
Expected behavior
All readonly properties are ignored.
Actual behavior
If the property's type is enumerable, it is serialized anyway.
Regression?
No
Known Workarounds
No response
Configuration
.NET 7, tested on 8 with .NET Fiddle
Other information
No response
The text was updated successfully, but these errors were encountered: