Skip to content

Commit

Permalink
Merge pull request #9397 from dotnet/main
Browse files Browse the repository at this point in the history
  • Loading branch information
BillWagner authored Oct 20, 2023
2 parents d166b41 + 6cc8bf1 commit 89f6c92
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions xml/System.Text.Json.Serialization/JsonIncludeAttribute.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,20 @@
## Remarks
When applied to a property, indicates that non-public getters and setters can be used for serialization and deserialization. Non-public properties are not supported.
When applied to a property, this attribute indicates that non-public *getters* and *setters* can be used for serialization and deserialization.
> [!NOTE]
> Even with this attribute, the serialization source generator is still limited to non-public members that are *accessible* to the generated code. *Accessible* non-public members include those that are:
>
> - `internal` when in the same assembly as the generated context.
> - `protected`, `protected internal`, or `private protected` when the generated context is in a class that derives from the type.
> - `private` if the type is nested in the same class as the generated context.
In .NET 6 and .NET 7, non-public properties aren't supported.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The attribute is applied to a non-public property.</exception>
<exception cref="T:System.InvalidOperationException">.NET 7 and earlier versions only: The attribute is applied to a non-public property.</exception>
</Docs>
<Members>
<Member MemberName=".ctor">
Expand Down

0 comments on commit 89f6c92

Please sign in to comment.