Module 06 Summary
What this module established
Declare a response model on every endpoint. It is a security control, not formatting: without it the handler's return value is serialised whole, and a new internal field silently becomes public.
Carry forward
- Every error needs a stable machine-readable code. A client branching on prose breaks the first time someone fixes a typo.
- Declare the error responses in the contract. It tells callers what to handle and surfaces statuses you return unintentionally.
- Widening what you accept is safe; widening what you return breaks any client that switches on the value.
Before moving on
Move on when every endpoint has a response model, every error carries a stable code, and you can classify a change as safe or breaking.
