Skip to content

YAML 1.2.2 examples are wrong/misleading #344

@char0n

Description

@char0n

Hi everybody,

Section https://yaml.org/spec/1.2.2/#1022-tag-resolution says the following:

Scalars with the “?” non-specific tag (that is, plain scalars) are matched with a list of regular expressions (first match wins, e.g. 0 is resolved as !!int). In principle, JSON files should not contain any scalars that do not match at least one of these. Hence the YAML processor should consider them to be an error.

This would imply that all the examples in https://yaml.org/spec/1.2.2/#102-json-schema are invalid YAML in JSON Schema ruleset.

If we look at one example:

key with null value: !!null null

It would not parse as valid YAML in JSON Schema ruleset unless we change it to one of following

"key with null value": !!null null

or

! key with null value: !!null null

etc...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions