Photo by Maxim Dužij on Unsplash

YAML to JSON Cheatsheet

Kenichi Shibata
Dec 26, 2017 · 2 min read

Yaml Cheatsheet

YAML Alt-tab guide

  • Yaml files begin with ---
  • Key value pairs are separated by colon
  • Lists begin with hypen
  • JSON uses {} brackets as separators while Yaml uses spaces or tabs similar to python
  • Spaces and tabs should not be mixed and quotes are not needed in most cases

Parent to child object

YAML

JSON

Parent to child array

YAML

JSON

Parent to child array with object values

YAML

JSON

Parent to child array with a single value

YAML

JSON

Parent to child array with mixed values

YAML

JSON

Key with null value

YAML

JSON

Empty string key

YAML

JSON

Nested complex

YAML

JSON

Join our community Slack and read our weekly Faun topics ⬇

If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇

FAUN

The Must-Read Publication for Aspiring Developers & DevOps Enthusiasts

Kenichi Shibata

Written by

Git Ninja! Linux Nerd. Javascript evangelist. AWS Architect. Software engineer. Kubernetes Mentor and Architect

FAUN

FAUN

The Must-Read Publication for Aspiring Developers & DevOps Enthusiasts. Medium’s largest DevOps publication.

Kenichi Shibata

Written by

Git Ninja! Linux Nerd. Javascript evangelist. AWS Architect. Software engineer. Kubernetes Mentor and Architect

FAUN

FAUN

The Must-Read Publication for Aspiring Developers & DevOps Enthusiasts. Medium’s largest DevOps publication.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store