Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ec7b039

Browse files
carlossanlopahsonkhan
authored andcommitted
Automatically port System.Text.Json.JsonSerializerOptions (dotnet#2879)
* Automatically port System.Text.Json.JsonSerializerOptions * Edited content * Overlooked 3 changes * suggestions by Jozkee Co-Authored-By: David Cantu <[email protected]> * missing values * bytes Co-Authored-By: Ahson Khan <[email protected]> * suggestions by ahsonkhan Co-Authored-By: Ahson Khan <[email protected]>
1 parent 3651464 commit ec7b039

File tree

1 file changed

+140
-38
lines changed

1 file changed

+140
-38
lines changed

xml/System.Text.Json/JsonSerializerOptions.xml

Lines changed: 140 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</Base>
1515
<Interfaces />
1616
<Docs>
17-
<summary>To be added.</summary>
17+
<summary>Provides options to be used with <see cref="T:System.Text.Json.JsonSerializer" />.</summary>
1818
<remarks>To be added.</remarks>
1919
</Docs>
2020
<Members>
@@ -31,7 +31,7 @@
3131
</AssemblyInfo>
3232
<Parameters />
3333
<Docs>
34-
<summary>To be added.</summary>
34+
<summary>Initializes a new instance of the <see cref="T:System.Text.Json.JsonSerializerOptions" /> class.</summary>
3535
<remarks>To be added.</remarks>
3636
</Docs>
3737
</Member>
@@ -51,9 +51,18 @@
5151
<ReturnType>System.Boolean</ReturnType>
5252
</ReturnValue>
5353
<Docs>
54-
<summary>To be added.</summary>
55-
<value>To be added.</value>
56-
<remarks>To be added.</remarks>
54+
<summary>Get or sets a value that indicates whether an extra comma at the end of a list of JSON values in an object or array is allowed (and ignored) within the JSON payload being deserialized.</summary>
55+
<value><see langword="true" /> if an extra comma at the end of a list of JSON values in an object or array is allowed (and ignored); <see langword="false" /> otherwise.</value>
56+
<remarks>
57+
<format type="text/markdown"><![CDATA[
58+
59+
## Remarks
60+
61+
By default, `AllowTrailingCommas` is set to `false`, and a <exception cref="T:System.Text.Json.JsonException> is thrown if a trailing comma is encountered.
62+
63+
]]></format>
64+
</remarks>
65+
<exception cref="T:System.InvalidOperationException">This property was set after serialization or deserialization has occurred.</exception>
5766
</Docs>
5867
</Member>
5968
<Member MemberName="Converters">
@@ -72,9 +81,17 @@
7281
<ReturnType>System.Collections.Generic.IList&lt;System.Text.Json.Serialization.JsonConverter&gt;</ReturnType>
7382
</ReturnValue>
7483
<Docs>
75-
<summary>To be added.</summary>
76-
<value>To be added.</value>
77-
<remarks>To be added.</remarks>
84+
<summary>Gets the list of user-defined converters that were registered.</summary>
85+
<value>The list of custom converters.</value>
86+
<remarks>
87+
<format type="text/markdown"><![CDATA[
88+
89+
## Remarks
90+
91+
Once serialization or deserialization occurs, the list cannot be modified.
92+
93+
]]></format>
94+
</remarks>
7895
</Docs>
7996
</Member>
8097
<Member MemberName="DefaultBufferSize">
@@ -93,9 +110,19 @@
93110
<ReturnType>System.Int32</ReturnType>
94111
</ReturnValue>
95112
<Docs>
96-
<summary>To be added.</summary>
97-
<value>To be added.</value>
98-
<remarks>To be added.</remarks>
113+
<summary>Gets or sets the default buffer size, in bytes, to use when creating temporary buffers.</summary>
114+
<value>The default buffer size in bytes.</value>
115+
<remarks>
116+
<format type="text/markdown"><![CDATA[
117+
118+
## Remarks
119+
120+
The default buffer size, in bytes, is 16384.
121+
122+
]]></format>
123+
</remarks>
124+
<exception cref="T:System.ArgumentException">The buffer size is less than 1.</exception>
125+
<exception cref="T:System.InvalidOperationException">This property was set after serialization or deserialization has occurred.</exception>
99126
</Docs>
100127
</Member>
101128
<Member MemberName="DictionaryKeyPolicy">
@@ -114,9 +141,21 @@
114141
<ReturnType>System.Text.Json.JsonNamingPolicy</ReturnType>
115142
</ReturnValue>
116143
<Docs>
117-
<summary>To be added.</summary>
118-
<value>To be added.</value>
119-
<remarks>To be added.</remarks>
144+
<summary>Gets or sets the policy used to convert a <see cref="T:System.Collections.IDictionary" /> key's name to another format, such as camel-casing.</summary>
145+
<value>The policy used to convert a <see cref="T:System.Collections.IDictionary" /> key's name to another format.</value>
146+
<remarks>
147+
<format type="text/markdown"><![CDATA[
148+
149+
## Remarks
150+
151+
This property can be set to <xref:System.Text.Json.JsonNamingPolicy.CamelCase?displayProperty=nameWithType> to specify a camel-casing policy.
152+
153+
This property can be set to <xref:System.Text.Json.JsonNamingPolicy.CamelCase> to specify a camel-casing policy.
154+
155+
It is not used when deserializing.
156+
157+
]]></format>
158+
</remarks>
120159
</Docs>
121160
</Member>
122161
<Member MemberName="GetConverter">
@@ -138,9 +177,9 @@
138177
<Parameter Name="typeToConvert" Type="System.Type" />
139178
</Parameters>
140179
<Docs>
141-
<param name="typeToConvert">To be added.</param>
142-
<summary>To be added.</summary>
143-
<returns>To be added.</returns>
180+
<param name="typeToConvert">The type to return a converter for.</param>
181+
<summary>Returns the converter for the specified type.</summary>
182+
<returns>The first converter that supports the given type, or <see langword="null" /> if there is no converter.</returns>
144183
<remarks>To be added.</remarks>
145184
</Docs>
146185
</Member>
@@ -160,9 +199,10 @@
160199
<ReturnType>System.Boolean</ReturnType>
161200
</ReturnValue>
162201
<Docs>
163-
<summary>To be added.</summary>
164-
<value>To be added.</value>
202+
<summary>Gets or sets a value that determines whether <see langword="null" /> values are ignored during serialization and deserialization. The default value is <see langword="false" />.</summary>
203+
<value><see langword="true" /> to ignore null values during serialization and deserialization; otherwise, see langword="false" />.</value>
165204
<remarks>To be added.</remarks>
205+
<exception cref="T:System.InvalidOperationException">This property was set after serialization or deserialization has occurred.</exception>
166206
</Docs>
167207
</Member>
168208
<Member MemberName="IgnoreReadOnlyProperties">
@@ -181,9 +221,20 @@
181221
<ReturnType>System.Boolean</ReturnType>
182222
</ReturnValue>
183223
<Docs>
184-
<summary>To be added.</summary>
185-
<value>To be added.</value>
186-
<remarks>To be added.</remarks>
224+
<summary>Gets a value that determines whether read-only properties are ignored during serialization. The default value is <see langword="false" />.</summary>
225+
<value><see langword="true" /> to ignore read-only properties during serialization; otherwise, <see langword="false" />.</value>
226+
<remarks>
227+
<format type="text/markdown"><![CDATA[
228+
229+
## Remarks
230+
231+
A property is read-only if it contains a public getter but not a public setter.
232+
233+
Read-only properties are not deserialized regardless of this setting.
234+
235+
]]></format>
236+
</remarks>
237+
<exception cref="T:System.InvalidOperationException">This property was set after serialization or deserialization has occurred.</exception>
187238
</Docs>
188239
</Member>
189240
<Member MemberName="MaxDepth">
@@ -202,9 +253,19 @@
202253
<ReturnType>System.Int32</ReturnType>
203254
</ReturnValue>
204255
<Docs>
205-
<summary>To be added.</summary>
206-
<value>To be added.</value>
207-
<remarks>To be added.</remarks>
256+
<summary>Gets or sets the maximum depth allowed when serializing or deserializing JSON, with the default value of 0 indicating a maximum depth of 64.</summary>
257+
<value>The maximum depth allowed when serializing or deserializing JSON.</value>
258+
<remarks>
259+
<format type="text/markdown"><![CDATA[
260+
261+
## Remarks
262+
263+
Going past this depth will throw a <exception cref="T:System.Text.Json.JsonException>.
264+
265+
]]></format>
266+
</remarks>
267+
<exception cref="T:System.InvalidOperationException">This property was set after serialization or deserialization has occurred.</exception>
268+
<exception cref="T:System.ArgumentOutOfRangeException">The max depth is set to a negative value.</exception>
208269
</Docs>
209270
</Member>
210271
<Member MemberName="PropertyNameCaseInsensitive">
@@ -223,9 +284,17 @@
223284
<ReturnType>System.Boolean</ReturnType>
224285
</ReturnValue>
225286
<Docs>
226-
<summary>To be added.</summary>
227-
<value>To be added.</value>
228-
<remarks>To be added.</remarks>
287+
<summary>Gets or sets a value that determines whether a property's name uses a case-insensitive comparison during deserialization. The default value is <see langword="false" />.</summary>
288+
<value><see langword="true" /> to compare property names using case-insensitive comparison; otherwise, <see langword="false" />.</value>
289+
<remarks>
290+
<format type="text/markdown"><![CDATA[
291+
292+
## Remarks
293+
294+
There is a performance cost associated with case-insensitie comparison (that is, when `PropertyNameCaseInsensitive` is `true`).
295+
296+
]]></format>
297+
</remarks>
229298
</Docs>
230299
</Member>
231300
<Member MemberName="PropertyNamingPolicy">
@@ -244,9 +313,21 @@
244313
<ReturnType>System.Text.Json.JsonNamingPolicy</ReturnType>
245314
</ReturnValue>
246315
<Docs>
247-
<summary>To be added.</summary>
248-
<value>To be added.</value>
249-
<remarks>To be added.</remarks>
316+
<summary>Gets or sets a value that specifies the policy used to convert a property's name on an object to another format, such as camel-casing. </summary>
317+
<value>One of the enum values from <see cref="T:System.Text.Json.JsonNamingPolicy" />.</value>
318+
<remarks>
319+
<format type="text/markdown"><![CDATA[
320+
321+
## Remarks
322+
323+
The resulting property name is expected to match the JSON payload during deserialization, and will be used when writing the property name during serialization.
324+
325+
The policy is not used for properties that have a <xref:System.Text.Json.Serialization.JsonPropertyNameAttribute> applied.
326+
327+
This property can be set to <xref:System.Text.Json.JsonNamingPolicy.CamelCase?displayProperty=nameWithType> to specify a camel-casing policy.
328+
329+
]]></format>
330+
</remarks>
250331
</Docs>
251332
</Member>
252333
<Member MemberName="ReadCommentHandling">
@@ -265,9 +346,19 @@
265346
<ReturnType>System.Text.Json.JsonCommentHandling</ReturnType>
266347
</ReturnValue>
267348
<Docs>
268-
<summary>To be added.</summary>
269-
<value>To be added.</value>
270-
<remarks>To be added.</remarks>
349+
<summary>Gets or sets a value that defines how comments are handled during deserialization.</summary>
350+
<value>A value that indicates whether comments are allowed, disallowed, or skipped.</value>
351+
<remarks>
352+
<format type="text/markdown"><![CDATA[
353+
354+
## Remarks
355+
356+
By default, a <exception cref="T:System.Text.Json.JsonException> is thrown if a comment is encountered.
357+
358+
]]></format>
359+
</remarks>
360+
<exception cref="T:System.InvalidOperationException">This property was set after serialization or deserialization has occurred.</exception>
361+
<exception cref="T:System.ArgumentOutOfRangeException">The comment handling enum is set to a value that is not supported (or not within the <see cref="T:System.Text.Json.JsonCommentHandling" /> enum range).</exception>
271362
</Docs>
272363
</Member>
273364
<Member MemberName="WriteIndented">
@@ -286,10 +377,21 @@
286377
<ReturnType>System.Boolean</ReturnType>
287378
</ReturnValue>
288379
<Docs>
289-
<summary>To be added.</summary>
290-
<value>To be added.</value>
291-
<remarks>To be added.</remarks>
380+
<summary>Gets or sets a value that defines whether JSON should use pretty printing. By default, JSON is serialized without any extra white space.</summary>
381+
<value><see langword="true"/> if JSON should pretty print on serialization; otherwise, <see langword="false"/>. The default is <see langword="false"/>.</value>
382+
<remarks>
383+
<format type="text/markdown"><![CDATA[
384+
385+
Pretty printing includes:
386+
387+
- Indenting nested JSON tokens.
388+
- Adding new lines
389+
- Adding white space between property names and values.
390+
391+
]]></format>
392+
</remarks>
393+
<exception cref="T:System.InvalidOperationException">This property was set after serialization or deserialization has occurred.</exception>
292394
</Docs>
293395
</Member>
294396
</Members>
295-
</Type>
397+
</Type>

0 commit comments

Comments
 (0)