Validate YAML file with Schema

Bryant Jimin Son
2 min readDec 5, 2022
Learn how to validate YAML file with Schema

YAML stands for yet another markup language or YAML ain’t markup language (a recursive acronym), which emphasizes that YAML is for data, not documents. If you think about markup languages, those are things like Hypertext Markup Languages (HTML), XML. YAML is used for configuration management tools like Ansible or definiting operations like Kubernetes definition or management files. Although Javascript Object Notation (JSON) is another popular form that competes against YAML, YAML is clearly one of most popular format in those domains.

One unique thing about YAML, though, is that it emphasizes indentation, as it lacks curly braces like JSON schema. In a way, this is similar to Python, as Python uses indentations to establish patterns to interpret. For example, this is an example of Ansible YAML file.

As you can see, YAML format creates a concept of groups and separations with spaces, colons, and dash (-) signs. Although it is pretty readable by human eyes, this schema also increases likelihood of making mistakes by miscalculating number of required blank spaces as you can possibly imagine.

--

--

Bryant Jimin Son
Bryant Jimin Son

Written by Bryant Jimin Son

A cloud practitioner talking about technology, travels & career tips. But I will sometimes cover financial advises and some random stuffs.

No responses yet