Home YamlConverter Class
YamlConverter Class
Cancel

YamlConverter Class

Namespace: Yaml2JsonNode

Inheritance: YamlConverter 🡒 object

Provides extensions to convert YAML models to JSON models.

Methods

ToJsonNode(this YamlStream yaml)

Converts all of the documents in a YAML stream to System.Text.Json.Nodes.JsonNodes.

Declaration

1
public static IEnumerable<JsonNode> ToJsonNode(this YamlStream yaml)
ParameterTypeDescription
yamlYamlStreamThe YAML stream.

Returns

A collection of nodes representing the YAML documents in the stream.

ToJsonNode(this YamlDocument yaml)

Converts a single YAML document to a System.Text.Json.Nodes.JsonNode.

Declaration

1
public static JsonNode ToJsonNode(this YamlDocument yaml)
ParameterTypeDescription
yamlYamlDocumentThe YAML document.

Returns

A JsonNode representative of the YAML document.

ToJsonNode(this YamlNode yaml)

Converts a single YAML node to a System.Text.Json.Nodes.JsonNode.

Declaration

1
public static JsonNode ToJsonNode(this YamlNode yaml)
ParameterTypeDescription
yamlYamlNodeThe YAML node.

Returns

A JsonNode representative of the YAML node.

ToYamlNode(this JsonNode json)

Converts a single JSON node to a YamlDotNet.RepresentationModel.YamlNode.

Declaration

1
public static YamlNode ToYamlNode(this JsonNode json)
ParameterTypeDescription
jsonJsonNode 

Returns

Contents