SchemaOptions: {
    compat?: string | Tags | null;
    customTags?: Tags | ((tags: Tags) => Tags) | null;
    merge?: boolean;
    resolveKnownTags?: boolean;
    schema?: string | yaml.Schema;
    sortMapEntries?: boolean | ((a: Pair, b: Pair) => number);
    toStringDefaults?: ToStringOptions;
}

Type declaration

  • Optionalcompat?: string | Tags | null

    When parsing, warn about compatibility issues with the given schema. When stringifying, use scalar styles that are parsed correctly by the compat schema as well as the actual schema.

    Default: null

  • OptionalcustomTags?: Tags | ((tags: Tags) => Tags) | null

    Array of additional tags to include in the schema, or a function that may modify the schema's base tag array.

  • Optionalmerge?: boolean

    Enable support for << merge keys.

    Default: false for YAML 1.2, true for earlier versions

  • OptionalresolveKnownTags?: boolean

    When using the 'core' schema, support parsing values with these explicit YAML 1.1 tags:

    !!binary, !!omap, !!pairs, !!set, !!timestamp.

    Default true

  • Optionalschema?: string | yaml.Schema

    The base schema to use.

    The core library has built-in support for the following:

    • 'failsafe': A minimal schema that parses all scalars as strings
    • 'core': The YAML 1.2 core schema
    • 'json': The YAML 1.2 JSON schema, with minimal rules for JSON compatibility
    • 'yaml-1.1': The YAML 1.1 schema

    If using another (custom) schema, the customTags array needs to fully define the schema's tags.

    Default: 'core' for YAML 1.2, 'yaml-1.1' for earlier versions

  • OptionalsortMapEntries?: boolean | ((a: Pair, b: Pair) => number)

    When adding to or stringifying a map, sort the entries. If true, sort by comparing key values with <. Does not affect item order when parsing.

    Default: false

  • OptionaltoStringDefaults?: ToStringOptions

    Override default values for toString() options.