Module 06 Knowledge Check
5 questions. Pass mark 4 out of 5. Answer every question before checking the answer key below, then retry after reading the feedback.
1. Omitting the response model means…
- A. slightly faster responses
- B. the handler's return value is serialised whole
- C. no documentation
- D. a validation error
2. An error body should carry…
- A. a human sentence only
- B. a stable machine-readable code plus context
- C. a stack trace
- D. the request id only
3. Creation should return…
- A. 200 with the id in the body
- B. 201 with a Location header
- C. 204
- D. 202 always
4. Adding a required field to an existing request model is…
- A. safe
- B. breaking - every existing caller starts failing
- C. safe if documented
- D. safe with a default
5. Widening an enum you RETURN is…
- A. safe
- B. breaking for clients that switch on the value
- C. the same as widening one you accept
- D. always fine
---
Answer Key and Explanations
Check these only after attempting every question.
1. B - the handler's return value is serialised whole
A new internal field then becomes public with no code change and no error.
2. B - a stable machine-readable code plus context
A client branching on prose breaks the first time someone fixes a typo.
3. B - 201 with a Location header
Otherwise the client constructs the URL themselves, slightly wrong.
4. B - breaking - every existing caller starts failing
Add it optional, or add a new version path.
5. B - breaking for clients that switch on the value
Widening what you accept is safe; widening what you emit is not.
Practical Check
Apply this module to your own work: complete the module activity for *Response Models, Error Handling and API Documentation*, then write one sentence naming what your result shows and one naming what it does not.
Strong Answer Pattern
A strong answer names the task, the evidence used, the check performed, and the remaining limitation. It avoids "proved", "guaranteed", or "always" unless the evidence genuinely supports it.
