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.

struct System.​Text.​Json.​JsonWriterOptions

Assembly: System.Text.Json

Allows the user to define custom behavior when writing JSON using the <see cref="T:System.Text.Json.Utf8JsonWriter" /> .

Properties

Gets or sets the encoder to use when escaping strings, or <see langword="null" /> to use the default encoder.
public bool
Indented
Gets or sets a value that indicates whether the <see cref="T:System.Text.Json.Utf8JsonWriter" /> should format the JSON output, which includes indenting nested JSON tokens, adding new lines, and adding white space between property names and values.
public char
IndentCharacter
Defines the indentation character used by <see cref="T:System.Text.Json.Utf8JsonWriter" /> when <see cref="P:System.Text.Json.JsonWriterOptions.Indented" /> is enabled. Defaults to the space character.
public int
IndentSize
Defines the indentation size used by <see cref="T:System.Text.Json.Utf8JsonWriter" /> when <see cref="P:System.Text.Json.JsonWriterOptions.Indented" /> is enabled. Defaults to two.
public string
NewLine
<para>Gets or sets the new line string to use when <see cref="P:System.Text.Json.JsonWriterOptions.Indented" /> is <see langword="true" />.</para> <para>The default is the value of <see cref="P:System.Environment.NewLine" />.</para>
public int
MaxDepth
Gets or sets the maximum depth allowed when writing JSON, with the default (that is, 0) indicating a maximum depth of 1000.
public bool
SkipValidation
Gets or sets a value that indicates whether the <see cref="T:System.Text.Json.Utf8JsonWriter" /> should skip structural validation and allow the user to write invalid JSON.

Methods

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