type

YamlSchema

abstract const class YamlSchema : Obj

A class used to convert parsed YamlObjs to native Fantom objects, and vice versa.

Different schemas can recognize different tags; for example, the failsafe schema only recognizes the str, seq, and map tags and ignores all the rest (thus only generating Strs, Lists, and Maps), while the JSON schema also recognizes integers, booleans, etc.

See the pod documentation for more information, especially about the specifics of each built-in schema.

fields

core

The default YamlSchema.

failsafe

A basic YamlSchema that only generates maps, lists, and strings.

json

A YamlSchema that can parse all JSON tokens and errors when a plain token is not JSON-compliant.

methods

decode

Recursively transforms the YAML object into a native Fantom object using this tag resolution schema.

encode

Transforms the native Fantom object into a YamlObj hierarchy that preserves as much information as possible.

Slot Details

core

const static YamlSchema core

The default YamlSchema.

decode

virtual Obj? decode(YamlObj node)

Recursively transforms the YAML object into a native Fantom object using this tag resolution schema.

encode

abstract YamlObj encode(Obj? obj)

Transforms the native Fantom object into a YamlObj hierarchy that preserves as much information as possible. The object must be serializable or simple. YamlObjs are encoded as themselves; no further processing is done.

failsafe

const static YamlSchema failsafe

A basic YamlSchema that only generates maps, lists, and strings.

json

const static YamlSchema json

A YamlSchema that can parse all JSON tokens and errors when a plain token is not JSON-compliant.