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
Hey all,
I was playing around with JsonSerializerOptions and I noticed that collections are being ignored by the property JsonSerializerOptions.IgnoreReadOnlyProperties.
It continues serializing the properties.
What this does is that we need to bring an unecessary dependency to our models (JsonIgnoreAttribute) which, for me, makes no sense.
And the alternative of creating custom json converters is quite painfull.
Noticed that an issue was already created/closed without a clear answer to it.
System.Text.Json: JsonSerializerOptions.IgnoreReadOnlyProperties being ignored #37599
What options do we have to solve this issue?
The text was updated successfully, but these errors were encountered:
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
Hey all,
I was playing around with JsonSerializerOptions and I noticed that collections are being ignored by the property JsonSerializerOptions.IgnoreReadOnlyProperties.
It continues serializing the properties.
What this does is that we need to bring an unecessary dependency to our models (JsonIgnoreAttribute) which, for me, makes no sense.
And the alternative of creating custom json converters is quite painfull.
Noticed that an issue was already created/closed without a clear answer to it.
System.Text.Json: JsonSerializerOptions.IgnoreReadOnlyProperties being ignored #37599
What this does is that we need to bring an unecessary dependency to our models (JsonIgnoreAttribute) which, for me, makes no sense.
Agreed, but at this point changing the behavior would likely be a breaking change. The functionality in #63686 should provide a configuration mechanism alternative to applying JsonIgnore attributes.
Hey all,
I was playing around with JsonSerializerOptions and I noticed that collections are being ignored by the property JsonSerializerOptions.IgnoreReadOnlyProperties.
It continues serializing the properties.
What this does is that we need to bring an unecessary dependency to our models (JsonIgnoreAttribute) which, for me, makes no sense.
And the alternative of creating custom json converters is quite painfull.
Noticed that an issue was already created/closed without a clear answer to it.
System.Text.Json: JsonSerializerOptions.IgnoreReadOnlyProperties being ignored #37599
What options do we have to solve this issue?
The text was updated successfully, but these errors were encountered: