JsonWriterOptions Struct
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Allows the user to define custom behavior when writing JSON using the Utf8JsonWriter.
public value class JsonWriterOptions
public struct JsonWriterOptions
type JsonWriterOptions = struct
Public Structure JsonWriterOptions
- Inheritance
Remarks
By default, the JSON is written without any indentation or extra white space. Also, Utf8JsonWriter throws an exception if the user attempts to write structurally invalid JSON.
For more information, see How to write custom serializers and deserializers with System.Text.Json.
Properties
Encoder |
Gets or sets the encoder to use when escaping strings, or |
IndentCharacter |
Defines the indentation character used by Utf8JsonWriter when Indented is enabled. Defaults to the space character. |
Indented |
Gets or sets a value that indicates whether the Utf8JsonWriter should format the JSON output, which includes indenting nested JSON tokens, adding new lines, and adding white space between property names and values. |
IndentSize |
Defines the indentation size used by Utf8JsonWriter when Indented is enabled. Defaults to two. |
MaxDepth |
Gets or sets the maximum depth allowed when writing JSON, with the default (that is, 0) indicating a max depth of 1000. |
NewLine |
Gets or sets the new line string to use when Indented is The default is the value of NewLine. |
SkipValidation |
Gets or sets a value that indicates whether the Utf8JsonWriter should skip structural validation and allow the user to write invalid JSON. |