Skip to content

Commit 9ea0ede

Browse files
authored
Further updates to Utf8JsonReader (#3155)
1 parent d434b4c commit 9ea0ede

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

xml/System.Text.Json/Utf8JsonReader.xml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ This constructor assumes that the entire JSON payload is contained in `jsonData`
122122
<param name="jsonData">The UTF-8 encoded JSON text to process.</param>
123123
<param name="isFinalBlock">
124124
<see langword="true" /> to indicate that the input sequence contains the entire data to process; <see langword="false" /> to indicate that the input span contains partial data with more data to follow.</param>
125-
<param name="state">An object that contains the reader state. If this is the first call to the constructor, pass in a default state. Otherwise, capture the state from the previous instance of the <see cref="T:System.Text.Json.Utf8JsonReader" /> by getting the value of the <see cref="P:System.Text.Json.Utf8JsonReader.CurrentState" /> property and pass that back.</param>
125+
<param name="state">An object that contains the reader state. If this is the first call to the constructor, pass the default state; otherwise, pass the value of the <see cref="P:System.Text.Json.Utf8JsonReader.CurrentState" /> property from the previous instance of the <see cref="T:System.Text.Json.Utf8JsonReader" />.</param>
126126
<summary>Initializes a new instance of the <see cref="T:System.Text.Json.Utf8JsonReader" /> structure that processes a read-only sequence of UTF-8 encoded text and indicates whether the input contains all the text to process.</summary>
127127
<remarks>
128128
<format type="text/markdown"><![CDATA[
@@ -157,7 +157,7 @@ This is the reason why the constructor accepts a <xref:System.Text.Json.JsonRead
157157
<param name="jsonData">The UTF-8 encoded JSON text to process.</param>
158158
<param name="isFinalBlock">
159159
<see langword="true" /> to indicate that the input sequence contains the entire data to process; <see langword="false" /> to indicate that the input span contains partial data with more data to follow.</param>
160-
<param name="state">An object that contains the reader state. If it's the first call to the constructor, pass in the default state. Otherwise, capture the state from the previous instance instance of the <see cref="T:System.Text.Json.Utf8JsonReader" /> by getting the value of the <see cref="P:System.Text.Json.Utf8JsonReader.CurrentState" /> property and pass that back.</param>
160+
<param name="state">An object that contains the reader state. If this is the first call to the constructor, pass the default state; otherwise, pass the value of the <see cref="P:System.Text.Json.Utf8JsonReader.CurrentState" /> property from the previous instance of the <see cref="T:System.Text.Json.Utf8JsonReader" />.</param>
161161
<summary>Initializes a new instance of the <see cref="T:System.Text.Json.Utf8JsonReader" /> structure that processes a read-only span of UTF-8 encoded text and indicates whether the input contains all the text to process.</summary>
162162
<remarks>
163163
<format type="text/markdown"><![CDATA[
@@ -377,7 +377,7 @@ The JSON token value represents a number less than <see cref="F:System.Byte.MinV
377377
378378
## Remarks
379379
380-
This method only creates a DateTime representation of JSON strings that conform to the ISO 8601-1 extended format (see [DateTime and DateTimeOffset support in System.Text.Json](~/docs/standard/datetime/system-text-json-support.md)).
380+
This method only creates a <xref:System.DateTime> representation of JSON strings that conform to the ISO 8601-1 extended format (see [DateTime and DateTimeOffset support in System.Text.Json](~/docs/standard/datetime/system-text-json-support.md)).
381381
382382
]]></format>
383383
</remarks>
@@ -414,7 +414,7 @@ The entire UTF-8 encoded token value cannot be parsed to a <see cref="System.Dat
414414
415415
## Remarks
416416
417-
This method only creates a DateTimeOffset representation of JSON strings that conform to the ISO 8601-1 extended format (see [DateTime and DateTimeOffset support in System.Text.Json](~/docs/standard/datetime/system-text-json-support.md)).
417+
This method only creates a <xref:System.DateTimeOffset> representation of JSON strings that conform to the ISO 8601-1 extended format (see [DateTime and DateTimeOffset support in System.Text.Json](~/docs/standard/datetime/system-text-json-support.md)).
418418
419419
]]></format>
420420
</remarks>
@@ -1073,7 +1073,15 @@ For comments, this value points to before the first comment delimiter (that is,
10731073
<summary>Tries to parse the current JSON token value from the source as a <see cref="T:System.DateTime" /> and returns a value that indicates whether the operation succeeded. </summary>
10741074
<returns>
10751075
<see langword="true" /> if the entire UTF-8 encoded token value can be successfully parsed to a <see cref="T:System.DateTime" /> value; otherwise, <see langword="false" />.</returns>
1076-
<remarks>This method only creates a DateTime representation of JSON strings that conform to the ISO 8601-1 extended format (see [DateTime and DateTimeOffset support in System.Text.Json](~/docs/standard/datetime/system-text-json-support.md)).</remarks>
1076+
<remarks>
1077+
<format type="text/markdown"><![CDATA[
1078+
1079+
## Remarks
1080+
1081+
This method only creates a <xref:System.DateTime> representation of JSON strings that conform to the ISO 8601-1 extended format (see [DateTime and DateTimeOffset support in System.Text.Json](~/docs/standard/datetime/system-text-json-support.md)).
1082+
1083+
]]></format>
1084+
</remarks>
10771085
<exception cref="T:System.InvalidOperationException">The value of the JSON token isn't a <see cref="F:System.Text.Json.JsonTokenType.String" />.</exception>
10781086
<altmember cref="P:System.Text.Json.Utf8JsonReader.TokenType" />
10791087
</Docs>
@@ -1101,7 +1109,15 @@ For comments, this value points to before the first comment delimiter (that is,
11011109
<summary>Tries to parse the current JSON token value from the source as a <see cref="T:System.DateTimeOffset" /> and returns a value that indicates whether the operation succeeded.</summary>
11021110
<returns>
11031111
<see langword="true" /> if the entire UTF-8 encoded token value can be successfully parsed to a <see cref="T:System.DateTimeOffset" /> value; otherwise, <see langword="false" />.</returns>
1104-
<remarks>This method only creates a DateTimeOffset representation of JSON strings that conform to the ISO 8601-1 extended format (see [DateTime and DateTimeOffset support in System.Text.Json](~/docs/standard/datetime/system-text-json-support.md)).</remarks>
1112+
<remarks>
1113+
<format type="text/markdown"><![CDATA[
1114+
1115+
## Remarks
1116+
1117+
This method only creates a <xref:System.DateTimeOffset> representation of JSON strings that conform to the ISO 8601-1 extended format (see [DateTime and DateTimeOffset support in System.Text.Json](~/docs/standard/datetime/system-text-json-support.md)).
1118+
1119+
]]></format>
1120+
</remarks>
11051121
<exception cref="T:System.InvalidOperationException">The value of the JSON token isn't a <see cref="F:System.Text.Json.JsonTokenType.String" />.</exception>
11061122
<altmember cref="P:System.Text.Json.Utf8JsonReader.TokenType" />
11071123
</Docs>
@@ -1521,7 +1537,7 @@ Otherwise, the token value must be accessed from <xref:System.Text.Json.Utf8Json
15211537
There is no guarantee that this property will always contain well-formed data. If the input JSON passed in to the `Utf8JsonReader` contains invalid UTF-8 bytes within JSON string tokens, this property will return back those invalid UTF-8 bytes as is.
15221538
Therefore, if the input is untrusted or not previously validated, call <xref:System.Text.Json.Utf8JsonReader.GetString> to get the JSON string token.
15231539
1524-
Since this property returns the raw bytes, avoid using it for text comparison. Instead call <xref:System.Text.Json.Utf8JsonReader.ValueTextEquals%2A> which will unescape the text if necessary.
1540+
Since this property returns the raw bytes, avoid using it for text comparison. Instead call <xref:System.Text.Json.Utf8JsonReader.ValueTextEquals%2A>, which unescapes the text if necessary.
15251541
15261542
]]></format>
15271543
</remarks>
@@ -1564,7 +1580,7 @@ Otherwise, the token value must be accessed from <xref:System.Text.Json.Utf8Json
15641580
There is no guarantee that this property will always contain well-formed data. If the input JSON passed in to the `Utf8JsonReader` contains invalid UTF-8 bytes within JSON string tokens, this property will return back those invalid UTF-8 bytes as is.
15651581
Therefore, if the input is untrusted or not previously validated, call <xref:System.Text.Json.Utf8JsonReader.GetString> to get the JSON string token.
15661582
1567-
Since this property returns the raw bytes, avoid using it for text comparison. Instead call <xref:System.Text.Json.Utf8JsonReader.ValueTextEquals%2A> which will unescape the text if necessary.
1583+
Since this property returns the raw bytes, avoid using it for text comparison. Instead call <xref:System.Text.Json.Utf8JsonReader.ValueTextEquals%2A> which unescapes the text if necessary.
15681584
15691585
]]></format>
15701586
</remarks>

0 commit comments

Comments
 (0)