1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

YAML in one page

YAML - YAML Ain't Markup Language - is an enhancement over simple key-value properties files. Ruby has a module supporting its use and we use it in our test framework test suites for configuration.

A 5 minute intro is here http://yaml.kwiki.org/?YamlInFiveMinutes

A YAML file consists of one or more records, delimited by --- e.g.

---
- me
- you
- everyone we know

Lists are denoted by - , a dash and a space. So the above record is a list of three elements.

Key value properties are denoted by a : , a colon and a space e.g.

---
url: http://www.zonk.org
username: miranda
password: july

So the above record is a map with three entries.

Maps and lists can be combined e.g.

---
userOne:
- mario
- antonioletti
userTwo:
- amy
- krause

This is a map with two entries (keys userOne, userTwo) each of which map to lists with two elements.

Another way of writing the above is using inline lists e.g.:

---
userOne: [mario, antonioletti]
userTwo: [amy, krause]

Here is a map of maps:

---
relational:
 microsoft: sql server
 ibm: db2
xmldb:
 exist: exist
 apache: xindice

And the same, but using inline maps:

---
relational: {microsoft: sql server, ibm: db2}
xmldb: {exist: exist, apache: xindice}

YAML and Java