Consider extending JsonIncludeAttribute and JsonConstructorAttribute support to internal and private members. #87431
Labels
area-System.Text.Json
enhancement
Product code improvement that does NOT require public API changes/additions
source-generator
Indicates an issue with a source generator feature
Milestone
As shipped the
JsonConstructorAttribute
is limited to public constructors only andJsonIncludeAttribute
only works with public properties in which either the getter or setter is non-public but not with fields. These annotations can only be scoped to individual members and we've received customer feedback indicating confusion whenever the serializer is not honoring an explicit instruction made by the user.This issue tracks extending support for these attributes so that user intentions are always honored, where possible. More specifically, it proposes that we:
JsonConstructorAttribute
support to internal constructors. (Json serializer code generator doesn't support internal constructors #77016)JsonIncludeAttribute
support to internal properties and fields.The text was updated successfully, but these errors were encountered: