opened
Symbai
username_0
Similar to https://www.newtonsoft.com/json/help/html/JsonObjectAttributeOptIn.htm an option to serialize only specific properties would be very useful. Especially if the amount of properties to include are less than the properties to exclude.

For example I have one base class `Animal` where lots of animal type classes inherits from: `Cat, Dog, Horse, Monkey, ...` (and imagine https://github.com/dotnet/corefx/issues/39031 gets addressed sometime). It's easier to just include the property by a custom attribute rather to exclude all unwanted for maintainability reasons. For the same reasons I also don't want to mess around with a sort of converter or something when there are many classes.

In Newtonsoft Json it was easy and worked very well by just adding a custom attribute on top of the class and skip >300 JsonIgnore attributes on every property.
Request: System.Text.Json Serialization with Opt-In
issue
created
AraHaan
username_1
@layomia is this still in the works for 5.0?
comment
created
Symbai
username_0
@eiriktsarpalis Mine was posted on July, the duplicate was posted in December. So the others has duplicated mine actually.
comment