FailsafeSchema Class

Implements the YAML failsafe schema.

public class FailsafeSchema : SchemaBase

Remarks

The failsafe schema is guaranteed to work with any YAML document. It is therefore the recommended schema for generic YAML tools. A YAML processor should therefore support this schema, at least as an option.

Inheritance
SchemaBase FailsafeSchema

Constructors

NameDescription
FailsafeSchema()Initializes a new instance of the FailsafeSchema class.

FailsafeSchema()

FailsafeSchema.cs

Initializes a new instance of the FailsafeSchema class.

public FailsafeSchema()

Properties

NameDescription
AllowFailsafeStringGets or sets a value indicating whether this schema should always fallback to a failsafe string in case of not matching any scalar rules. Default is true for FailsafeSchema

AllowFailsafeString

FailsafeSchema.cs

Gets or sets a value indicating whether this schema should always fallback to a failsafe string in case of not matching any scalar rules. Default is true for FailsafeSchema

protected bool AllowFailsafeString { get; set; }

Property value

bool true if [allow failsafe string]; otherwise, false.

Methods

NameDescription
GetDefaultTag(MappingStart)Gets the default tag for mapping nodes.
GetDefaultTag(SequenceStart)Gets the default tag for sequence nodes.
TryParse(Scalar, bool, string?, object?)Tries to parse.

GetDefaultTag overloads

GetDefaultTag(MappingStart)

FailsafeSchema.cs

Gets the default tag for mapping nodes.

protected override string GetDefaultTag(MappingStart nodeEvent)
Parameters
nodeEvent MappingStart
Returns

string

GetDefaultTag(SequenceStart)

FailsafeSchema.cs

Gets the default tag for sequence nodes.

protected override string GetDefaultTag(SequenceStart nodeEvent)
Parameters
nodeEvent SequenceStart
Returns

string

TryParse(Scalar, bool, string?, object?)

FailsafeSchema.cs

Tries to parse.

public override bool TryParse(Scalar scalar, bool decodeValue, out string? defaultTag, out object? value)

Parameters

scalar Scalar
decodeValue bool
defaultTag string?
value object?

Returns

bool

Constants

NameDescription
MapLongTagThe map long tag: tag:yaml.org,2002:map
MapShortTagThe map short tag: !!map.
SeqLongTagThe seq long tag: tag:yaml.org,2002:seq
SeqShortTagThe seq short tag: !!seq

MapLongTag

The map long tag: tag:yaml.org,2002:map

public const string MapLongTag = "tag:yaml.org,2002:map"

MapShortTag

The map short tag: !!map.

public const string MapShortTag = "!!map"

SeqLongTag

The seq long tag: tag:yaml.org,2002:seq

public const string SeqLongTag = "tag:yaml.org,2002:seq"

SeqShortTag

The seq short tag: !!seq

public const string SeqShortTag = "!!seq"