Skip to content

Commit 238352d

Browse files
authored
Update JsonSerializerOptions.xml
Refine IncludeFields remarks to highlight that only public fields are serialized and that private fields are not.
1 parent 8c50220 commit 238352d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

xml/System.Text.Json/JsonSerializerOptions.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,8 +710,10 @@ For more information, see [How to ignore properties with System.Text.Json](/dotn
710710
<summary>Gets or sets a value that indicates whether fields are handled during serialization and deserialization.
711711
The default value is <see langword="false" />.</summary>
712712
<value>
713-
<see langword="true" /> if fields are included during serialization; otherwise, <see langword="false" />.</value>
714-
<remarks>To be added.</remarks>
713+
<see langword="true" /> if public fields are included during serialization; otherwise, <see langword="false" />.</value>
714+
<remarks>Only includes public fields during serialization and deserialization. Private fields are not included, even if IncludeFields is set to <see langword="true" />.
715+
If you need to include private fields, you would typically use properties with appropriate accessors or consider using attributes like [JsonInclude] on those fields.
716+
</remarks>
715717
<exception cref="T:System.InvalidOperationException">This property is set after serialization or deserialization has occurred.</exception>
716718
</Docs>
717719
</Member>

0 commit comments

Comments
 (0)