Export a batch of sample person records — generated server-side — as YAML, a whitespace-significant serialization popular in Kubernetes manifests, CI configs, and human-edited fixtures. Unlike JSON, YAML allows unquoted scalars and comments in downstream editing (the generated dump itself is a clean list of mappings).
How it works
peopleToYaml uses the yaml package's stringify on the person array, producing a sequence of mappings with nested keys for structured fields. Nullish values follow the library's omission rules. The result is plain text you can paste into *.yaml fixtures or convert further with yq.
When to use it
- Config-style seed data beside Helm values or Compose files
- Human review of sample records where JSON braces feel noisy
- Diffing person lists in Git with readable line-oriented changes
Limitations
YAML's implicit typing can surprise consumers (no/yes as booleans in other tools)—prefer quoting when hand-editing. Indentation errors after manual edits break parsers. Output is not JSON-compatible until converted. Batch size is capped server-side by the same limits as the generator subtool.
Example
A one-person dump resembles:
- firstName: Ada
lastName: Lovelace
gender: F
birthDate: 1815-12-10
email: ada@example.com
Adding a second person appends another - … list item at the same indentation level.