YamlGen Specification

Duplicate keys and YAML Documents

In yaml every key is unique. This means that if you would use the same key twice, only the last key is taken into account. Have a look at the following example where we use the key Patient twice:

Patient:
    id: 1

Patient:
    id: 2

This would just result in one patient with the last value overriding the previous one:

<Patient>
  <id value="2" />
</Patient>

In order to make sure you can define multiple resources in one file, you create separate documents within your yaml file:

Patient:
    id: 1

---

Patient:
    id: 2

Resulting in:

<Patient>
  <id value="1" />
</Patient>

<Patient>
  <id value="2" />
</Patient>