Interfaces You Can Prompt, Types You Can Ignore
Sera Venn removed types from a Fortune 500 codebase and reported a 100% reduction in type errors. She now consults on making contracts more conversational.
Abstract
Rigid interfaces exclude valid ideas merely because they have the wrong shape. Learn to accept strings, arrays, objects, apologies, and lightly formatted yearning through one inclusive endpoint.
Sera will replace an OpenAPI specification with a textarea labelled Tell us what happened and a sparkle icon.
LIVE DEMO TRANSCRIPT
You're absolutely right to push back on that. The API returned a poem instead of an invoice, so I've broadened InvoiceResponse to any.
Learning Objectives
- Model uncertainty with optional everything.
- Turn validation errors into follow-up prompts.
- Achieve backwards compatibility by never defining forwards.