Table of Contents

YamlSpecVersion Enum

Definition

Namespace
Bodu.Text.Yaml
Assembly
Bodu.Text.Yaml.dll
Package
Bodu.Text.Yaml 1.0.0
Source
YamlSpecVersion.cs

Identifies the version of the YAML specification whose implicit type resolution the reader applies. The version controls how unquoted (plain) scalars are interpreted as booleans, null, and numbers.

public enum YamlSpecVersion
Extension Methods

Fields

V1_2 = 0

The YAML 1.2 core schema. Only true and false resolve to booleans, and an explicit tag is required to type tokens such as yes or off.

V1_1 = 1

The YAML 1.1 schema. Additionally resolves yes/no, on/off, and y/n as booleans, and accepts leading-zero octal integers, binary integers, and underscore digit grouping. Base-60 ("sexagesimal") numbers are deliberately not resolved; a colon-separated scalar such as 22:22 stays a string.

Remarks

The default is V1_2, whose core schema resolves only true/false as booleans and null/~/the empty scalar as null. This avoids the well-known "Norway problem" in which YAML 1.1 silently converts unquoted tokens such as no, yes, on, and off to booleans.

Selecting V1_1 opts in to the broader YAML 1.1 implicit typing rules, including the additional boolean spellings (yes/no, on/off, y/n), leading-zero octal integers (0NNN), binary integers (0bNNN), and underscore digit grouping. The base-60 ("sexagesimal") numeric form of the historical 1.1 schema is deliberately not resolved under either version: a colon-separated plain scalar such as 22:22 remains a string, avoiding the well-known footgun in which time-, port-, or address-like values were silently reinterpreted as large numbers. The version affects only how plain scalars are typed; structural parsing of anchors, aliases, tags, and collections is identical for both versions.

Applies to

ProductVersions
.NET8, 10