-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
JsonSerializerOptionsAttribute.cs
53 lines (46 loc) · 1.77 KB
/
JsonSerializerOptionsAttribute.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Text.Json.Serialization
{
/// <summary>
/// Instructs the System.Text.Json source generator to assume the specified
/// options will be used at run-time via <see cref="JsonSerializerOptions"/>.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
#if BUILDING_SOURCE_GENERATOR
internal
#else
public
#endif
class JsonSerializerOptionsAttribute : JsonAttribute
{
/// <summary>
/// Specifies the default ignore condition.
/// </summary>
public JsonIgnoreCondition DefaultIgnoreCondition { get; set; }
/// <summary>
/// Specifies whether to ignore read-only fields.
/// </summary>
public bool IgnoreReadOnlyFields { get; set; }
/// <summary>
/// Specifies whether to ignore read-only properties.
/// </summary>
public bool IgnoreReadOnlyProperties { get; set; }
/// <summary>
/// Specifies whether to ignore custom converters provided at run-time.
/// </summary>
public bool IgnoreRuntimeCustomConverters { get; set; }
/// <summary>
/// Specifies whether to include fields for serialization and deserialization.
/// </summary>
public bool IncludeFields { get; set; }
/// <summary>
/// Specifies a built-in naming polices to convert JSON property names with.
/// </summary>
public JsonKnownNamingPolicy NamingPolicy { get; set; }
/// <summary>
/// Specifies whether JSON output should be pretty-printed.
/// </summary>
public bool WriteIndented { get; set; }
}
}