Skip to content

Commit 047317f

Browse files
authored
Automatically port 5.0 System.Text.Json documentation (#4284)
* Automatically port System.Text.Json 5.0 documentation * Auto ported exceptions
1 parent 4e05b76 commit 047317f

9 files changed

+76
-20
lines changed

xml/System.Text.Json.Serialization/JsonConstructorAttribute.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</Attribute>
2121
</Attributes>
2222
<Docs>
23-
<summary>To be added.</summary>
23+
<summary>When placed on a constructor, indicates that the constructor should be used to create instances of the type on deserialization.</summary>
2424
<remarks>To be added.</remarks>
2525
</Docs>
2626
<Members>
@@ -37,7 +37,7 @@
3737
</AssemblyInfo>
3838
<Parameters />
3939
<Docs>
40-
<summary>To be added.</summary>
40+
<summary>Initializes a new instance of <see cref="T:System.Text.Json.Serialization.JsonConstructorAttribute" />.</summary>
4141
<remarks>To be added.</remarks>
4242
</Docs>
4343
</Member>

xml/System.Text.Json.Serialization/JsonIgnoreAttribute.xml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,17 @@ For more information, see [How to serialize and deserialize JSON](/dotnet/standa
6969
<ReturnType>System.Text.Json.Serialization.JsonIgnoreCondition</ReturnType>
7070
</ReturnValue>
7171
<Docs>
72-
<summary>To be added.</summary>
72+
<summary>Specifies the condition that must be met before a property will be ignored.</summary>
7373
<value>To be added.</value>
74-
<remarks>To be added.</remarks>
74+
<remarks>
75+
<format type="text/markdown"><![CDATA[
76+
77+
## Remarks
78+
79+
The default value is <xref:System.Text.Json.Serialization.JsonIgnoreCondition.Always>.
80+
81+
]]></format>
82+
</remarks>
7583
</Docs>
7684
</Member>
7785
</Members>

xml/System.Text.Json.Serialization/JsonIgnoreCondition.xml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<BaseTypeName>System.Enum</BaseTypeName>
1414
</Base>
1515
<Docs>
16-
<summary>To be added.</summary>
16+
<summary>Controls how the <see cref="T:System.Text.Json.Serialization.JsonIgnoreAttribute" /> ignores properties on serialization and deserialization.</summary>
1717
<remarks>To be added.</remarks>
1818
</Docs>
1919
<Members>
@@ -34,7 +34,8 @@
3434
</ReturnValue>
3535
<MemberValue>1</MemberValue>
3636
<Docs>
37-
<summary>To be added.</summary>
37+
<summary>Property will always be ignored.</summary>
38+
<remarks>To be added.</remarks>
3839
</Docs>
3940
</Member>
4041
<Member MemberName="Never">
@@ -54,7 +55,8 @@
5455
</ReturnValue>
5556
<MemberValue>0</MemberValue>
5657
<Docs>
57-
<summary>To be added.</summary>
58+
<summary>Property will always be serialized and deserialized, regardless of <see cref="P:System.Text.Json.JsonSerializerOptions.IgnoreNullValues" /> configuration.</summary>
59+
<remarks>To be added.</remarks>
5860
</Docs>
5961
</Member>
6062
<Member MemberName="WhenWritingDefault">
@@ -74,7 +76,8 @@
7476
</ReturnValue>
7577
<MemberValue>2</MemberValue>
7678
<Docs>
77-
<summary>To be added.</summary>
79+
<summary>Property will only be ignored if it is <see langword="null" />.</summary>
80+
<remarks>To be added.</remarks>
7881
</Docs>
7982
</Member>
8083
</Members>

xml/System.Text.Json.Serialization/JsonIncludeAttribute.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,17 @@
2020
</Attribute>
2121
</Attributes>
2222
<Docs>
23-
<summary>To be added.</summary>
24-
<remarks>To be added.</remarks>
23+
<summary>Indicates that the member should be included for serialization and deserialization.</summary>
24+
<remarks>
25+
<format type="text/markdown"><![CDATA[
26+
27+
## Remarks
28+
29+
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.
30+
31+
]]></format>
32+
</remarks>
33+
<exception cref="T:System.InvalidOperationException">The attribute is applied to a non-public property.</exception>
2534
</Docs>
2635
<Members>
2736
<Member MemberName=".ctor">
@@ -37,7 +46,7 @@
3746
</AssemblyInfo>
3847
<Parameters />
3948
<Docs>
40-
<summary>To be added.</summary>
49+
<summary>Initializes a new instance of <see cref="T:System.Text.Json.Serialization.JsonIncludeAttribute" />.</summary>
4150
<remarks>To be added.</remarks>
4251
</Docs>
4352
</Member>

xml/System.Text.Json/JsonElement+ArrayEnumerator.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,15 @@ This member is an explicit interface member implementation. It can be used only
260260
<Docs>
261261
<summary>Gets the element in the collection at the current position of the enumerator.</summary>
262262
<value>The element in the collection at the current position of the enumerator.</value>
263-
<remarks>To be added.</remarks>
263+
<remarks>
264+
<format type="text/markdown"><![CDATA[
265+
266+
## Remarks
267+
268+
This member is an explicit interface member implementation. It can be used only when the <xref:System.Text.Json.JsonElement.ArrayEnumerator> instance is cast to an <xref:System.Collections.IEnumerator> interface.
269+
270+
]]></format>
271+
</remarks>
264272
</Docs>
265273
</Member>
266274
</Members>

xml/System.Text.Json/JsonElement+ObjectEnumerator.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,15 @@ This member is an explicit interface member implementation. It can be used only
264264
<Docs>
265265
<summary>Gets the element in the collection at the current position of the enumerator.</summary>
266266
<value>The element in the collection at the current position of the enumerator.</value>
267-
<remarks>To be added.</remarks>
267+
<remarks>
268+
<format type="text/markdown"><![CDATA[
269+
270+
## Remarks
271+
272+
This member is an explicit interface member implementation. It can be used only when the <xref:System.Text.Json.JsonElement.ObjectEnumerator> instance is cast to an <xref:System.Collections.IEnumerator> interface.
273+
274+
]]></format>
275+
</remarks>
268276
</Docs>
269277
</Member>
270278
</Members>

xml/System.Text.Json/JsonSerializer.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,8 @@ For more information, see [How to serialize and deserialize JSON](/dotnet/standa
482482

483483
There is remaining data in the stream.</exception>
484484
<exception cref="T:System.NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter" /> for <typeparamref name="TValue" /> or its serializable members.</exception>
485+
<exception cref="T:System.ArgumentNullException">
486+
<paramref name="utf8Json" />is <see langword="null" />.</exception>
485487
</Docs>
486488
</Member>
487489
<Member MemberName="Serialize">

xml/System.Text.Json/JsonSerializerOptions.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,11 @@ For more information, see [How to serialize and deserialize JSON](/dotnet/standa
8484
<Parameter Name="options" Type="System.Text.Json.JsonSerializerOptions" Index="0" FrameworkAlternate="net-5.0" />
8585
</Parameters>
8686
<Docs>
87-
<param name="options">To be added.</param>
88-
<summary>To be added.</summary>
87+
<param name="options">The options instance to copy options from.</param>
88+
<summary>Copies the options from a <see cref="T:System.Text.Json.JsonSerializerOptions" /> instance to a new instance.</summary>
8989
<remarks>To be added.</remarks>
90+
<exception cref="T:System.ArgumentNullException">
91+
<paramref name="options" /> is <see langword="null" />.</exception>
9092
</Docs>
9193
</Member>
9294
<Member MemberName="AllowTrailingCommas">
@@ -547,9 +549,9 @@ For more information, see [How to serialize and deserialize JSON](/dotnet/standa
547549
<ReturnType>System.Text.Json.Serialization.ReferenceHandler</ReturnType>
548550
</ReturnValue>
549551
<Docs>
550-
<summary>To be added.</summary>
552+
<summary>Configures how object references are handled when reading and writing JSON.</summary>
551553
<value>To be added.</value>
552-
<remarks>To be added.</remarks>
554+
<remarks>This option provides a convenient way to deal with circularity in object graphs.</remarks>
553555
</Docs>
554556
</Member>
555557
<Member MemberName="WriteIndented">

xml/System.Text.Json/Utf8JsonReader.xml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,15 @@ The JSON token value represents a number less than <see cref="F:System.Byte.MinV
350350
<returns>The byte array that represents the current JSON token value.</returns>
351351
<remarks>To be added.</remarks>
352352
<exception cref="T:System.InvalidOperationException">The type of the JSON token is not a <see cref="F:System.Text.Json.JsonTokenType.String" />.</exception>
353-
<exception cref="T:System.FormatException">The value is not encoded as Base64 text, so it can't be decoded to bytes.</exception>
353+
<exception cref="T:System.FormatException">The value is not encoded as Base64 text, so it can't be decoded to bytes.
354+
355+
-or-
356+
357+
The value contains invalid or more than two padding characters.
358+
359+
-or-
360+
361+
The value is incomplete. That is, the JSON string length is not a multiple of 4.</exception>
354362
<altmember cref="P:System.Text.Json.Utf8JsonReader.TokenType" />
355363
</Docs>
356364
</Member>
@@ -415,7 +423,11 @@ This method only creates a <xref:System.DateTime> representation of JSON strings
415423

416424
-or-
417425

418-
The entire UTF-8 encoded token value cannot be parsed to a <see cref="T:System.DateTime" /> value.</exception>
426+
The entire UTF-8 encoded token value cannot be parsed to a <see cref="T:System.DateTime" /> value.
427+
428+
-or-
429+
430+
The JSON token value is of an unsupported format.</exception>
419431
<altmember cref="P:System.Text.Json.Utf8JsonReader.TokenType" />
420432
</Docs>
421433
</Member>
@@ -454,7 +466,11 @@ This method only creates a <xref:System.DateTimeOffset> representation of JSON s
454466

455467
-or-
456468

457-
The entire UTF-8 encoded token value cannot be parsed to a <see cref="T:System.DateTimeOffset" /> value.</exception>
469+
The entire UTF-8 encoded token value cannot be parsed to a <see cref="T:System.DateTimeOffset" /> value.
470+
471+
-or-
472+
473+
The JSON token value is of an unsupported format.</exception>
458474
<altmember cref="P:System.Text.Json.Utf8JsonReader.TokenType" />
459475
</Docs>
460476
</Member>

0 commit comments

Comments
 (0)