Contract-First API Design with OpenAPI and TypeScript

Most teams write the API first and document it later. The OpenAPI spec becomes a best-effort snapshot of reality — accurate at the time of writing, outdated by the next PR. Clients get burned. The spec becomes noise nobody trusts.

Contract-first development flips this: define the API shape in YAML before writing a single handler, then generate types from that contract. Both the server and client work against the same source of truth, and the compiler tells you when they've drifted.