Skip to content

Instantly share code, notes, and snippets.

@SantoshCode
Created November 23, 2021 10:59
Show Gist options
  • Save SantoshCode/bbe0a6035bbb32d5e980832f435e8c70 to your computer and use it in GitHub Desktop.
Save SantoshCode/bbe0a6035bbb32d5e980832f435e8c70 to your computer and use it in GitHub Desktop.
YAML vs JSON

JSON example

{
  "title": "Shopping List",
  "items": [ "item1", "item2" ],
  "location": {
    "country": "Nepal",
    "city": "Kathmandu"
  }
}

YAML example

title: Shopping List
items:
  - item1
  - item2
location:
  country: Nepal
  city: Kathmandu

NOTE: Please note how arrays and object style of representing data is done in JSON and YAML.

We don't always use YAML because it is slow to parse than that of JSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment