APIs
OpenAPI: free-recall review
Retrieval beats re-reading. For each prompt, say or write a full answer from memory before opening the model answer — the effort of recall is what makes the contract discipline stick.
Reconstruct the unit’s spine — why an unenforced spec is fiction, spec-first vs code-first, what codegen and edge validation buy you, what oasdiff catches, and the 3.1 schema shift — without looking back at the lesson.
- 01Why is having an OpenAPI spec not the same as being protected against breaking changes? What actually protects you?
- 02Define contract drift and name the two mechanisms that prevent it.
- 03Contrast spec-first and code-first: what differs, and what enforcement do both still need?
- 04What does codegen buy you, and what makes the difference between a strong generated client and an any-riddled one?
- 05List the canonical breaking changes a diff tool like oasdiff catches, and one compatible alternative to a breaking change.
- 06What changed between OpenAPI 3.0 and 3.1, and why does it matter in practice?
If you could reconstruct each answer from memory, you hold the unit’s spine: an unenforced spec is fiction, and the cure for contract drift is making the spec load-bearing — edge validation and a CI breaking-change diff. Spec-first vs code-first decides where truth lives and whether the contract is reviewed, but both need the same gate. Codegen kills hand-rolled-request bugs only when the schema is tight, oasdiff catches the canonical breaking changes (added required field, removed response field, narrowed type), and OpenAPI 3.1 moves schemas to JSON Schema 2020-12 with type-array nullability. Always: make the contract impossible to break silently.