Skip to content

Add missing exceptions to JsonSerializer and JsonSerializerOptions #3989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 20, 2020

Conversation

steveharter
Copy link
Contributor

Summary

Adds missing exception information. Ported from https://github.com/dotnet/runtime/pull/33400/files

@dotnet-bot dotnet-bot added this to the March 2020 milestone Mar 13, 2020
@steveharter steveharter self-assigned this Mar 13, 2020
Copy link
Contributor

@tdykstra tdykstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -519,8 +530,10 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar

]]></format>
</remarks>
<exception cref="T:System.ArgumentException"><paramref name="inputType"/> is not compatible with <paramref name="value"/></exception>
Copy link
Contributor

@carlossanlop carlossanlop Apr 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also nit - spacing:

Suggested change
<exception cref="T:System.ArgumentException"><paramref name="inputType"/> is not compatible with <paramref name="value"/></exception>
<exception cref="T:System.ArgumentException"><paramref name="inputType"/> is not compatible with <paramref name="value"/></exception>

Copy link
Contributor

@carlossanlop carlossanlop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I only left one nit suggestion.

@carlossanlop carlossanlop requested a review from a team April 10, 2020 20:09
Copy link
Contributor

@carlossanlop carlossanlop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the build had warnings: All the exceptions need to have their full name with type and namespace.
cc @tdykstra

@@ -73,6 +73,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
-or-

There is remaining data in the span beyond a single JSON value.</exception>
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="returnType"/> or its serializable members.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="returnType"/> or its serializable members.</exception>
<exception cref="T:System.NotSupportedException">There is no compatible <see cref="T:System.Text.Json.Serialization.JsonConverter"/> for <paramref name="returnType"/> or its serializable members.</exception>

@@ -124,6 +125,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
-or-

There is remaining data in the string beyond a single JSON value.</exception>
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="returnType"/> or its serializable members.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="returnType"/> or its serializable members.</exception>
<exception cref="T:System.NotSupportedException">There is no compatible <see cref="T:System.Text.Json.Serialization.JsonConverter"/> for <paramref name="returnType"/> or its serializable members.</exception>

@@ -182,6 +184,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
A value could not be read from the reader.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="reader" /> is using unsupported options.</exception>
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="returnType"/> or its serializable members.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="returnType"/> or its serializable members.</exception>
<exception cref="T:System.NotSupportedException">There is no compatible <see cref="T:System.Text.Json.Serialization.JsonConverter"/> for <paramref name="returnType"/> or its serializable members.</exception>

@@ -230,6 +233,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
-or-

There is remaining data in the span beyond a single JSON value.</exception>
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>
<exception cref="T:System.NotSupportedException">There is no compatible <see cref="T:System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>

@@ -282,6 +286,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
-or-

There is remaining data in the string beyond a single JSON value.</exception>
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>
<exception cref="T:System.NotSupportedException">There is no compatible <see cref="T:System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>

@@ -340,6 +345,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
A value could not be read from the reader.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="reader" /> uses unsupported options.</exception>
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>
<exception cref="T:System.NotSupportedException">There is no compatible <see cref="T:System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>

@@ -390,6 +396,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
-or-

There is remaining data in the stream.</exception>
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="returnType"/> or its serializable members.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="returnType"/> or its serializable members.</exception>
<exception cref="T:System.NotSupportedException">There is no compatible <see cref="T:System.Text.Json.Serialization.JsonConverter"/> for <paramref name="returnType"/> or its serializable members.</exception>

@@ -440,6 +447,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
-or-

There is remaining data in the stream.</exception>
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>
<exception cref="T:System.NotSupportedException">There is no compatible <see cref="T:System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>

@@ -479,6 +487,9 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar

]]></format>
</remarks>
<exception cref="ArgumentException"><paramref name="inputType"/> is not compatible with <paramref name="value"/>.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="ArgumentException"><paramref name="inputType"/> is not compatible with <paramref name="value"/>.</exception>
<exception cref="T:System.ArgumentException"><paramref name="inputType"/> is not compatible with <paramref name="value"/>.</exception>

@@ -479,6 +487,9 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar

]]></format>
</remarks>
<exception cref="ArgumentException"><paramref name="inputType"/> is not compatible with <paramref name="value"/>.</exception>
<exception cref="ArgumentNullException"><paramref name="inputType" /> is <see langword="null" />.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="ArgumentNullException"><paramref name="inputType" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentNullException"><paramref name="inputType" /> is <see langword="null" />.</exception>

@@ -479,6 +487,9 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar

]]></format>
</remarks>
<exception cref="ArgumentException"><paramref name="inputType"/> is not compatible with <paramref name="value"/>.</exception>
<exception cref="ArgumentNullException"><paramref name="inputType" /> is <see langword="null" />.</exception>
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="inputType"/> or its serializable members.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="inputType"/> or its serializable members.</exception>
<exception cref="T:System.NotSupportedException">There is no compatible <see cref="T:System.Text.Json.Serialization.JsonConverter"/> for <paramref name="inputType"/> or its serializable members.</exception>

<exception cref="T:System.ArgumentNullException">
<paramref name="writer" /> is <see langword="null" />.</exception>
<paramref name="writer" /> or <paramref name="inputType" /> is <see langword="null" />.</exception>
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="inputType"/> or its serializable members.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="inputType"/> or its serializable members.</exception>
<exception cref="T:System.NotSupportedException">There is no compatible <see cref="T:System.Text.Json.Serialization.JsonConverter"/> for <paramref name="inputType"/> or its serializable members.</exception>

@@ -562,6 +575,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar

]]></format>
</remarks>
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>
<exception cref="T:System.NotSupportedException">There is no compatible <see cref="T:System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>

@@ -606,6 +620,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="writer" /> is <see langword="null" />.</exception>
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>
<exception cref="T:System.NotSupportedException">There is no compatible <see cref="T:System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>

@@ -647,8 +662,10 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar

]]></format>
</remarks>
<exception cref="ArgumentException"><paramref name="inputType"/> is not compatible with <paramref name="value"/>.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="ArgumentException"><paramref name="inputType"/> is not compatible with <paramref name="value"/>.</exception>
<exception cref="T:System.ArgumentException"><paramref name="inputType"/> is not compatible with <paramref name="value"/>.</exception>

<exception cref="T:System.ArgumentNullException">
<paramref name="utf8Json" /> or <paramref name="inputType" /> is <see langword="null" />.</exception>
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="inputType"/> or its serializable members.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="inputType"/> or its serializable members.</exception>
<exception cref="T:System.NotSupportedException">There is no compatible <see cref="T:System.Text.Json.Serialization.JsonConverter"/> for <paramref name="inputType"/> or its serializable members.</exception>

@@ -694,6 +711,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="utf8Json" /> is <see langword="null" />.</exception>
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>
<exception cref="T:System.NotSupportedException">There is no compatible <see cref="T:System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>

@@ -731,6 +749,9 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar

]]></format>
</remarks>
<exception cref="ArgumentException"><paramref name="inputType"/> is not compatible with <paramref name="value"/>.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="ArgumentException"><paramref name="inputType"/> is not compatible with <paramref name="value"/>.</exception>
<exception cref="T:System.ArgumentException"><paramref name="inputType"/> is not compatible with <paramref name="value"/>.</exception>

@@ -731,6 +749,9 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar

]]></format>
</remarks>
<exception cref="ArgumentException"><paramref name="inputType"/> is not compatible with <paramref name="value"/>.</exception>
<exception cref="ArgumentNullException"><paramref name="inputType" /> is <see langword="null" />.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="ArgumentNullException"><paramref name="inputType" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentNullException"><paramref name="inputType" /> is <see langword="null" />.</exception>

@@ -731,6 +749,9 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar

]]></format>
</remarks>
<exception cref="ArgumentException"><paramref name="inputType"/> is not compatible with <paramref name="value"/>.</exception>
<exception cref="ArgumentNullException"><paramref name="inputType" /> is <see langword="null" />.</exception>
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="inputType"/> or its serializable members.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="inputType"/> or its serializable members.</exception>
<exception cref="T:System.NotSupportedException">There is no compatible <see cref="T:System.Text.Json.Serialization.JsonConverter"/> for <paramref name="inputType"/> or its serializable members.</exception>

@@ -770,6 +791,7 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar

]]></format>
</remarks>
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>
<exception cref="T:System.NotSupportedException">There is no compatible <see cref="T:System.Text.Json.Serialization.JsonConverter"/> for <typeparamref name="TValue"/> or its serializable members.</exception>

@@ -246,6 +246,8 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar

]]></format>
</remarks>
<exception cref="InvalidOperationException">The configured <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="typeToConvert"/> returned an invalid converter.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="InvalidOperationException">The configured <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="typeToConvert"/> returned an invalid converter.</exception>
<exception cref="T:System.InvalidOperationException">The configured <see cref="T:System.Text.Json.Serialization.JsonConverter"/> for <paramref name="typeToConvert"/> returned an invalid converter.</exception>

@@ -246,6 +246,8 @@ For more information, see [How to serialize and deserialize JSON](~/docs/standar

]]></format>
</remarks>
<exception cref="InvalidOperationException">The configured <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="typeToConvert"/> returned an invalid converter.</exception>
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="typeToConvert"/> or its serializable members.</exception>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<exception cref="NotSupportedException">There is no compatible <see cref="System.Text.Json.Serialization.JsonConverter"/> for <paramref name="typeToConvert"/> or its serializable members.</exception>
<exception cref="T:System.NotSupportedException">There is no compatible <see cref="T:System.Text.Json.Serialization.JsonConverter"/> for <paramref name="typeToConvert"/> or its serializable members.</exception>

@carlossanlop
Copy link
Contributor

@steveharter Did you use the DocsPortingTool to port these exceptions? If yes, then it has a bug, it should be adding the full name prefixed with the type in the crefs.

@steveharter
Copy link
Contributor Author

@carlossanlop how do I run the build so I can verify locally? Thanks

@steveharter
Copy link
Contributor Author

Did you use the DocsPortingTool to port these exceptions? If yes, then it has a bug, it should be adding the full name prefixed with the type in the crefs.

No -- there was already doc for the JsonSerializer static class so apparently the tool skips. However, I deleted the JsonSerializer.xml file and re-ran the tool but it did not generate the doc for that class although it did for other classes that has missing doc.

@BillWagner
Copy link
Member

@carlossanlop After the latest changes, the build is green. Do you want to approve and merge?

Copy link
Contributor

@carlossanlop carlossanlop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@carlossanlop carlossanlop merged commit bd2c14d into dotnet:master Apr 20, 2020
@carlossanlop carlossanlop added the new-content Indicates PRs that contain new articles label Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-content Indicates PRs that contain new articles
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants