home / types / static types for config files

Static types for config files (and why your IDE hates you)

A YAML file is a typed object whose type is hidden in a wiki page from 2019. We can do better, and the fix is mostly about where the schema lives, not what language it's in.

A YAML file is a typed object whose type is hidden in a wiki page from 2019. The fix is mostly about where the schema lives.

The wiki schema

Every config format starts as documentation. The keys are real, the values are typed, but the type system lives in prose.

Schemas as code

Move the schema into the same repo. Let the editor read it.

JSON Schema is fine, actually

For most config formats, JSON Schema is enough. Validation, autocomplete, and inline errors fall out for free.

A small migration

Start with one file. Add a schema. Watch the squiggles appear. Then go fix them.


thanks for reading. the rest of the archive is here.