What are YAML files used for?

697 views

I keep seeing them throughout GitHub repos, but I’m not sure what their purpose is. I tried looking it up on Google, but the explanations did not suffice. If you know their use, please ELI5

In: Technology

5 Answers

Anonymous 0 Comments

I’ve used them for Azure Devops CICD pipelines which deploy ARM templates across environments. Basically in the YAML file you determine the steps for the deployment of your code.

Anonymous 0 Comments

YAML is a file format for holding structured data, like JSON or XML. It’s not meant for any specific purpose, you can use it to hold any kind of data you want. Different projects on Github can use YAML files for different purposes.

YAML is specifically meant to be both computer readable and human readable. Unlike JSON and XML which have a very rigid structure (which is easy for a computer to parse but harder to a human), YAML has a more flexible structure that makes it more human readable.

Anonymous 0 Comments

YAML files are configuration files that are easy for humans to read/create. They typically store things a program would need at run-time, without having to hard code those values into the program itself. Usually, the program will read in the values from a YAML file so it knows how it should be configured.

They’re basically files that a program can read so it knows the things it needs to know to run in a specific case or environment.

Anonymous 0 Comments

Yaml is a format like json for storing key value pairs and lists.

They are typically used as configuration files for other software to consume.

Anonymous 0 Comments

YAML is yet another data serialization format. It’s often used for configuration files. JSON can be interpreted as YAML, but YAML cannot necessarily be interpreted as JSON. And so, for greater portability, you might as well remain strict and just use JSON.

YAML is terrible. It’s poorly defined, whitespace is significant, there are ambiguities, and full support of YAML means a parser can execute code embedded in the YAML file. It’s not just a data format, it is effectively Turing complete. It’s popular with Python programs and on cloud platforms, where configuration management is a big and complex ordeal.

For the life of me I don’t understand the history, how YAML evolved and managed to propagate. Then again, I don’t understand how many terrible technologies take root. We have a rich assortment of serialization formats, configuration formats, and file formats. We have an assortment of embeddable macro languages so you can templatize anything (and YAML templates are very common, you’ll find YAML templates and YAML files for those templates used to produce YAML files for cloud software – originally there was YAML + Jinga, now there’s YAML + YTT; when templating your config files for your config files gets too hard to manage, yeah, it’s the template syntax to blame…).

For the most part, there’s no point in learning the YAML format by itself unless you’re using software that relies on YAML.