Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Text.​Json.​Serialization.​JsonSourceGenerationOptionsAttribute

Assembly: System.Text.Json

Inheritance: object → AttributeJsonAttribute → JsonSourceGenerationOptionsAttribute

Instructs the System.Text.Json source generator to assume the specified options will be used at run time via <see cref="T:System.Text.Json.JsonSerializerOptions" /> .

Properties

public bool
AllowDuplicateProperties
Specifies the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.AllowDuplicateProperties" /> when set.
public bool
AllowOutOfOrderMetadataProperties
Specifies the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.AllowOutOfOrderMetadataProperties" /> when set.
public bool
AllowTrailingCommas
Gets or sets the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.AllowTrailingCommas" /> .
public Type[]
Converters
Gets or sets the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.Converters" /> .
public int
DefaultBufferSize
Gets or sets the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.DefaultBufferSize" /> .
DefaultIgnoreCondition
Gets or sets the default ignore condition.
DictionaryKeyPolicy
Gets or sets the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.DictionaryKeyPolicy" /> .
GenerationMode
Gets or sets the source generation mode for types that don't explicitly set the mode with <see cref="P:System.Text.Json.Serialization.JsonSerializableAttribute.GenerationMode" /> .
public bool
IgnoreReadOnlyFields
Gets or sets a value that indicates whether to ignore read-only fields.
public bool
IgnoreReadOnlyProperties
Gets or sets a value that indicates whether to ignore read-only properties.
public bool
IncludeFields
Gets or sets a value that indicates whether to include fields for serialization and deserialization.
public int
MaxDepth
Gets or sets the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.MaxDepth" /> .
public string
NewLine
Specifies the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.NewLine" /> when set.
NumberHandling
Gets or sets the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.NumberHandling" /> .
PreferredObjectCreationHandling
Gets or sets the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.PreferredObjectCreationHandling" /> .
public bool
PropertyNameCaseInsensitive
Gets or sets the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.PropertyNameCaseInsensitive" /> .
PropertyNamingPolicy
Gets or sets a built-in naming policy to convert JSON property names with.
ReadCommentHandling
Gets or sets the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.ReadCommentHandling" /> .
ReferenceHandler
Specifies the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.ReferenceHandler" /> when set.
public bool
RespectNullableAnnotations
Specifies the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.RespectNullableAnnotations" /> when set.
public bool
RespectRequiredConstructorParameters
Specifies the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.RespectRequiredConstructorParameters" /> when set.
UnknownTypeHandling
Gets or sets the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.UnknownTypeHandling" /> .
UnmappedMemberHandling
Gets or sets the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.UnmappedMemberHandling" /> .
public bool
UseStringEnumConverter
Gets or sets a value that indicates whether the source generator defaults to <see cref="T:System.Text.Json.Serialization.JsonStringEnumConverter" /> instead of numeric serialization for all enum types encountered in its type graph.
public bool
WriteIndented
Gets or sets a value that indicates whether JSON output is pretty-printed.
public char
IndentCharacter
Specifies the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.IndentCharacter" /> when set.
public int
IndentSize
Specifies the default value of <see cref="P:System.Text.Json.JsonSerializerOptions.IndentCharacter" /> when set.
public object
TypeId

Methods

public bool
Equals​(object obj)
Inherited from Attribute
public int
GetHashCode​()
Inherited from Attribute
public bool
IsDefaultAttribute​()
Inherited from Attribute
public bool
Match​(object obj)
Inherited from Attribute
protected void
Finalize​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object