Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Enum

YamlDuplicateKeyPolicy

OfficeIMO.Yaml

Namespace
OfficeIMO.Yaml
Assembly
OfficeIMO.Yaml
Source revision
0eef6a5756b9 with working tree changes
Base
Enum
Implements
IComparable ISpanFormattable IFormattable IConvertible
Modifiers
sealed

How YamlDocument treats a mapping that contains two equal keys. Without an explicit policy, loads use YamlDuplicateKeyPolicy.LastWins, and strict loads (YamlLoadOptions.Strict) use YamlDuplicateKeyPolicy.Error.

Inheritance

  • Enum
  • YamlDuplicateKeyPolicy

Usage

Explore 4 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Values

public const YamlDuplicateKeyPolicy Error #

The load fails with YamlErrorCodes.DuplicateKey, as the YAML specification requires. Strict loads use it by default.

Value: 0
public const YamlDuplicateKeyPolicy FirstWins #

The load succeeds; key lookups return the first of the equal keys, and each later one is reported as a warning diagnostic.

Value: 1
public const YamlDuplicateKeyPolicy LastWins #

The load succeeds; key lookups, paths and the serializer use the last of the equal keys, as PyYAML, go-yaml v2 and SharpYaml do, and each later one is reported as a warning diagnostic. Non-strict loads use it by default.

Value: 2