You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add missing exceptions to JsonSerializer and JsonSerializerOptions (#3989)
* Add missing exceptions to JsonSerializer and JsonSerializerOptions
* Add doc for missing InvalidOperationException
* Add System namespace to exceptions
Copy file name to clipboardExpand all lines: xml/System.Text.Json/JsonSerializer.xml
+29-8Lines changed: 29 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -67,14 +67,15 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
67
67
<exceptioncref="T:System.ArgumentNullException">
68
68
<paramrefname="returnType" /> is <seelangword="null" />.</exception>
69
69
<exceptioncref="T:System.Text.Json.JsonException">The JSON is invalid.
70
-
70
+
71
71
-or-
72
72
73
73
<typeparamrefname="returnType" /> is not compatible with the JSON.
74
74
75
75
-or-
76
76
77
77
There is remaining data in the span beyond a single JSON value.</exception>
78
+
<exceptioncref="T:System.NotSupportedException">There is no compatible <seecref="System.Text.Json.Serialization.JsonConverter"/> for <paramrefname="returnType"/> or its serializable members.</exception>
78
79
</Docs>
79
80
</Member>
80
81
<MemberMemberName="Deserialize">
@@ -127,6 +128,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
127
128
-or-
128
129
129
130
There is remaining data in the string beyond a single JSON value.</exception>
131
+
<exceptioncref="T:System.NotSupportedException">There is no compatible <seecref="System.Text.Json.Serialization.JsonConverter"/> for <paramrefname="returnType"/> or its serializable members.</exception>
130
132
</Docs>
131
133
</Member>
132
134
<MemberMemberName="Deserialize">
@@ -170,7 +172,6 @@ This method makes a copy of the data the reader acted on, so there is no caller
170
172
The <xref:System.Text.Json.JsonReaderOptions> used to create the instance of the <xref:System.Text.Json.Utf8JsonReader> take precedence over the <xref:System.Text.Json.JsonSerializerOptions> when they conflict. Hence, <xref:System.Text.Json.JsonReaderOptions.AllowTrailingCommas?displayProperty=nameWithType>, <xref:System.Text.Json.JsonReaderOptions.MaxDepth?displayProperty=nameWithType>, and <xref:System.Text.Json.JsonReaderOptions.CommentHandling?displayProperty=nameWithType> are used while reading.
171
173
172
174
For more information, see [How to serialize and deserialize JSON](~/docs/standard/serialization/system-text-json-how-to.md).
173
-
174
175
]]></format>
175
176
</remarks>
176
177
<exceptioncref="T:System.ArgumentNullException">
@@ -186,6 +187,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
186
187
A value could not be read from the reader.</exception>
187
188
<exceptioncref="T:System.ArgumentException">
188
189
<paramrefname="reader" /> is using unsupported options.</exception>
190
+
<exceptioncref="T:System.NotSupportedException">There is no compatible <seecref="System.Text.Json.Serialization.JsonConverter"/> for <paramrefname="returnType"/> or its serializable members.</exception>
189
191
</Docs>
190
192
</Member>
191
193
<MemberMemberName="Deserialize<TValue>">
@@ -227,14 +229,15 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
227
229
]]></format>
228
230
</remarks>
229
231
<exceptioncref="T:System.Text.Json.JsonException">The JSON is invalid.
230
-
232
+
231
233
-or-
232
234
233
235
<typeparamrefname="TValue" /> is not compatible with the JSON.
234
236
235
237
-or-
236
238
237
239
There is remaining data in the span beyond a single JSON value.</exception>
240
+
<exceptioncref="T:System.NotSupportedException">There is no compatible <seecref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamrefname="TValue"/> or its serializable members.</exception>
238
241
</Docs>
239
242
</Member>
240
243
<MemberMemberName="Deserialize<TValue>">
@@ -280,14 +283,15 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
280
283
<exceptioncref="T:System.ArgumentNullException">
281
284
<paramrefname="json" /> is <seelangword="null" />.</exception>
282
285
<exceptioncref="T:System.Text.Json.JsonException">The JSON is invalid.
283
-
286
+
284
287
-or-
285
288
286
289
<typeparamrefname="TValue" /> is not compatible with the JSON.
287
290
288
291
-or-
289
292
290
293
There is remaining data in the string beyond a single JSON value.</exception>
294
+
<exceptioncref="T:System.NotSupportedException">There is no compatible <seecref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamrefname="TValue"/> or its serializable members.</exception>
291
295
</Docs>
292
296
</Member>
293
297
<MemberMemberName="Deserialize<TValue>">
@@ -337,7 +341,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
337
341
]]></format>
338
342
</remarks>
339
343
<exceptioncref="T:System.Text.Json.JsonException">The JSON is invalid.
340
-
344
+
341
345
-or-
342
346
343
347
<typeparamrefname="TValue" /> is not compatible with the JSON.
@@ -347,6 +351,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
347
351
A value could not be read from the reader.</exception>
<exceptioncref="T:System.NotSupportedException">There is no compatible <seecref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamrefname="TValue"/> or its serializable members.</exception>
350
355
</Docs>
351
356
</Member>
352
357
<MemberMemberName="DeserializeAsync">
@@ -390,14 +395,15 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
390
395
<exceptioncref="T:System.ArgumentNullException">
391
396
<paramrefname="utf8Json" /> or <paramrefname="returnType" /> is <seelangword="null" />.</exception>
392
397
<exceptioncref="T:System.Text.Json.JsonException">The JSON is invalid.
393
-
398
+
394
399
-or-
395
400
396
401
<typeparamrefname="TValue" /> is not compatible with the JSON.
397
402
398
403
-or-
399
404
400
405
There is remaining data in the stream.</exception>
406
+
<exceptioncref="T:System.NotSupportedException">There is no compatible <seecref="System.Text.Json.Serialization.JsonConverter"/> for <paramrefname="returnType"/> or its serializable members.</exception>
@@ -441,14 +447,15 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
441
447
]]></format>
442
448
</remarks>
443
449
<exceptioncref="T:System.Text.Json.JsonException">The JSON is invalid.
444
-
450
+
445
451
-or-
446
452
447
453
<typeparamrefname="TValue" /> is not compatible with the JSON.
448
454
449
455
-or-
450
456
451
457
There is remaining data in the stream.</exception>
458
+
<exceptioncref="T:System.NotSupportedException">There is no compatible <seecref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamrefname="TValue"/> or its serializable members.</exception>
452
459
</Docs>
453
460
</Member>
454
461
<MemberMemberName="Serialize">
@@ -489,6 +496,9 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
489
496
490
497
]]></format>
491
498
</remarks>
499
+
<exceptioncref="T:System.ArgumentException"><paramrefname="inputType"/> is not compatible with <paramrefname="value"/>.</exception>
500
+
<exceptioncref="T:System.ArgumentNullException"><paramrefname="inputType" /> is <seelangword="null" />.</exception>
501
+
<exceptioncref="T:System.NotSupportedException">There is no compatible <seecref="System.Text.Json.Serialization.JsonConverter"/> for <paramrefname="inputType"/> or its serializable members.</exception>
492
502
</Docs>
493
503
</Member>
494
504
<MemberMemberName="Serialize">
@@ -530,8 +540,10 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
530
540
531
541
]]></format>
532
542
</remarks>
543
+
<exceptioncref="T:System.ArgumentException"><paramrefname="inputType"/> is not compatible with <paramrefname="value"/></exception>
533
544
<exceptioncref="T:System.ArgumentNullException">
534
-
<paramrefname="writer" /> is <seelangword="null" />.</exception>
545
+
<paramrefname="writer" /> or <paramrefname="inputType" /> is <seelangword="null" />.</exception>
546
+
<exceptioncref="T:System.NotSupportedException">There is no compatible <seecref="System.Text.Json.Serialization.JsonConverter"/> for <paramrefname="inputType"/> or its serializable members.</exception>
535
547
</Docs>
536
548
</Member>
537
549
<MemberMemberName="Serialize<TValue>">
@@ -574,6 +586,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
574
586
575
587
]]></format>
576
588
</remarks>
589
+
<exceptioncref="T:System.NotSupportedException">There is no compatible <seecref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamrefname="TValue"/> or its serializable members.</exception>
577
590
</Docs>
578
591
</Member>
579
592
<MemberMemberName="Serialize<TValue>">
@@ -619,6 +632,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
619
632
</remarks>
620
633
<exceptioncref="T:System.ArgumentNullException">
621
634
<paramrefname="writer" /> is <seelangword="null" />.</exception>
635
+
<exceptioncref="T:System.NotSupportedException">There is no compatible <seecref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamrefname="TValue"/> or its serializable members.</exception>
622
636
</Docs>
623
637
</Member>
624
638
<MemberMemberName="SerializeAsync">
@@ -661,8 +675,10 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
661
675
662
676
]]></format>
663
677
</remarks>
678
+
<exceptioncref="T:System.ArgumentException"><paramrefname="inputType"/> is not compatible with <paramrefname="value"/>.</exception>
664
679
<exceptioncref="T:System.ArgumentNullException">
665
680
<paramrefname="utf8Json" /> or <paramrefname="inputType" /> is <seelangword="null" />.</exception>
681
+
<exceptioncref="T:System.NotSupportedException">There is no compatible <seecref="System.Text.Json.Serialization.JsonConverter"/> for <paramrefname="inputType"/> or its serializable members.</exception>
666
682
</Docs>
667
683
</Member>
668
684
<MemberMemberName="SerializeAsync<TValue>">
@@ -709,6 +725,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
709
725
</remarks>
710
726
<exceptioncref="T:System.ArgumentNullException">
711
727
<paramrefname="utf8Json" /> is <seelangword="null" />.</exception>
728
+
<exceptioncref="T:System.NotSupportedException">There is no compatible <seecref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamrefname="TValue"/> or its serializable members.</exception>
712
729
</Docs>
713
730
</Member>
714
731
<MemberMemberName="SerializeToUtf8Bytes">
@@ -747,6 +764,9 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
747
764
748
765
]]></format>
749
766
</remarks>
767
+
<exceptioncref="T:System.ArgumentException"><paramrefname="inputType"/> is not compatible with <paramrefname="value"/>.</exception>
768
+
<exceptioncref="T:System.ArgumentNullException"><paramrefname="inputType" /> is <seelangword="null" />.</exception>
769
+
<exceptioncref="T:System.NotSupportedException">There is no compatible <seecref="System.Text.Json.Serialization.JsonConverter"/> for <paramrefname="inputType"/> or its serializable members.</exception>
@@ -787,6 +807,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
787
807
788
808
]]></format>
789
809
</remarks>
810
+
<exceptioncref="T:System.NotSupportedException">There is no compatible <seecref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamrefname="TValue"/> or its serializable members.</exception>
Copy file name to clipboardExpand all lines: xml/System.Text.Json/JsonSerializerOptions.xml
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -254,6 +254,8 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
254
254
255
255
]]></format>
256
256
</remarks>
257
+
<exceptioncref="T:System.InvalidOperationException">The configured <seecref="System.Text.Json.Serialization.JsonConverter"/> for <paramrefname="typeToConvert"/> returned an invalid converter.</exception>
258
+
<exceptioncref="T:System.NotSupportedException">There is no compatible <seecref="System.Text.Json.Serialization.JsonConverter"/> for <paramrefname="typeToConvert"/> or its serializable members.</exception>
0 commit comments