yamlDeserialize

Parses a YAML string into native CFML values (structs, arrays, numbers, booleans, strings and null).

yamlDeserialize(content) → returns any

This function requires RustCFML.  Not supported on Lucee, Adobe ColdFusion, etc.

Argument Reference

content string
Required

The YAML string to parse.

Examples
Sample code invoking the yamlDeserialize function

Returns a struct mirroring the YAML mapping.

yaml = "name: Alex\nage: 30\nactive: true";
data = yamlDeserialize(yaml);

Expected Result: struct: {name="Alex", age=30, active=true}

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub