Skip to course content
Free FastAPI backend course

FastAPI for AI Backend Development

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…

2. An error body should carry…

3. Creation should return…

4. Adding a required field to an existing request model is…

5. Widening an enum you RETURN is…

---

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.