YamlMergeKeyBehavior Enum
Definition
Specifies how the reader treats the YAML merge key (<<).
public enum YamlMergeKeyBehavior
- Extension Methods
Fields
Expand = 0Expand a
<<entry by merging the referenced mapping's keys, with existing keys taking precedence. This is the default. Only the plain, untagged key<<is a merge key; its value must be a mapping or a sequence of mappings, and a mapping may hold only one merge key. A merged mapping that has a merge key of its own is expanded first, so it contributes the keys its own merge supplies.Disabled = 1Disable merge-key handling; a
<<entry is retained as an ordinary mapping key.PreserveAsNormalKey = 2Retain a
<<entry as an ordinary mapping key without expanding it. Equivalent to Disabled in the produced tree, expressing the intent to preserve rather than process the key.
Remarks
The merge key is a YAML 1.1 working-draft feature and is not part of the YAML 1.2 core schema. It is supported as a
compatibility convenience, expanded by default under either specification version to match common configuration
usage (the default is Expand), and it can be disabled so that << is treated as an
ordinary key.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |