Skip to content

Commit 221ae3d

Browse files
carlossanlopmairaw
authored andcommitted
Add some missing Json exceptions, fix spacing. (#3150)
* Add some missing Json exceptions, fix spacing. * readd new line * remove bom character * bom + new line + style guide * bom + new line * bom + new line * bom + new line * bom + new line
1 parent 9eea13d commit 221ae3d

File tree

2 files changed

+54
-60
lines changed

2 files changed

+54
-60
lines changed

xml/System.Text.Json/JsonDocument.xml

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,18 @@ This class utilizes resources from pooled memory to minimize the impact of the g
7777
<returns>A JsonDocument representation of the JSON value.</returns>
7878
<remarks>
7979
<format><![CDATA[
80+
81+
## Remarks
82+
8083
The <xref:System.Buffers.ReadOnlySequence%601> may be used for the entire lifetime of the JsonDocument object, and the caller must ensure that the data therein does not change during the object lifetime.
8184
Because the input is considered to be text, a UTF-8 Byte-Order-Mark (BOM) must not be present.
8285
8386
]]></format>
8487
</remarks>
8588
<exception cref="T:System.Text.Json.JsonException">
86-
<paramref name="utf8Json" /> does not represent a valid single JSON value.
87-
</exception>
89+
<paramref name="utf8Json" /> does not represent a valid single JSON value.</exception>
8890
<exception cref="T:System.ArgumentException">
89-
<paramref name="readerOptions" /> contains unsupported options.
90-
</exception>
91+
<paramref name="readerOptions" /> contains unsupported options.</exception>
9192
</Docs>
9293
</Member>
9394
<Member MemberName="Parse">
@@ -115,11 +116,9 @@ Because the input is considered to be text, a UTF-8 Byte-Order-Mark (BOM) must n
115116
<returns>A JsonDocument representation of the JSON value.</returns>
116117
<remarks>To be added.</remarks>
117118
<exception cref="T:System.Text.Json.JsonException">
118-
<paramref name="utf8Json" /> does not represent a valid single JSON value.
119-
</exception>
119+
<paramref name="utf8Json" /> does not represent a valid single JSON value.</exception>
120120
<exception cref="T:System.ArgumentException">
121-
<paramref name="readerOptions" /> contains unsupported options.
122-
</exception>
121+
<paramref name="readerOptions" /> contains unsupported options.</exception>
123122
</Docs>
124123
</Member>
125124
<Member MemberName="Parse">
@@ -154,11 +153,9 @@ Because the input is considered to be text, a UTF-8 Byte-Order-Mark (BOM) must n
154153
]]></format>
155154
</remarks>
156155
<exception cref="T:System.Text.Json.JsonException">
157-
<paramref name="utf8Json" /> does not represent a valid single JSON value.
158-
</exception>
156+
<paramref name="utf8Json" /> does not represent a valid single JSON value.</exception>
159157
<exception cref="T:System.ArgumentException">
160-
<paramref name="readerOptions" /> contains unsupported options.
161-
</exception>
158+
<paramref name="readerOptions" /> contains unsupported options.</exception>
162159
</Docs>
163160
</Member>
164161
<Member MemberName="Parse">
@@ -191,11 +188,9 @@ The <xref:System.ReadOnlyMemory%601> value may be used for the entire lifetime o
191188
]]></format>
192189
</remarks>
193190
<exception cref="T:System.Text.Json.JsonException">
194-
<paramref name="json" /> does not represent a valid single JSON value.
195-
</exception>
191+
<paramref name="json" /> does not represent a valid single JSON value.</exception>
196192
<exception cref="T:System.ArgumentException">
197-
<paramref name="readerOptions" /> contains unsupported options.
198-
</exception>
193+
<paramref name="readerOptions" /> contains unsupported options.</exception>
199194
</Docs>
200195
</Member>
201196
<Member MemberName="Parse">
@@ -223,11 +218,9 @@ The <xref:System.ReadOnlyMemory%601> value may be used for the entire lifetime o
223218
<returns>A JsonDocument representation of the JSON value.</returns>
224219
<remarks>To be added.</remarks>
225220
<exception cref="T:System.Text.Json.JsonException">
226-
<paramref name="json" /> does not represent a valid single JSON value.
227-
</exception>
221+
<paramref name="json" /> does not represent a valid single JSON value.</exception>
228222
<exception cref="T:System.ArgumentException">
229-
<paramref name="readerOptions" /> contains unsupported options.
230-
</exception>
223+
<paramref name="readerOptions" /> contains unsupported options.</exception>
231224
</Docs>
232225
</Member>
233226
<Member MemberName="ParseAsync">
@@ -256,11 +249,9 @@ The <xref:System.ReadOnlyMemory%601> value may be used for the entire lifetime o
256249
<returns>A task to produce a JsonDocument representation of the JSON value.</returns>
257250
<remarks>To be added.</remarks>
258251
<exception cref="T:System.Text.Json.JsonException">
259-
<paramref name="utf8Json" /> does not represent a valid single JSON value.
260-
</exception>
252+
<paramref name="utf8Json" /> does not represent a valid single JSON value.</exception>
261253
<exception cref="T:System.ArgumentException">
262-
<paramref name="readerOptions" /> contains unsupported options.
263-
</exception>
254+
<paramref name="readerOptions" /> contains unsupported options.</exception>
264255
</Docs>
265256
</Member>
266257
<Member MemberName="ParseValue">
@@ -288,6 +279,8 @@ The <xref:System.ReadOnlyMemory%601> value may be used for the entire lifetime o
288279
<remarks>
289280
<format><![CDATA[
290281
282+
## Remarks
283+
291284
If the <xref:System.Text.Json.Utf8JsonReader.TokenType> property of `reader` is <xref:System.Text.Json.JsonTokenType.PropertyName?displayProperty=nameWithType> or <xref:System.Text.Json.JsonTokenType.None?displayProperty=nameWithType>, the reader will advance by one call to <xref:System.Text.Json.Utf8JsonReader.Read?displayProperty=nameWithType> to determine the start of the value.
292285
293286
Upon completion of this method, `reader` is positioned at the final token in the JSON value. If an exception is thrown, the reader is reset to
@@ -299,10 +292,11 @@ This method makes a copy of the data the reader acted on, so there is no caller
299292
</remarks>
300293
<exception cref="T:System.ArgumentException">
301294
<paramref name="reader" /> contains unsupported options.
302-
</exception>
303-
<exception cref="T:System.Text.Json.JsonException">
304-
A value could not be read from the reader.
305-
</exception>
295+
296+
-or-
297+
298+
The current <paramref name="reader" /> token does not start or represent a value.</exception>
299+
<exception cref="T:System.Text.Json.JsonException">A value could not be read from the reader.</exception>
306300
</Docs>
307301
</Member>
308302
<Member MemberName="RootElement">
@@ -353,7 +347,9 @@ This method makes a copy of the data the reader acted on, so there is no caller
353347
<see langword="true" /> if a value was read and parsed into a JsonDocument; <see langword="false" /> if the reader ran out of data while parsing. All other situations result in an exception being thrown.</returns>
354348
<remarks>
355349
<format><![CDATA[
356-
350+
351+
## Remarks
352+
357353
If the <xref:System.Text.Json.Utf8JsonReader.TokenType> property of `reader` is <xref:System.Text.Json.JsonTokenType.PropertyName?displayProperty=nameWithType> or <xref:System.Text.Json.JsonTokenType.None?displayProperty=nameWithType>, the reader will advance by one call to <xref:System.Text.Json.Utf8JsonReader.Read?displayProperty=nameWithType> to determine the start of the value.
358354
359355
Upon completion of this method, `reader` is positioned at the final token in the JSON value. If an exception is thrown or `false`
@@ -365,10 +361,11 @@ This method makes a copy of the data the reader acted on, so there is no caller
365361
</remarks>
366362
<exception cref="T:System.ArgumentException">
367363
<paramref name="reader" /> contains unsupported options.
368-
</exception>
369-
<exception cref="T:System.Text.Json.JsonException">
370-
A value could not be read from the reader.
371-
</exception>
364+
365+
-or-
366+
367+
The current <paramref name="reader" /> token does not start or represent a value.</exception>
368+
<exception cref="T:System.Text.Json.JsonException">A value could not be read from the reader.</exception>
372369
</Docs>
373370
</Member>
374371
<Member MemberName="WriteTo">

0 commit comments

Comments
 (0)