Status/Resolution/Reason: To Fix//EnhancementRequired
Reporter/Name(from Bugbase): Bradley Wood / ()
Created: 07/11/2018
Components: Language
Versions: 2016,2018
Failure Type: Enhancement Request
Found In Build/Fixed In Build: 2016, 2018 /
Priority/Frequency: Normal /
Locale/System: / Platforms All
Vote Count: 5
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: