tracker issue : CF-4203067

select a category, or use search below
(searches all categories and all time range)
Title:

Support YAML natively

| View in Tracker

Status/Resolution/Reason: To Fix//EnhancementRequired

Reporter/Name(from Bugbase): Bradley Wood / ()

Created: 07/11/2018

Components: Language

Versions: 2016,13.0

Failure Type: Enhancement Request

Found In Build/Fixed In Build: 2016, 2018 /

Priority/Frequency: Normal /

Locale/System: / Platforms All

Vote Count: 4

YAML seems to be everywhere these days but there's no built in functions to serialize/deserialize it like we have for XML or JSON.

I would recommend the BIFs:

YAMLSerialize()
YAMLDeserialize()
However, I am annoyed at the fact that the current JSON functions were named backwards (action Type) instead of (type action) like the rest of the language so I suppose it could be considered to also name them as follows just to match JSON.

serializeYAML()
deserializeYAML()
I've used the Java lib Snake YAML in the past with good results, but I'm sure there's a number of java libs to choose from. Here's an incredibly simple implementation of mine from a while back:
https://github.com/Ortus-Solutions/vagrant-centos-lucee/blob/master/vagrant/provisioners/lib/YAMLParser.cfc

I do think that the data structures that come back from deserialize should be native CFML structs/arrays, etc which requires a bit of massaging.

Attachments:

Comments:

Corresponding Lucee ticket: https://luceeserver.atlassian.net/browse/LDEV-1914
Comment by Bradley Wood
29286 | July 11, 2018 05:21:02 PM GMT
I am seeing more and more YAML out here too. In particular for https://swagger.io/specification/
Vote by James Mohler
29297 | July 12, 2018 02:37:50 PM GMT