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
{{ message }}
System.Text.Json code gen: ignored properties are not completely ignored #58320
One of my classes has a property decorated with [JsonIgnore] similar to this:
[JsonIgnore][JsonPropertyName("foo")][Obsolete("This property is no longer valid because blablabla.")]publicstringFoo{get;set;}
One important detail to notice is that this property is ALSO decorated with an "obsolete" attribute with a custom message that allows me to warm developers to discontinue using this property.
ignoreCondition is set to ignore always, which I guess is good and will presumably prevent the value from being serialized but the problem is that the Foo property is referenced in the "getter" and the "setter" which triggers a CS0618 when I build my library coupled with the fact that I treat warnings as errors during the build process, this causes my library to fail to build.
Is there a way to indicate to the code generator that a given class property should be completely ignored?
Activity
steveharter commentedon Aug 30, 2021
This should be fixed for 6.0 if possible