Skip to content
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

Add nullness warnings in JsonParse #9595

Merged
merged 5 commits into from Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 10 additions & 8 deletions xml/System.Text.Json.Nodes/JsonNode.xml
Expand Up @@ -2538,7 +2538,7 @@ The underlying value of a <xref:System.Text.Json.Nodes.JsonValue> after deserial
<param name="reader">The reader to read.</param>
<param name="nodeOptions">Options to control the behavior.</param>
<summary>Parses one JSON value (including objects or arrays) from the provided reader.</summary>
<returns>The <see cref="T:System.Text.Json.Nodes.JsonNode" /> from the reader.</returns>
<returns>The <see cref="T:System.Text.Json.Nodes.JsonNode" /> from the reader, or null if the input represents the null JSON value.</returns>
<remarks>
<format type="text/markdown"><![CDATA[

Expand Down Expand Up @@ -2582,7 +2582,7 @@ This method makes a copy of the data the reader acted on, so there is no caller
<param name="nodeOptions">Options to control the node behavior after parsing.</param>
<param name="documentOptions">Options to control the document behavior during parsing.</param>
<summary>Parses a <see cref="T:System.IO.Stream" /> as UTF-8-encoded data representing a single JSON value into a <see cref="T:System.Text.Json.Nodes.JsonNode" />. The Stream will be read to completion.</summary>
<returns>A <see cref="T:System.Text.Json.Nodes.JsonNode" /> representation of the JSON value.</returns>
<returns>A <see cref="T:System.Text.Json.Nodes.JsonNode" /> representation of the JSON value, or null if the input represents the null JSON value.</returns>
<remarks>To be added.</remarks>
<exception cref="T:System.Text.Json.JsonException">
<paramref name="utf8Json" /> does not represent a valid single JSON value.</exception>
Expand Down Expand Up @@ -2620,7 +2620,7 @@ This method makes a copy of the data the reader acted on, so there is no caller
<param name="nodeOptions">Options to control the node behavior after parsing.</param>
<param name="documentOptions">Options to control the document behavior during parsing.</param>
<summary>Parses text representing a single JSON value.</summary>
<returns>A <see cref="T:System.Text.Json.Nodes.JsonNode" /> representation of the JSON value.</returns>
<returns>A <see cref="T:System.Text.Json.Nodes.JsonNode" /> representation of the JSON value, or null if the input represents the null JSON value.</returns>
<remarks>To be added.</remarks>
<exception cref="T:System.Text.Json.JsonException">
<paramref name="utf8Json" /> does not represent a valid single JSON value.</exception>
Expand Down Expand Up @@ -2659,7 +2659,7 @@ This method makes a copy of the data the reader acted on, so there is no caller
<param name="nodeOptions">Options to control the node behavior after parsing.</param>
<param name="documentOptions">Options to control the document behavior during parsing.</param>
<summary>Parses text representing a single JSON value.</summary>
<returns>A <see cref="T:System.Text.Json.Nodes.JsonNode" /> representation of the JSON value.</returns>
<returns>A <see cref="T:System.Text.Json.Nodes.JsonNode" /> representation of the JSON value, or null if the input represents the null JSON value.</returns>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="json" /> is <see langword="null" />.</exception>
Expand Down Expand Up @@ -2699,7 +2699,7 @@ This method makes a copy of the data the reader acted on, so there is no caller
<param name="documentOptions">Options to control the document behavior during parsing.</param>
<param name="cancellationToken">The token to monitor for cancellation requests.</param>
<summary>Parses a <see cref="T:System.IO.Stream" /> as UTF-8 encoded data representing a single JSON value into a <see cref="T:System.Text.Json.Nodes.JsonNode" />. The stream will be read to completion.</summary>
<returns>A <see cref="T:System.Threading.Tasks.Task" /> to produce a <see cref="T:System.Text.Json.Nodes.JsonNode" /> representation of the JSON value.</returns>
<returns>A <see cref="T:System.Threading.Tasks.Task" /> to produce either a <see cref="T:System.Text.Json.Nodes.JsonNode" /> representation of the JSON value, or null if the input represents the null JSON value.</returns>
<remarks>To be added.</remarks>
<exception cref="T:System.Text.Json.JsonException">
<paramref name="utf8Json" /> does not represent a valid single JSON value.</exception>
Expand Down Expand Up @@ -2810,9 +2810,10 @@ The current node is returned if it is a root.
</Parameters>
<Docs>
<param name="options">Options to control the serialization behavior.</param>
<summary>Converts the current instance to string in JSON format.</summary>
<returns>JSON representation of current instance.</returns>
<remarks>To be added.</remarks>
<summary>Converts the current instance to a string in JSON format.</summary>
<returns>The JSON representation of the current instance.</returns>
<remarks>
<see cref="Overload:System.Text.Json.Nodes.JsonNode.Parse" /> does not round-trip with this method, because of its behavior on the JSON null value.</remarks>
</Docs>
</Member>
<Member MemberName="ToString">
Expand Down Expand Up @@ -2876,3 +2877,4 @@ The current node is returned if it is a root.
</Member>
</Members>
</Type>