Skip to content

YamlDocument.Convert Method

Definition

Namespace: Corvus.Yaml
Assembly: Corvus.Text.Json.dll

Convert(ReadOnlySpan<byte>, Utf8JsonWriter, YamlReaderOptions)

Converts UTF-8 YAML bytes to JSON, writing the output to the specified Utf8JsonWriter.

public static void Convert(ReadOnlySpan<byte> utf8Yaml, Utf8JsonWriter writer, YamlReaderOptions options)

Parameters

Name Type Description
utf8Yaml ReadOnlySpan<byte> The UTF-8 encoded YAML bytes.
writer Utf8JsonWriter The JSON writer to write the converted output to.
options YamlReaderOptions Optional YAML reader options. (optional)

Exceptions

Exception Description
YamlException The YAML content is invalid.

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests.

Open an issue