Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Member group

SerializeNode

Declaring type: JsonSerializer
Module: System.Data.Json
Assembly: System.Data.dll
Source file: JsonSerializer.rvn

Overloads / Variants

SerializeNode

static func SerializeNode(output: OutputStream, value: JsonValue, options: JsonSerializerOptions) -> Task<Result<void, JsonError>>

Source file: JsonSerializer.rvn

Validates and serializes a node with the selected formatting before writing to the stream.

Parameters

Name Type Description
output OutputStream Destination stream, left open.
value JsonValue The node to serialize.
options JsonSerializerOptions Output formatting options.

Return value

Task<Result<void, JsonError>>

Success or a validation, quota or stream error.

SerializeNode

static func SerializeNode(output: OutputStream, value: JsonValue) -> Task<Result<void, JsonError>>

Source file: JsonSerializer.rvn

Validates a complete document, then writes UTF-8 through StreamWriter.

Parameters

Name Type Description
output OutputStream Borrowed stream; caller owns flushing and closing.
value JsonValue Root node to serialize.

Return value

Task<Result<void, JsonError>>

Unit, a JSON limit error or Write wrapping StreamError.

Remarks

Does not close or flush output. Validation failures write no bytes, but I/O failure can leave a prefix written. Writes are not transactional. Synchronous, whole-buffer operation.

SerializeNode

static func SerializeNode(value: JsonValue, options: JsonSerializerOptions) -> Result<string, JsonError>

Source file: JsonSerializer.rvn

Serializes a JSON node with compact or indented formatting.

Parameters

Name Type Description
value JsonValue The node to serialize.
options JsonSerializerOptions Output formatting options.

Return value

Result<String, JsonError>

JSON text or a validation/quota error. Formatting counts toward the UTF-8 output limit.

SerializeNode

static func SerializeNode(value: JsonValue) -> Result<string, JsonError>

Source file: JsonSerializer.rvn

Writes a bounded DOM to compact JSON text.

Parameters

Name Type Description
value JsonValue Root node; shared child references count on every visit.

Return value

Result<String, JsonError>

JSON text or LimitExceeded when output, depth or occurrence limits are exceeded.

Remarks

No deep equality, sorting or normalization. Cycles fail the depth bound; no dedicated cycle diagnostic. Strings are escaped and number spelling is preserved.