Skip to content

YAML 1.2 schemas support (failsafe, JSON, core, custom) #75

@MOZGIII

Description

@MOZGIII

YAML 1.2 defines support for schemas, which, in turn, specify how you'd parse the data.

See https://yaml.org/spec/1.2.2/#chapter-10-recommended-schemas

It would be nice to have a high-level support for those schemas at the parser level.

I'm thinking something like load::<Failsafe>(mystr) (where we have a type-level distinction between the schemas) or load(mystr, schemas::FAILSAFE) (where we have no type-level distinction between the schemas - cause they're a set of tags and means to resolve them maybe it'd work). I wouldn't want an enum-based API load(mystr, YamlSchema::Core) unless it was accompanied with a way to pass your own schema as in load::<MySchema>(mystr, MySchema::default()) - so, the former would really be load::<YamlSchema>(mystr, YamlSchema::Core).

Refs:

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